some broken dialogs fixed
This commit is contained in:
parent
b081bff2ce
commit
3546dbd75b
@ -247,12 +247,12 @@ class ProfileSettings(CenteredWidget):
|
|||||||
|
|
||||||
def set_avatar(self):
|
def set_avatar(self):
|
||||||
choose = QtWidgets.QApplication.translate("ProfileSettingsForm", "Choose avatar")
|
choose = QtWidgets.QApplication.translate("ProfileSettingsForm", "Choose avatar")
|
||||||
name = QtWidgets.QFileDialog.getOpenFileName(self, choose, None, 'Images (*.png)',
|
name = QtWidgets.QFileDialog.getOpenFileName(self, choose, None, None, 'Images (*.png)',
|
||||||
QtGui.QComboBoxQtWidgets.QFileDialog.DontUseNativeDialog)
|
QtWidgets.QFileDialog.DontUseNativeDialog)
|
||||||
if name[0]:
|
if name[0]:
|
||||||
bitmap = QtGui.QPixmap(name[0])
|
bitmap = QtGui.QPixmap(name[0])
|
||||||
bitmap.scaled(QtCore.QSize(128, 128), aspectMode=QtCore.Qt.KeepAspectRatio,
|
bitmap.scaled(128, 128, QtCore.Qt.KeepAspectRatio,
|
||||||
mode=QtCore.Qt.SmoothTransformation)
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
|
||||||
byte_array = QtCore.QByteArray()
|
byte_array = QtCore.QByteArray()
|
||||||
buffer = QtCore.QBuffer(byte_array)
|
buffer = QtCore.QBuffer(byte_array)
|
||||||
@ -261,14 +261,15 @@ class ProfileSettings(CenteredWidget):
|
|||||||
Profile.get_instance().set_avatar(bytes(byte_array.data()))
|
Profile.get_instance().set_avatar(bytes(byte_array.data()))
|
||||||
|
|
||||||
def export_profile(self):
|
def export_profile(self):
|
||||||
directory = QtWidgets.QFileDialog.getExistingDirectory(options=QtWidgets.QFileDialog.DontUseNativeDialog,
|
directory = QtWidgets.QFileDialog.getExistingDirectory(self, '', curr_directory() + '/',
|
||||||
dir=curr_directory()) + '/'
|
QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog)
|
||||||
|
|
||||||
if directory != '/':
|
if directory != '/':
|
||||||
reply = QtWidgets.QMessageBox.question(None,
|
reply = QtWidgets.QMessageBox.question(None,
|
||||||
QtWidgets.QApplication.translate("ProfileSettingsForm",
|
QtWidgets.QApplication.translate("ProfileSettingsForm",
|
||||||
'Use new path'),
|
'Use new path'),
|
||||||
QtWidgets.QApplication.translate("ProfileSettingsForm",
|
QtWidgets.QApplication.translate("ProfileSettingsForm",
|
||||||
'Do you want to move your profile to this location?'),
|
'Do you want to move your profile to this location?'),
|
||||||
QtWidgets.QMessageBox.Yes,
|
QtWidgets.QMessageBox.Yes,
|
||||||
QtWidgets.QMessageBox.No)
|
QtWidgets.QMessageBox.No)
|
||||||
settings = Settings.get_instance()
|
settings = Settings.get_instance()
|
||||||
@ -493,7 +494,8 @@ class PrivacySettings(CenteredWidget):
|
|||||||
settings.save()
|
settings.save()
|
||||||
|
|
||||||
def new_path(self):
|
def new_path(self):
|
||||||
directory = QtWidgets.QFileDialog.getExistingDirectory(options=QtWidgets.QFileDialog.DontUseNativeDialog) + '/'
|
directory = QtWidgets.QFileDialog.getExistingDirectory(self, '', curr_directory() + '/',
|
||||||
|
QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog) + '/'
|
||||||
if directory != '/':
|
if directory != '/':
|
||||||
self.path.setPlainText(directory)
|
self.path.setPlainText(directory)
|
||||||
|
|
||||||
@ -658,10 +660,10 @@ class InterfaceSettings(CenteredWidget):
|
|||||||
|
|
||||||
def import_st(self):
|
def import_st(self):
|
||||||
directory = QtWidgets.QFileDialog.getExistingDirectory(self,
|
directory = QtWidgets.QFileDialog.getExistingDirectory(self,
|
||||||
QtWidgets.QApplication.translate("MainWindow",
|
QtWidgets.QApplication.translate("MainWindow",
|
||||||
'Choose folder with sticker pack'),
|
'Choose folder with sticker pack'),
|
||||||
curr_directory(),
|
curr_directory(),
|
||||||
QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog)
|
QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog)
|
||||||
|
|
||||||
if directory:
|
if directory:
|
||||||
src = directory + '/'
|
src = directory + '/'
|
||||||
|
Loading…
Reference in New Issue
Block a user