From d6bd2b393827feb0f9958e842658ec18c458568c Mon Sep 17 00:00:00 2001 From: sendiulo Date: Sat, 21 Sep 2013 14:31:47 +0200 Subject: [PATCH] - GUI settings done --- src/bitmessageqt/__init__.py | 24 +++++++++++- src/bitmessageqt/bitmessage_icons_rc.py | 2 +- src/bitmessageqt/bitmessageui.py | 2 +- src/bitmessageqt/settings.py | 38 +++++-------------- src/bitmessageqt/settings.ui | 49 +------------------------ 5 files changed, 36 insertions(+), 79 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index dd1c1a7a..5895c98f 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2241,10 +2241,20 @@ class MyForm(QtGui.QMainWindow): self.settingsDialogInstance.ui.checkBoxStartInTray.isChecked())) shared.config.set('bitmessagesettings', 'willinglysendtomobile', str( self.settingsDialogInstance.ui.checkBoxWillinglySendToMobile.isChecked())) + lang_ind = int(self.settingsDialogInstance.ui.languageComboBox.currentIndex()) if not languages[lang_ind] == 'other': shared.config.set('bitmessagesettings', 'userlocale', languages[lang_ind]) + + ### + curr_index = self.settingsDialogInstance.ui.comboBoxIdenticonStyle.currentIndex() + shared.config.set('bitmessagesettings', 'identicon', str(self.settingsDialogInstance.ui.comboBoxIdenticonStyle.itemData( + curr_index , Qt.UserRole).toString())) + shared.config.set('bitmessagesettings', 'identiconsuffix', str( + self.settingsDialogInstance.ui.lineEditIdenticonSuffix.text())) + shared.config.set('bitmessagesettings', 'avatars', str( + self.settingsDialogInstance.ui.checkBoxLoadAvatars.isChecked())) if int(shared.config.get('bitmessagesettings', 'port')) != int(self.settingsDialogInstance.ui.lineEditTCPPort.text()): if not shared.safeConfigGetBoolean('bitmessagesettings', 'dontconnect'): @@ -3104,7 +3114,6 @@ class MyForm(QtGui.QMainWindow): # set the icon thisTableWidget.item( currentRow, 0).setIcon(avatarize(addressAtCurrentRow)) - ### shared.reloadBroadcastSendersForWhichImWatching() self.rerenderSubscriptions() self.rerenderComboBoxSendFrom() @@ -3349,6 +3358,19 @@ class settingsDialog(QtGui.QDialog): curr_index = languages.index('other') self.ui.languageComboBox.setCurrentIndex(curr_index) + ### + self.ui.comboBoxIdenticonStyle.addItem(QIcon(":/newPrefix/images/no_identicons.png"), _translate("settingsDialog", "None"), "none") + self.ui.comboBoxIdenticonStyle.addItem(QIcon(":/newPrefix/images/qidenticon.png"), _translate("settingsDialog", "QIdenticon"), "qidenticon") + self.ui.comboBoxIdenticonStyle.addItem(QIcon(":/newPrefix/images/qidenticon_x.png"), _translate("settingsDialog", "QIdenticon (transparent)"), "qidenticon_x") + self.ui.comboBoxIdenticonStyle.addItem(QIcon(":/newPrefix/images/qidenticon_two.png"), _translate("settingsDialog", "QIdenticon two"), "qidenticon_two") + self.ui.comboBoxIdenticonStyle.addItem(QIcon(":/newPrefix/images/qidenticon_two_x.png"), _translate("settingsDialog", "QIdenticon two (transparent)"), "qidenticon_two_x") + curr_index = self.ui.comboBoxIdenticonStyle.findData(str(shared.config.get('bitmessagesettings', 'identicon')), Qt.UserRole) + self.ui.comboBoxIdenticonStyle.setCurrentIndex(curr_index) + self.ui.lineEditIdenticonSuffix.setText( + str(shared.config.get('bitmessagesettings', 'identiconsuffix'))) + self.ui.checkBoxLoadAvatars.setChecked( + shared.safeConfigGetBoolean('bitmessagesettings', 'avatars')) + if shared.appdata == '': self.ui.checkBoxPortableMode.setChecked(True) if 'darwin' in sys.platform: diff --git a/src/bitmessageqt/bitmessage_icons_rc.py b/src/bitmessageqt/bitmessage_icons_rc.py index 2db046a4..bb0a02c0 100644 --- a/src/bitmessageqt/bitmessage_icons_rc.py +++ b/src/bitmessageqt/bitmessage_icons_rc.py @@ -2,7 +2,7 @@ # Resource object code # -# Created: Sa 21. Sep 09:44:10 2013 +# Created: Sa 21. Sep 13:45:58 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index e186fba3..10fb1f8f 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'bitmessageui.ui' # -# Created: Sat Sep 21 09:44:07 2013 +# Created: Sat Sep 21 13:55:14 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! diff --git a/src/bitmessageqt/settings.py b/src/bitmessageqt/settings.py index 054aead7..d80f5e80 100644 --- a/src/bitmessageqt/settings.py +++ b/src/bitmessageqt/settings.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'settings.ui' # -# Created: Sat Sep 21 09:44:07 2013 +# Created: Sat Sep 21 13:55:15 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! @@ -83,31 +83,16 @@ class Ui_settingsDialog(object): self.gridLayout_5.addWidget(self.groupBox, 7, 1, 4, 1) self.groupBox_3 = QtGui.QGroupBox(self.tabUserInterface) self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) - self.comboBox = QtGui.QComboBox(self.groupBox_3) - self.comboBox.setGeometry(QtCore.QRect(20, 20, 251, 31)) - self.comboBox.setIconSize(QtCore.QSize(24, 24)) - self.comboBox.setObjectName(_fromUtf8("comboBox")) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/no_identicons.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.comboBox.addItem(icon, _fromUtf8("")) - icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/qidenticon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.comboBox.addItem(icon1, _fromUtf8("")) - icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/qidenticon_x.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.comboBox.addItem(icon2, _fromUtf8("")) - icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/qidenticon_two.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.comboBox.addItem(icon3, _fromUtf8("")) - icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/qidenticon_two_x.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.comboBox.addItem(icon4, _fromUtf8("")) + self.comboBoxIdenticonStyle = QtGui.QComboBox(self.groupBox_3) + self.comboBoxIdenticonStyle.setGeometry(QtCore.QRect(20, 20, 251, 31)) + self.comboBoxIdenticonStyle.setIconSize(QtCore.QSize(24, 24)) + self.comboBoxIdenticonStyle.setObjectName(_fromUtf8("comboBoxIdenticonStyle")) self.checkBoxLoadAvatars = QtGui.QCheckBox(self.groupBox_3) self.checkBoxLoadAvatars.setGeometry(QtCore.QRect(20, 50, 121, 18)) self.checkBoxLoadAvatars.setObjectName(_fromUtf8("checkBoxLoadAvatars")) - self.lineEdit = QtGui.QLineEdit(self.groupBox_3) - self.lineEdit.setGeometry(QtCore.QRect(140, 50, 131, 16)) - self.lineEdit.setObjectName(_fromUtf8("lineEdit")) + self.lineEditIdenticonSuffix = QtGui.QLineEdit(self.groupBox_3) + self.lineEditIdenticonSuffix.setGeometry(QtCore.QRect(140, 50, 131, 16)) + self.lineEditIdenticonSuffix.setObjectName(_fromUtf8("lineEditIdenticonSuffix")) self.gridLayout_5.addWidget(self.groupBox_3, 7, 0, 4, 1) self.tabWidgetSettings.addTab(self.tabUserInterface, _fromUtf8("")) self.tabNetworkSettings = QtGui.QWidget() @@ -380,13 +365,8 @@ class Ui_settingsDialog(object): self.languageComboBox.setItemText(7, _translate("settingsDialog", "Pirate English", "en_pirate")) self.languageComboBox.setItemText(8, _translate("settingsDialog", "Other (set in keys.dat)", "other")) self.groupBox_3.setTitle(_translate("settingsDialog", "Identicons (with example image)", None)) - self.comboBox.setItemText(0, _translate("settingsDialog", "no identicons", None)) - self.comboBox.setItemText(1, _translate("settingsDialog", "qidenticon", None)) - self.comboBox.setItemText(2, _translate("settingsDialog", "qidenticon_x", None)) - self.comboBox.setItemText(3, _translate("settingsDialog", "qidenticon_two", None)) - self.comboBox.setItemText(4, _translate("settingsDialog", "qidenticon_two_x", None)) self.checkBoxLoadAvatars.setText(_translate("settingsDialog", "Load avatar images", None)) - self.lineEdit.setToolTip(_translate("settingsDialog", "

