From 8c6caab299d91df573e85d86750cfedd47543058 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Mon, 4 Jul 2016 00:13:41 +0300 Subject: [PATCH] gnome file dialog fix --- src/list_items.py | 4 ++-- src/mainscreen.py | 2 +- src/menu.py | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/list_items.py b/src/list_items.py index c883df4..78e12c3 100644 --- a/src/list_items.py +++ b/src/list_items.py @@ -351,7 +351,7 @@ class FileTransferItem(QtGui.QListWidget): directory = QtGui.QFileDialog.getExistingDirectory(self, QtGui.QApplication.translate("MainWindow", 'Choose folder', None, QtGui.QApplication.UnicodeUTF8), curr_directory(), - QtGui.QFileDialog.ShowDirsOnly) + QtGui.QFileDialog.ShowDirsOnly | QtGui.QFileDialog.DontUseNativeDialog) self.pb.setVisible(True) if directory: pr = profile.Profile.get_instance() @@ -485,7 +485,7 @@ class InlineImageItem(QtGui.QScrollArea): 'Choose folder', None, QtGui.QApplication.UnicodeUTF8), curr_directory(), - QtGui.QFileDialog.ShowDirsOnly) + QtGui.QFileDialog.ShowDirsOnly | QtGui.QFileDialog.DontUseNativeDialog) if directory: fl = QtCore.QFile(directory + '/toxygen_inline_' + curr_time().replace(':', '_') + '.png') self._pixmap.save(fl, 'PNG') diff --git a/src/mainscreen.py b/src/mainscreen.py index 8bc7f13..227619d 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -425,7 +425,7 @@ class MainWindow(QtGui.QMainWindow): self.menu.hide() if self.profile.active_friend + 1: choose = QtGui.QApplication.translate("MainWindow", 'Choose file', None, QtGui.QApplication.UnicodeUTF8) - name = QtGui.QFileDialog.getOpenFileName(self, choose) + name = QtGui.QFileDialog.getOpenFileName(self, choose, options=QtGui.QFileDialog.DontUseNativeDialog) if name[0]: self.profile.send_file(name[0]) diff --git a/src/menu.py b/src/menu.py index aeacf81..a9b22a1 100644 --- a/src/menu.py +++ b/src/menu.py @@ -235,7 +235,8 @@ class ProfileSettings(CenteredWidget): def set_avatar(self): choose = QtGui.QApplication.translate("ProfileSettingsForm", "Choose avatar", None, QtGui.QApplication.UnicodeUTF8) - name = QtGui.QFileDialog.getOpenFileName(self, choose, None, 'Images (*.png)') + name = QtGui.QFileDialog.getOpenFileName(self, choose, None, 'Images (*.png)', + options=QtGui.QFileDialog.DontUseNativeDialog) if name[0]: bitmap = QtGui.QPixmap(name[0]) bitmap.scaled(QtCore.QSize(128, 128), aspectMode=QtCore.Qt.KeepAspectRatio, @@ -248,7 +249,7 @@ class ProfileSettings(CenteredWidget): Profile.get_instance().set_avatar(str(byte_array.data())) def export_profile(self): - directory = QtGui.QFileDialog.getExistingDirectory() + '/' + directory = QtGui.QFileDialog.getExistingDirectory(options=QtGui.QFileDialog.DontUseNativeDialog) + '/' if directory != '/': ProfileHelper.get_instance().export_profile(directory) settings = Settings.get_instance() @@ -477,7 +478,7 @@ class PrivacySettings(CenteredWidget): settings.save() def new_path(self): - directory = QtGui.QFileDialog.getExistingDirectory() + '/' + directory = QtGui.QFileDialog.getExistingDirectory(options=QtGui.QFileDialog.DontUseNativeDialog) + '/' if directory != '/': self.path.setPlainText(directory)