mirror of
https://github.com/Syncplay/syncplay
synced 2024-12-16 11:55:11 +00:00
Use first mediaSearch directory as first choice for open file initial directory, followed by directory of currently open file
This commit is contained in:
parent
c66ae60d43
commit
bb2308c0c9
@ -229,7 +229,9 @@ class ConfigDialog(QtGui.QDialog):
|
||||
def browseMediapath(self):
|
||||
self.loadMediaBrowseSettings()
|
||||
options = QtGui.QFileDialog.Options()
|
||||
if os.path.isdir(self.mediadirectory):
|
||||
if self.config["mediaSearchDirectories"] and os.path.isdir(self.config["mediaSearchDirectories"][0]):
|
||||
defaultdirectory = self.config["mediaSearchDirectories"][0]
|
||||
elif os.path.isdir(self.mediadirectory):
|
||||
defaultdirectory = self.mediadirectory
|
||||
elif os.path.isdir(QDesktopServices.storageLocation(QDesktopServices.MoviesLocation)):
|
||||
defaultdirectory = QDesktopServices.storageLocation(QDesktopServices.MoviesLocation)
|
||||
|
@ -417,7 +417,13 @@ class MainWindow(QtGui.QMainWindow):
|
||||
|
||||
self.loadMediaBrowseSettings()
|
||||
options = QtGui.QFileDialog.Options()
|
||||
if os.path.isdir(self.mediadirectory):
|
||||
self.mediadirectory = ""
|
||||
currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None
|
||||
if currentdirectory and os.path.isdir(currentdirectory):
|
||||
defaultdirectory = currentdirectory
|
||||
elif self.config["mediaSearchDirectories"] and os.path.isdir(self.config["mediaSearchDirectories"][0]):
|
||||
defaultdirectory = self.config["mediaSearchDirectories"][0]
|
||||
elif os.path.isdir(self.mediadirectory):
|
||||
defaultdirectory = self.mediadirectory
|
||||
elif os.path.isdir(QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.MoviesLocation)):
|
||||
defaultdirectory = QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.MoviesLocation)
|
||||
|
Loading…
Reference in New Issue
Block a user