From aeed8569a91ff8f9372cacae6c18b29c3b55de55 Mon Sep 17 00:00:00 2001 From: alby128 Date: Thu, 14 Sep 2017 14:59:38 +0200 Subject: [PATCH] Fixes file dialogs on macOS --- syncplay/ui/gui.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index 4250d6f..a2e1eb5 100644 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -781,7 +781,10 @@ class MainWindow(QtGui.QMainWindow): return self.loadMediaBrowseSettings() - options = QtGui.QFileDialog.Options() + 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 if currentdirectory and os.path.isdir(currentdirectory): @@ -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 == "":