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

@ -383,6 +383,9 @@ class FileSelection(QtWidgets.QVBoxLayout):
# Update the file list
self.file_list.update()
# Save the latest file list to mode settings
self.save_filenames()
def add(self):
"""
Add button clicked.
@ -452,6 +455,25 @@ class FileSelection(QtWidgets.QVBoxLayout):
"""
return len(range(self.file_list.count()))
def get_filenames(self):
"""
Return the list of file and folder names
"""
filenames = []
for index in range(self.file_list.count()):
filenames.append(self.file_list.item(index).filename)
return filenames
def save_filenames(self):
"""
Save the filenames to mode settings
"""
filenames = self.get_filenames()
if self.parent.tab.mode == self.common.gui.MODE_SHARE:
self.parent.settings.set("share", "filenames", filenames)
elif self.parent.tab.mode == self.common.gui.MODE_WEBSITE:
self.parent.settings.set("website", "filenames", filenames)
def setFocus(self):
"""
Set the Qt app focus on the file selection box.