mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-08 01:15:00 -04:00
When disabling persistence, or closing a persistent tab, delete the mode settings file for that tab
This commit is contained in:
parent
7819a894be
commit
1bca467ce3
3 changed files with 16 additions and 3 deletions
|
@ -150,6 +150,11 @@ class TabWidget(QtWidgets.QTabWidget):
|
|||
self.common.log("TabWidget", "close_tab", f"{index}")
|
||||
tab = self.widget(index)
|
||||
if tab.close_tab():
|
||||
# If the tab is persistent, delete the settings file from disk
|
||||
if tab.settings.get("persistent", "enabled"):
|
||||
tab.settings.delete()
|
||||
|
||||
# Remove the tab
|
||||
self.removeTab(index)
|
||||
del self.tabs[tab.tab_id]
|
||||
|
||||
|
@ -157,6 +162,8 @@ class TabWidget(QtWidgets.QTabWidget):
|
|||
if self.count() == 0:
|
||||
self.new_tab_clicked()
|
||||
|
||||
self.save_persistent_tabs()
|
||||
|
||||
def are_tabs_active(self):
|
||||
"""
|
||||
See if there are active servers in any open tabs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue