@@ -760,6 +760,11 @@ def __init__(self, parent=None):
760760
761761 self .unreadCount = 0
762762
763+ self .currentTrayIconFileName = ""
764+ self .actionQuiet = None
765+ self .actionShow = None
766+ self .tray = None
767+
763768 # Set the icon sizes for the identicons
764769 identicon_size = 3 * 7
765770 self .ui .tableWidgetInbox .setIconSize (QtCore .QSize (identicon_size , identicon_size ))
@@ -3978,12 +3983,12 @@ def on_context_menuInbox(self, point):
39783983 popMenuInbox .addAction (self .actionReply )
39793984 popMenuInbox .addAction (self .actionAddSenderToAddressBook )
39803985 # pylint: disable=no-member
3981- self . actionClipboardMessagelist = self .ui .inboxContextMenuToolbar .addAction (
3986+ actionClipboardMessagelist = self .ui .inboxContextMenuToolbar .addAction (
39823987 _translate ("MainWindow" , "Copy subject to clipboard" )
39833988 if tableWidget .currentColumn () == 2 else
39843989 _translate ("MainWindow" , "Copy address to clipboard" ),
39853990 self .on_action_ClipboardMessagelist )
3986- popMenuInbox .addAction (self . actionClipboardMessagelist )
3991+ popMenuInbox .addAction (actionClipboardMessagelist )
39873992 # pylint: disable=no-member
39883993 self ._contact_selected = tableWidget .item (currentRow , 1 )
39893994 # preloaded gui.menu plugins with prefix 'address'
@@ -4229,7 +4234,7 @@ class BitmessageQtApplication(QtGui.QApplication):
42294234 """
42304235
42314236 # Unique identifier for this application
4232- uuid = '6ec0149b-96e1-4be1-93ab-1465fb3ebf7c'
4237+ UUID = '6ec0149b-96e1-4be1-93ab-1465fb3ebf7c'
42334238
42344239 @staticmethod
42354240 def get_windowstyle ():
@@ -4241,7 +4246,6 @@ def get_windowstyle():
42414246
42424247 def __init__ (self , * argv ):
42434248 super (BitmessageQtApplication , self ).__init__ (* argv )
4244- id = BitmessageQtApplication .uuid
42454249
42464250 QtCore .QCoreApplication .setOrganizationName ("PyBitmessage" )
42474251 QtCore .QCoreApplication .setOrganizationDomain ("bitmessage.org" )
@@ -4259,14 +4263,14 @@ def __init__(self, *argv):
42594263 self .is_running = False
42604264
42614265 socket = QLocalSocket ()
4262- socket .connectToServer (id )
4266+ socket .connectToServer (self . UUID )
42634267 self .is_running = socket .waitForConnected ()
42644268
42654269 # Cleanup past crashed servers
42664270 if not self .is_running :
42674271 if socket .error () == QLocalSocket .ConnectionRefusedError :
42684272 socket .disconnectFromServer ()
4269- QLocalServer .removeServer (id )
4273+ QLocalServer .removeServer (self . UUID )
42704274
42714275 socket .abort ()
42724276
@@ -4278,7 +4282,7 @@ def __init__(self, *argv):
42784282 # Nope, create a local server with this id and assign on_new_connection
42794283 # for whenever a second instance tries to run focus the application.
42804284 self .server = QLocalServer ()
4281- self .server .listen (id )
4285+ self .server .listen (self . UUID )
42824286 self .server .newConnection .connect (self .on_new_connection )
42834287
42844288 self .setStyleSheet ("QStatusBar::item { border: 0px solid black }" )
@@ -4293,20 +4297,20 @@ def on_new_connection(self):
42934297
42944298
42954299def init ():
4296- global app
4300+ global app # pylint: disable=global-statement
42974301 if not app :
42984302 app = BitmessageQtApplication (sys .argv )
42994303 return app
43004304
43014305
43024306def run ():
4303- global myapp
4304- app = init ()
4305- myapp = MyForm ()
4307+ global myapp # pylint: disable=global-statement
4308+ _app = init ()
4309+ myapp = MyForm () # pylint: disable=redefined-outer-name
43064310
43074311 myapp .appIndicatorInit (app )
43084312
4309- if myapp ._firstrun :
4313+ if myapp ._firstrun : # pylint: disable=protected-access
43104314 myapp .showConnectDialog () # ask the user if we may connect
43114315
43124316 # only show after wizards and connect dialogs have completed
@@ -4315,4 +4319,4 @@ def run():
43154319 QtCore .QTimer .singleShot (
43164320 30000 , lambda : myapp .setStatusIcon (state .statusIconColor ))
43174321
4318- app .exec_ ()
4322+ _app .exec_ ()
0 commit comments