mirror of
https://github.com/Syncplay/syncplay
synced 2025-03-01 01:10:25 +00:00
Save past player paths in GuiConfig (Etoh/Uriziel combo)
This commit is contained in:
parent
f545ada34a
commit
461ca0f442
@ -75,6 +75,11 @@ class ConfigDialog(QtGui.QDialog):
|
|||||||
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")
|
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")
|
||||||
|
|
||||||
def _tryToFillPlayerPath(self, playerpath, playerpathlist):
|
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 = ""
|
foundpath = ""
|
||||||
|
|
||||||
if playerpath != None and playerpath != "" and os.path.isfile(playerpath):
|
if playerpath != None and playerpath != "" and os.path.isfile(playerpath):
|
||||||
@ -82,15 +87,17 @@ class ConfigDialog(QtGui.QDialog):
|
|||||||
self.executablepathCombobox.addItem(foundpath)
|
self.executablepathCombobox.addItem(foundpath)
|
||||||
|
|
||||||
for path in playerpathlist:
|
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)
|
self.executablepathCombobox.addItem(path)
|
||||||
if foundpath == None:
|
if foundpath == "":
|
||||||
foundpath = path
|
foundpath = path
|
||||||
|
|
||||||
if foundpath:
|
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)
|
return(foundpath)
|
||||||
else:
|
|
||||||
return("")
|
|
||||||
|
|
||||||
def browsePlayerpath(self):
|
def browsePlayerpath(self):
|
||||||
options = QtGui.QFileDialog.Options()
|
options = QtGui.QFileDialog.Options()
|
||||||
|
Loading…
Reference in New Issue
Block a user