Merge pull request #145 from alby128/master

"Fixes" file dialogs on macOS
This commit is contained in:
Etoh 2017-09-14 18:20:29 +01:00 committed by GitHub
commit 1b873d16e3

View File

@ -781,6 +781,9 @@ class MainWindow(QtGui.QMainWindow):
return
self.loadMediaBrowseSettings()
if sys.platform.startswith('darwin'):
options = QtGui.QFileDialog.Options(QtGui.QFileDialog.DontUseNativeDialog)
else:
options = QtGui.QFileDialog.Options()
self.mediadirectory = ""
currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None
@ -954,7 +957,11 @@ class MainWindow(QtGui.QMainWindow):
@needsClient
def openAddMediaDirectoryDialog(self, MediaDirectoriesTextbox, MediaDirectoriesDialog):
folderName = unicode(QtGui.QFileDialog.getExistingDirectory(self,None,self.getInitialMediaDirectory(includeUserSpecifiedDirectories=False),QtGui.QFileDialog.ShowDirsOnly))
if sys.platform.startswith('darwin'):
options = QtGui.QFileDialog.Options(QtGui.QFileDialog.ShowDirsOnly | QtGui.QFileDialog.DontUseNativeDialog)
else:
options = QtGui.QFileDialog.Options(QtGui.QFileDialog.ShowDirsOnly)
folderName = unicode(QtGui.QFileDialog.getExistingDirectory(self,None,self.getInitialMediaDirectory(includeUserSpecifiedDirectories=False),options))
if folderName:
existingMediaDirs = MediaDirectoriesTextbox.toPlainText()
if existingMediaDirs == "":