MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / __init__

Method __init__

src/bitmessageqt/__init__.py:4096–4264  ·  view source on GitHub ↗
(self, parent)

Source from the content-addressed store, hash-verified

4094class settingsDialog(QtGui.QDialog):
4095
4096 def __init__(self, parent):
4097 QtGui.QWidget.__init__(self, parent)
4098 self.ui = Ui_settingsDialog()
4099 self.ui.setupUi(self)
4100 self.parent = parent
4101 self.ui.checkBoxStartOnLogon.setChecked(
4102 BMConfigParser().getboolean('bitmessagesettings', 'startonlogon'))
4103 self.ui.checkBoxMinimizeToTray.setChecked(
4104 BMConfigParser().getboolean('bitmessagesettings', 'minimizetotray'))
4105 self.ui.checkBoxTrayOnClose.setChecked(
4106 BMConfigParser().safeGetBoolean('bitmessagesettings', 'trayonclose'))
4107 self.ui.checkBoxHideTrayConnectionNotifications.setChecked(
4108 BMConfigParser().getboolean("bitmessagesettings", "hidetrayconnectionnotifications"))
4109 self.ui.checkBoxShowTrayNotifications.setChecked(
4110 BMConfigParser().getboolean('bitmessagesettings', 'showtraynotifications'))
4111 self.ui.checkBoxStartInTray.setChecked(
4112 BMConfigParser().getboolean('bitmessagesettings', 'startintray'))
4113 self.ui.checkBoxWillinglySendToMobile.setChecked(
4114 BMConfigParser().safeGetBoolean('bitmessagesettings', 'willinglysendtomobile'))
4115 self.ui.checkBoxUseIdenticons.setChecked(
4116 BMConfigParser().safeGetBoolean('bitmessagesettings', 'useidenticons'))
4117 self.ui.checkBoxReplyBelow.setChecked(
4118 BMConfigParser().safeGetBoolean('bitmessagesettings', 'replybelow'))
4119
4120 if state.appdata == paths.lookupExeFolder():
4121 self.ui.checkBoxPortableMode.setChecked(True)
4122 else:
4123 try:
4124 import tempfile
4125 tempfile.NamedTemporaryFile(
4126 dir=paths.lookupExeFolder(), delete=True
4127 ).close() # should autodelete
4128 except:
4129 self.ui.checkBoxPortableMode.setDisabled(True)
4130
4131 if 'darwin' in sys.platform:
4132 self.ui.checkBoxStartOnLogon.setDisabled(True)
4133 self.ui.checkBoxStartOnLogon.setText(_translate(
4134 "MainWindow", "Start-on-login not yet supported on your OS."))
4135 self.ui.checkBoxMinimizeToTray.setDisabled(True)
4136 self.ui.checkBoxMinimizeToTray.setText(_translate(
4137 "MainWindow", "Minimize-to-tray not yet supported on your OS."))
4138 self.ui.checkBoxShowTrayNotifications.setDisabled(True)
4139 self.ui.checkBoxShowTrayNotifications.setText(_translate(
4140 "MainWindow", "Tray notifications not yet supported on your OS."))
4141 elif 'linux' in sys.platform:
4142 self.ui.checkBoxStartOnLogon.setDisabled(True)
4143 self.ui.checkBoxStartOnLogon.setText(_translate(
4144 "MainWindow", "Start-on-login not yet supported on your OS."))
4145 # On the Network settings tab:
4146 self.ui.lineEditTCPPort.setText(str(
4147 BMConfigParser().get('bitmessagesettings', 'port')))
4148 self.ui.checkBoxUPnP.setChecked(
4149 BMConfigParser().safeGetBoolean('bitmessagesettings', 'upnp'))
4150 self.ui.checkBoxAuthentication.setChecked(BMConfigParser().getboolean(
4151 'bitmessagesettings', 'socksauthentication'))
4152 self.ui.checkBoxSocksListen.setChecked(BMConfigParser().getboolean(
4153 'bitmessagesettings', 'sockslisten'))

Callers

nothing calls this directly

Calls 12

Ui_settingsDialogClass · 0.90
BMConfigParserClass · 0.90
_translateFunction · 0.90
safeGetBooleanMethod · 0.80
setEnabledMethod · 0.80
clearMethod · 0.80
safeGetMethod · 0.80
__init__Method · 0.45
setupUiMethod · 0.45
closeMethod · 0.45
getMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected