This commit is contained in:
Tim Bentley 2010-06-30 17:11:09 +01:00
commit 6cd1e520a1
2 changed files with 7 additions and 4 deletions

View File

@ -845,7 +845,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
recentFileCount = QtCore.QSettings().value(
self.generalSettingsSection + u'/max recent files',
QtCore.QVariant(4)).toInt()[0]
if filename and filename not in self.recentFiles:
if filename:
position = self.recentFiles.indexOf(filename)
if position != -1:
self.recentFiles.removeAt(position)
self.recentFiles.insert(0, QtCore.QString(filename))
while self.recentFiles.count() > recentFileCount:
self.recentFiles.removeLast()

View File

@ -625,13 +625,13 @@ class ServiceManager(QtGui.QWidget):
def onLoadService(self, lastService=False):
if lastService:
filename = SettingsManager.get_last_dir(
self.parent.serviceSettingsSection)
filename = self.parent.recentFiles[0]
else:
filename = QtGui.QFileDialog.getOpenFileName(
self, translate('ServiceManager', 'Open Service'),
SettingsManager.get_last_dir(
self.parent.serviceSettingsSection), u'Services (*.osz)')
filename = QtCore.QDir.toNativeSeparators(filename)
self.loadService(filename)
def loadService(self, filename=None):
@ -662,7 +662,7 @@ class ServiceManager(QtGui.QWidget):
name = filename.split(os.path.sep)
if filename:
SettingsManager.set_last_dir(self.parent.serviceSettingsSection,
name[0])
os.path.split(filename)[0])
zip = None
file_to = None
try: