22PyQt based UI for bitmessage, the main module
33"""
44# pylint: disable=import-error,too-many-lines,no-member
5+ # pylint: disable=too-many-branches
56import hashlib
67import locale
78import os
@@ -760,6 +761,11 @@ def __init__(self, parent=None):
760761
761762 self .unreadCount = 0
762763
764+ self .currentTrayIconFileName = ""
765+ self .actionQuiet = None
766+ self .actionShow = None
767+ self .tray = None
768+
763769 # Set the icon sizes for the identicons
764770 identicon_size = 3 * 7
765771 self .ui .tableWidgetInbox .setIconSize (QtCore .QSize (identicon_size , identicon_size ))
@@ -3978,12 +3984,12 @@ def on_context_menuInbox(self, point):
39783984 popMenuInbox .addAction (self .actionReply )
39793985 popMenuInbox .addAction (self .actionAddSenderToAddressBook )
39803986 # pylint: disable=no-member
3981- self . actionClipboardMessagelist = self .ui .inboxContextMenuToolbar .addAction (
3987+ actionClipboardMessagelist = self .ui .inboxContextMenuToolbar .addAction (
39823988 _translate ("MainWindow" , "Copy subject to clipboard" )
39833989 if tableWidget .currentColumn () == 2 else
39843990 _translate ("MainWindow" , "Copy address to clipboard" ),
39853991 self .on_action_ClipboardMessagelist )
3986- popMenuInbox .addAction (self . actionClipboardMessagelist )
3992+ popMenuInbox .addAction (actionClipboardMessagelist )
39873993 # pylint: disable=no-member
39883994 self ._contact_selected = tableWidget .item (currentRow , 1 )
39893995 # preloaded gui.menu plugins with prefix 'address'
@@ -4229,7 +4235,7 @@ class BitmessageQtApplication(QtGui.QApplication):
42294235 """
42304236
42314237 # Unique identifier for this application
4232- uuid = '6ec0149b-96e1-4be1-93ab-1465fb3ebf7c'
4238+ UUID = '6ec0149b-96e1-4be1-93ab-1465fb3ebf7c'
42334239
42344240 @staticmethod
42354241 def get_windowstyle ():
@@ -4241,7 +4247,6 @@ def get_windowstyle():
42414247
42424248 def __init__ (self , * argv ):
42434249 super (BitmessageQtApplication , self ).__init__ (* argv )
4244- id = BitmessageQtApplication .uuid
42454250
42464251 QtCore .QCoreApplication .setOrganizationName ("PyBitmessage" )
42474252 QtCore .QCoreApplication .setOrganizationDomain ("bitmessage.org" )
@@ -4259,14 +4264,14 @@ def __init__(self, *argv):
42594264 self .is_running = False
42604265
42614266 socket = QLocalSocket ()
4262- socket .connectToServer (id )
4267+ socket .connectToServer (self . UUID )
42634268 self .is_running = socket .waitForConnected ()
42644269
42654270 # Cleanup past crashed servers
42664271 if not self .is_running :
42674272 if socket .error () == QLocalSocket .ConnectionRefusedError :
42684273 socket .disconnectFromServer ()
4269- QLocalServer .removeServer (id )
4274+ QLocalServer .removeServer (self . UUID )
42704275
42714276 socket .abort ()
42724277
@@ -4278,7 +4283,7 @@ def __init__(self, *argv):
42784283 # Nope, create a local server with this id and assign on_new_connection
42794284 # for whenever a second instance tries to run focus the application.
42804285 self .server = QLocalServer ()
4281- self .server .listen (id )
4286+ self .server .listen (self . UUID )
42824287 self .server .newConnection .connect (self .on_new_connection )
42834288
42844289 self .setStyleSheet ("QStatusBar::item { border: 0px solid black }" )
@@ -4293,20 +4298,20 @@ def on_new_connection(self):
42934298
42944299
42954300def init ():
4296- global app
4301+ global app # pylint: disable=global-statement
42974302 if not app :
42984303 app = BitmessageQtApplication (sys .argv )
42994304 return app
43004305
43014306
43024307def run ():
4303- global myapp
4304- app = init ()
4305- myapp = MyForm ()
4308+ global myapp # pylint: disable=global-statement
4309+ _app = init ()
4310+ myapp = MyForm () # pylint: disable=redefined-outer-name
43064311
43074312 myapp .appIndicatorInit (app )
43084313
4309- if myapp ._firstrun :
4314+ if myapp ._firstrun : # pylint: disable=protected-access
43104315 myapp .showConnectDialog () # ask the user if we may connect
43114316
43124317 # only show after wizards and connect dialogs have completed
@@ -4315,4 +4320,4 @@ def run():
43154320 QtCore .QTimer .singleShot (
43164321 30000 , lambda : myapp .setStatusIcon (state .statusIconColor ))
43174322
4318- app .exec_ ()
4323+ _app .exec_ ()
0 commit comments