- GUI settings done

This commit is contained in:
sendiulo 2013-09-21 14:31:47 +02:00
parent a58164d831
commit d6bd2b3938
5 changed files with 36 additions and 79 deletions

View File

@ -2242,10 +2242,20 @@ class MyForm(QtGui.QMainWindow):
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'):
QMessageBox.about(self, _translate("MainWindow", "Restart"), _translate(
@ -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:

View File

@ -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!

View File

@ -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!

View File

@ -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", "<html><head/><body><p>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.</p></body></html>", None))
self.lineEditIdenticonSuffix.setToolTip(_translate("settingsDialog", "<html><head/><body><p>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.</p></body></html>", 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))

View File

@ -155,7 +155,7 @@
<property name="title">
<string>Identicons (with example image)</string>
</property>
<widget class="QComboBox" name="comboBox">
<widget class="QComboBox" name="comboBoxIdenticonStyle">
<property name="geometry">
<rect>
<x>20</x>
@ -170,51 +170,6 @@
<height>24</height>
</size>
</property>
<item>
<property name="text">
<string>no identicons</string>
</property>
<property name="icon">
<iconset resource="bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/no_identicons.png</normaloff>:/newPrefix/images/no_identicons.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>qidenticon</string>
</property>
<property name="icon">
<iconset resource="bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/qidenticon.png</normaloff>:/newPrefix/images/qidenticon.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>qidenticon_x</string>
</property>
<property name="icon">
<iconset resource="bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/qidenticon_x.png</normaloff>:/newPrefix/images/qidenticon_x.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>qidenticon_two</string>
</property>
<property name="icon">
<iconset resource="bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/qidenticon_two.png</normaloff>:/newPrefix/images/qidenticon_two.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>qidenticon_two_x</string>
</property>
<property name="icon">
<iconset resource="bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/qidenticon_two_x.png</normaloff>:/newPrefix/images/qidenticon_two_x.png</iconset>
</property>
</item>
</widget>
<widget class="QCheckBox" name="checkBoxLoadAvatars">
<property name="geometry">
@ -229,7 +184,7 @@
<string>Load avatar images</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<widget class="QLineEdit" name="lineEditIdenticonSuffix">
<property name="geometry">
<rect>
<x>140</x>