The content of this text field will be appended to the BM-address before creating the hash for the identicons. By default it is filled with a random string to make the identicons in your client unique, otherwise the identicon could be an attack vector if an adversary creates an address resulting in a similar identicon. If you keep this string (or any other random or non-random string) you will be able to keep the same identicons.

", None)) + self.lineEditIdenticonSuffix.setToolTip(_translate("settingsDialog", "

The content of this text field will be appended to the BM-address before creating the hash for the identicons. By default it is filled with a random string to make the identicons in your client unique, otherwise the identicon could be an attack vector if an adversary creates an address resulting in a similar identicon. If you keep this string (or any other random or non-random string) you will be able to keep the same identicons.

", None)) self.tabWidgetSettings.setTabText(self.tabWidgetSettings.indexOf(self.tabUserInterface), _translate("settingsDialog", "User Interface", None)) self.groupBox1.setTitle(_translate("settingsDialog", "Listening port", None)) self.label.setText(_translate("settingsDialog", "Listen for connections on port:", None)) diff --git a/src/bitmessageqt/settings.ui b/src/bitmessageqt/settings.ui index a5e6e4e6..dd330f2c 100644 --- a/src/bitmessageqt/settings.ui +++ b/src/bitmessageqt/settings.ui @@ -155,7 +155,7 @@ Identicons (with example image) - + 20 @@ -170,51 +170,6 @@ 24 - - - no identicons - - - - :/newPrefix/images/no_identicons.png:/newPrefix/images/no_identicons.png - - - - - qidenticon - - - - :/newPrefix/images/qidenticon.png:/newPrefix/images/qidenticon.png - - - - - qidenticon_x - - - - :/newPrefix/images/qidenticon_x.png:/newPrefix/images/qidenticon_x.png - - - - - qidenticon_two - - - - :/newPrefix/images/qidenticon_two.png:/newPrefix/images/qidenticon_two.png - - - - - qidenticon_two_x - - - - :/newPrefix/images/qidenticon_two_x.png:/newPrefix/images/qidenticon_two_x.png - - @@ -229,7 +184,7 @@ Load avatar images - + 140