mirror of https://github.com/zlatinb/muwire
do not persist browse tabs across sessions
parent
55c82afac8
commit
7120875fd6
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue