Skip to content

Commit

Permalink
save recent files to application settings
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzy69 committed May 12, 2017
1 parent 47f55f1 commit cc6a881
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

ui = uic.loadUiType(os.path.join(ROOT, "assets", "ui", "mainwindow.ui"))[0]

MAX_RECENT_FILES = 10
MAX_RECENT_FILES = 5

class MainWindow(QtWidgets.QMainWindow, ui):
def __init__(self, parent=None):
Expand Down Expand Up @@ -95,6 +95,7 @@ def loadSettings(self):
# self._tableViewWidth = int(settings.value("tableViewWidth", ''))
self.threadsSpin.setValue(settings.value("threadsCount", THREADS, type=int))
self.timeoutSpin.setValue(settings.value("timeoutSpin", TIMEOUT, type=int))
self._recentFiles = settings.value("recentFiles", [], type=str)

def saveSettings(self):
settings = QSettings(self._settingsFile, QSettings.IniFormat)
Expand All @@ -103,6 +104,7 @@ def saveSettings(self):
# settings.setValue("tableViewWidth", self.sitesTableView.frameGeometry().width())
settings.setValue("threadsCount", self.threadsSpin.value())
settings.setValue("timeout", self.timeoutSpin.value())
settings.setValue("recentFiles", self._recentFiles)

def onResize(self, event):
self.resizeTableColumns()
Expand Down

0 comments on commit cc6a881

Please sign in to comment.