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
def results = new ConcurrentHashMap<>()
def browses = new ConcurrentHashSet<String>()
def downloads = []
def uploads = []
boolean treeVisible = true

View File

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

View File

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