Save past player paths in GuiConfig (Etoh/Uriziel combo)

This commit is contained in:
Etoh 2013-10-13 21:25:41 +01:00
parent f545ada34a
commit 461ca0f442

View File

@ -75,6 +75,11 @@ class ConfigDialog(QtGui.QDialog):
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")
def _tryToFillPlayerPath(self, playerpath, playerpathlist):
settings = QSettings("Syncplay", "MediaBrowseDialog")
settings.beginGroup("PlayerList")
savedPlayers = settings.value("PlayerList", [])
playerpathlist = list(set([os.path.normcase(path) for path in set(playerpathlist + savedPlayers)]))
settings.endGroup()
foundpath = ""
if playerpath != None and playerpath != "" and os.path.isfile(playerpath):
@ -82,15 +87,17 @@ class ConfigDialog(QtGui.QDialog):
self.executablepathCombobox.addItem(foundpath)
for path in playerpathlist:
if(os.path.isfile(path) and path.lower() != foundpath.lower()):
if(os.path.isfile(path) and os.path.normcase(path) != os.path.normcase(foundpath)):
self.executablepathCombobox.addItem(path)
if foundpath == None:
if foundpath == "":
foundpath = path
if foundpath:
return(foundpath)
else:
return("")
if foundpath != "":
settings.beginGroup("PlayerList")
playerpathlist.append(os.path.normcase(foundpath))
settings.setValue("PlayerList", list(set([os.path.normcase(path) for path in set(playerpathlist)])))
settings.endGroup()
return(foundpath)
def browsePlayerpath(self):
options = QtGui.QFileDialog.Options()