do not persist browse tabs across sessions

pull/53/head
Zlatin Balevsky 2020-10-20 13:36:02 +01:00
parent 55c82afac8
commit 7120875fd6
No known key found for this signature in database
GPG Key ID: A72832072D525E41
3 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,7 @@ class MainFrameModel {
@Observable boolean routerPresent @Observable boolean routerPresent
def results = new ConcurrentHashMap<>() def results = new ConcurrentHashMap<>()
def browses = new ConcurrentHashSet<String>()
def downloads = [] def downloads = []
def uploads = [] def uploads = []
boolean treeVisible = true boolean treeVisible = true

View File

@ -186,6 +186,7 @@ class BrowseView {
controller.register() controller.register()
def mainFrameGroup = application.mvcGroupManager.findGroup("MainFrame") def mainFrameGroup = application.mvcGroupManager.findGroup("MainFrame")
mainFrameGroup.model.browses.add(model.host.getHumanReadableName())
parent = mainFrameGroup.view.builder.getVariable("result-tabs") parent = mainFrameGroup.view.builder.getVariable("result-tabs")
parent.addTab(model.host.getHumanReadableName(), p) parent.addTab(model.host.getHumanReadableName(), p)
@ -225,6 +226,9 @@ class BrowseView {
} }
def closeTab = { def closeTab = {
def mainFrameGroup = application.mvcGroupManager.findGroup("MainFrame")
mainFrameGroup.model.browses.remove(model.host.getHumanReadableName())
int index = parent.indexOfTab(model.host.getHumanReadableName()) int index = parent.indexOfTab(model.host.getHumanReadableName())
parent.removeTabAt(index) parent.removeTabAt(index)
model.downloadActionEnabled = false model.downloadActionEnabled = false

View File

@ -1525,6 +1525,7 @@ class MainFrameView {
int count = tabbedPane.getTabCount() int count = tabbedPane.getTabCount()
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
settings.openTabs.add(tabbedPane.getTitleAt(i)) settings.openTabs.add(tabbedPane.getTitleAt(i))
settings.openTabs.removeAll(model.browses)
JFrame mainFrame = builder.getVariable("main-frame") JFrame mainFrame = builder.getVariable("main-frame")