Make it so when you open the GUI, all of the persistent tabs automatically open as well

This commit is contained in:
Micah Lee 2019-11-02 22:55:22 -07:00
parent a5f8fee065
commit 7819a894be
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
4 changed files with 39 additions and 18 deletions

View file

@ -138,15 +138,18 @@ class Tab(QtWidgets.QWidget):
)
self.persistent_image_label.setFixedSize(20, 20)
def init(self, mode_settings=None):
if mode_settings:
# Load this tab
self.settings = mode_settings
mode = self.settings.get("persistent", "mode")
if mode == "share":
self.filenames = self.settings.get("share", "filenames")
self.share_mode_clicked()
elif mode == "receive":
self.receive_mode_clicked()
elif mode == "website":
self.filenames = self.settings.get("website", "filenames")
self.website_mode_clicked()
else:
# This is a new tab