mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-09 06:42:37 -04:00
Make it so when you open the GUI, all of the persistent tabs automatically open as well
This commit is contained in:
parent
a5f8fee065
commit
7819a894be
4 changed files with 39 additions and 18 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue