@@ -80,7 +80,7 @@ def __init__(self, parent=None, firstrun=False):
80
80
)
81
81
QtGui .QWidget .resize (self , QtGui .QWidget .sizeHint (self ))
82
82
83
- def adjust_from_config (self , config ):
83
+ def adjust_from_config (self , config_ ):
84
84
"""Adjust all widgets state according to config settings"""
85
85
# pylint: disable=too-many-branches,too-many-statements
86
86
if not self .parent .tray .isSystemTrayAvailable ():
@@ -89,31 +89,31 @@ def adjust_from_config(self, config):
89
89
"MainWindow" , "Tray (not available in your system)" ))
90
90
for setting in (
91
91
'minimizetotray' , 'trayonclose' , 'startintray' ):
92
- config .set ('bitmessagesettings' , setting , 'false' )
92
+ config_ .set ('bitmessagesettings' , setting , 'false' )
93
93
else :
94
94
self .checkBoxMinimizeToTray .setChecked (
95
- config .getboolean ('bitmessagesettings' , 'minimizetotray' ))
95
+ config_ .getboolean ('bitmessagesettings' , 'minimizetotray' ))
96
96
self .checkBoxTrayOnClose .setChecked (
97
- config .safeGetBoolean ('bitmessagesettings' , 'trayonclose' ))
97
+ config_ .safeGetBoolean ('bitmessagesettings' , 'trayonclose' ))
98
98
self .checkBoxStartInTray .setChecked (
99
- config .getboolean ('bitmessagesettings' , 'startintray' ))
99
+ config_ .getboolean ('bitmessagesettings' , 'startintray' ))
100
100
101
101
self .checkBoxHideTrayConnectionNotifications .setChecked (
102
- config .getboolean (
102
+ config_ .getboolean (
103
103
'bitmessagesettings' , 'hidetrayconnectionnotifications' ))
104
104
self .checkBoxShowTrayNotifications .setChecked (
105
- config .getboolean ('bitmessagesettings' , 'showtraynotifications' ))
105
+ config_ .getboolean ('bitmessagesettings' , 'showtraynotifications' ))
106
106
107
107
self .checkBoxStartOnLogon .setChecked (
108
- config .getboolean ('bitmessagesettings' , 'startonlogon' ))
108
+ config_ .getboolean ('bitmessagesettings' , 'startonlogon' ))
109
109
110
110
self .checkBoxWillinglySendToMobile .setChecked (
111
- config .safeGetBoolean (
111
+ config_ .safeGetBoolean (
112
112
'bitmessagesettings' , 'willinglysendtomobile' ))
113
113
self .checkBoxUseIdenticons .setChecked (
114
- config .safeGetBoolean ('bitmessagesettings' , 'useidenticons' ))
114
+ config_ .safeGetBoolean ('bitmessagesettings' , 'useidenticons' ))
115
115
self .checkBoxReplyBelow .setChecked (
116
- config .safeGetBoolean ('bitmessagesettings' , 'replybelow' ))
116
+ config_ .safeGetBoolean ('bitmessagesettings' , 'replybelow' ))
117
117
118
118
if state .appdata == paths .lookupExeFolder ():
119
119
self .checkBoxPortableMode .setChecked (True )
@@ -142,17 +142,17 @@ def adjust_from_config(self, config):
142
142
143
143
# On the Network settings tab:
144
144
self .lineEditTCPPort .setText (str (
145
- config .get ('bitmessagesettings' , 'port' )))
145
+ config_ .get ('bitmessagesettings' , 'port' )))
146
146
self .checkBoxUPnP .setChecked (
147
- config .safeGetBoolean ('bitmessagesettings' , 'upnp' ))
147
+ config_ .safeGetBoolean ('bitmessagesettings' , 'upnp' ))
148
148
self .checkBoxUDP .setChecked (
149
- config .safeGetBoolean ('bitmessagesettings' , 'udp' ))
149
+ config_ .safeGetBoolean ('bitmessagesettings' , 'udp' ))
150
150
self .checkBoxAuthentication .setChecked (
151
- config .getboolean ('bitmessagesettings' , 'socksauthentication' ))
151
+ config_ .getboolean ('bitmessagesettings' , 'socksauthentication' ))
152
152
self .checkBoxSocksListen .setChecked (
153
- config .getboolean ('bitmessagesettings' , 'sockslisten' ))
153
+ config_ .getboolean ('bitmessagesettings' , 'sockslisten' ))
154
154
self .checkBoxOnionOnly .setChecked (
155
- config .safeGetBoolean ('bitmessagesettings' , 'onionservicesonly' ))
155
+ config_ .safeGetBoolean ('bitmessagesettings' , 'onionservicesonly' ))
156
156
157
157
self ._proxy_type = getSOCKSProxyType (config )
158
158
self .comboBoxProxyType .setCurrentIndex (
@@ -161,38 +161,38 @@ def adjust_from_config(self, config):
161
161
self .comboBoxProxyTypeChanged (self .comboBoxProxyType .currentIndex ())
162
162
163
163
self .lineEditSocksHostname .setText (
164
- config .get ('bitmessagesettings' , 'sockshostname' ))
164
+ config_ .get ('bitmessagesettings' , 'sockshostname' ))
165
165
self .lineEditSocksPort .setText (str (
166
- config .get ('bitmessagesettings' , 'socksport' )))
166
+ config_ .get ('bitmessagesettings' , 'socksport' )))
167
167
self .lineEditSocksUsername .setText (
168
- config .get ('bitmessagesettings' , 'socksusername' ))
168
+ config_ .get ('bitmessagesettings' , 'socksusername' ))
169
169
self .lineEditSocksPassword .setText (
170
- config .get ('bitmessagesettings' , 'sockspassword' ))
170
+ config_ .get ('bitmessagesettings' , 'sockspassword' ))
171
171
172
172
self .lineEditMaxDownloadRate .setText (str (
173
- config .get ('bitmessagesettings' , 'maxdownloadrate' )))
173
+ config_ .get ('bitmessagesettings' , 'maxdownloadrate' )))
174
174
self .lineEditMaxUploadRate .setText (str (
175
- config .get ('bitmessagesettings' , 'maxuploadrate' )))
175
+ config_ .get ('bitmessagesettings' , 'maxuploadrate' )))
176
176
self .lineEditMaxOutboundConnections .setText (str (
177
- config .get ('bitmessagesettings' , 'maxoutboundconnections' )))
177
+ config_ .get ('bitmessagesettings' , 'maxoutboundconnections' )))
178
178
179
179
# Demanded difficulty tab
180
180
self .lineEditTotalDifficulty .setText (str ((float (
181
- config .getint (
181
+ config_ .getint (
182
182
'bitmessagesettings' , 'defaultnoncetrialsperbyte' )
183
183
) / defaults .networkDefaultProofOfWorkNonceTrialsPerByte )))
184
184
self .lineEditSmallMessageDifficulty .setText (str ((float (
185
- config .getint (
185
+ config_ .getint (
186
186
'bitmessagesettings' , 'defaultpayloadlengthextrabytes' )
187
187
) / defaults .networkDefaultPayloadLengthExtraBytes )))
188
188
189
189
# Max acceptable difficulty tab
190
190
self .lineEditMaxAcceptableTotalDifficulty .setText (str ((float (
191
- config .getint (
191
+ config_ .getint (
192
192
'bitmessagesettings' , 'maxacceptablenoncetrialsperbyte' )
193
193
) / defaults .networkDefaultProofOfWorkNonceTrialsPerByte )))
194
194
self .lineEditMaxAcceptableSmallMessageDifficulty .setText (str ((float (
195
- config .getint (
195
+ config_ .getint (
196
196
'bitmessagesettings' , 'maxacceptablepayloadlengthextrabytes' )
197
197
) / defaults .networkDefaultPayloadLengthExtraBytes )))
198
198
@@ -203,21 +203,21 @@ def adjust_from_config(self, config):
203
203
self .comboBoxOpenCL .addItems (openclpow .vendors )
204
204
self .comboBoxOpenCL .setCurrentIndex (0 )
205
205
for i in range (self .comboBoxOpenCL .count ()):
206
- if self .comboBoxOpenCL .itemText (i ) == config .safeGet (
206
+ if self .comboBoxOpenCL .itemText (i ) == config_ .safeGet (
207
207
'bitmessagesettings' , 'opencl' ):
208
208
self .comboBoxOpenCL .setCurrentIndex (i )
209
209
break
210
210
211
211
# Namecoin integration tab
212
- nmctype = config .get ('bitmessagesettings' , 'namecoinrpctype' )
212
+ nmctype = config_ .get ('bitmessagesettings' , 'namecoinrpctype' )
213
213
self .lineEditNamecoinHost .setText (
214
- config .get ('bitmessagesettings' , 'namecoinrpchost' ))
214
+ config_ .get ('bitmessagesettings' , 'namecoinrpchost' ))
215
215
self .lineEditNamecoinPort .setText (str (
216
- config .get ('bitmessagesettings' , 'namecoinrpcport' )))
216
+ config_ .get ('bitmessagesettings' , 'namecoinrpcport' )))
217
217
self .lineEditNamecoinUser .setText (
218
- config .get ('bitmessagesettings' , 'namecoinrpcuser' ))
218
+ config_ .get ('bitmessagesettings' , 'namecoinrpcuser' ))
219
219
self .lineEditNamecoinPassword .setText (
220
- config .get ('bitmessagesettings' , 'namecoinrpcpassword' ))
220
+ config_ .get ('bitmessagesettings' , 'namecoinrpcpassword' ))
221
221
222
222
if nmctype == "namecoind" :
223
223
self .radioButtonNamecoinNamecoind .setChecked (True )
@@ -232,9 +232,9 @@ def adjust_from_config(self, config):
232
232
233
233
# Message Resend tab
234
234
self .lineEditDays .setText (str (
235
- config .get ('bitmessagesettings' , 'stopresendingafterxdays' )))
235
+ config_ .get ('bitmessagesettings' , 'stopresendingafterxdays' )))
236
236
self .lineEditMonths .setText (str (
237
- config .get ('bitmessagesettings' , 'stopresendingafterxmonths' )))
237
+ config_ .get ('bitmessagesettings' , 'stopresendingafterxmonths' )))
238
238
239
239
def comboBoxProxyTypeChanged (self , comboBoxIndex ):
240
240
"""A callback for currentIndexChanged event of comboBoxProxyType"""
0 commit comments