#NEWLINE# def addMenu( self ) : #NEWLINE# #INDENT# undo = self . current ( ) . pageAction ( QtWebKit . QWebPage . Undo ) #NEWLINE# redo = self . current ( ) . pageAction ( QtWebKit . QWebPage . Redo ) #NEWLINE# cut = self . current ( ) . pageAction ( QtWebKit . QWebPage . Cut ) #NEWLINE# copy = self . current ( ) . pageAction ( QtWebKit . QWebPage . Copy ) #NEWLINE# paste = self . current ( ) . pageAction ( QtWebKit . QWebPage . Paste ) #NEWLINE# back = self . current ( ) . pageAction ( QtWebKit . QWebPage . Back ) #NEWLINE# forward = self . current ( ) . pageAction ( QtWebKit . QWebPage . Forward ) #NEWLINE# reload = self . current ( ) . pageAction ( QtWebKit . QWebPage . Reload ) #NEWLINE# self . menus = { #NEWLINE# #INDENT# 'file' : { #NEWLINE# #INDENT# 'preferences' : self . createAction ( 'Preferences' , ( lambda : self . current ( ) . preferences ( ) ) ) , #NEWLINE# 'systray' : self . createAction ( 'Close to Tray' , self . systray , None , True ) , #NEWLINE# 'addTeam' : self . createAction ( 'Sign in to Another Team' , ( lambda : self . switchTo ( Resources . SIGNIN_URL ) ) ) , #NEWLINE# 'signout' : self . createAction ( 'Signout' , ( lambda : self . current ( ) . logout ( ) ) ) , #NEWLINE# 'close' : self . createAction ( 'Close' , self . close , QKeySequence . Close ) , #NEWLINE# 'exit' : self . createAction ( 'Quit' , self . exit , QKeySequence . Quit ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'edit' : { #NEWLINE# #INDENT# 'undo' : self . createAction ( undo . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Undo ) ) , undo . shortcut ( ) ) , #NEWLINE# 'redo' : self . createAction ( redo . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Redo ) ) , redo . shortcut ( ) ) , #NEWLINE# 'cut' : self . createAction ( cut . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Cut ) ) , cut . shortcut ( ) ) , #NEWLINE# 'copy' : self . createAction ( copy . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Copy ) ) , copy . shortcut ( ) ) , #NEWLINE# 'paste' : self . createAction ( paste . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Paste ) ) , paste . shortcut ( ) ) , #NEWLINE# 'back' : self . createAction ( back . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Back ) ) , back . shortcut ( ) ) , #NEWLINE# 'forward' : self . createAction ( forward . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Forward ) ) , forward . shortcut ( ) ) , #NEWLINE# 'reload' : self . createAction ( reload . text ( ) , ( lambda : self . current ( ) . page ( ) . triggerAction ( QtWebKit . QWebPage . Reload ) ) , reload . shortcut ( ) ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'view' : { #NEWLINE# #INDENT# 'zoomin' : self . createAction ( 'Zoom In' , self . zoomIn , QKeySequence . ZoomIn ) , #NEWLINE# 'zoomout' : self . createAction ( 'Zoom Out' , self . zoomOut , QKeySequence . ZoomOut ) , #NEWLINE# 'reset' : self . createAction ( 'Reset' , self . zoomReset , ( QtCore . Qt . CTRL + QtCore . Qt . Key_0 ) ) , #NEWLINE# 'fullscreen' : self . createAction ( 'Toggle Full Screen' , self . toggleFullScreen , QtCore . Qt . Key_F11 ) , #NEWLINE# 'hidemenu' : self . createAction ( 'Toggle Menubar' , self . toggleMenuBar , QtCore . Qt . Key_F12 ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'help' : { #NEWLINE# #INDENT# 'help' : self . createAction ( 'Help and Feedback' , ( lambda : self . current ( ) . help ( ) ) , QKeySequence . HelpContents ) , #NEWLINE# 'center' : self . createAction ( 'Slack Help Center' , ( lambda : self . current ( ) . helpCenter ( ) ) ) , #NEWLINE# 'about' : self . createAction ( 'About' , ( lambda : self . current ( ) . about ( ) ) ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# menu = self . menuBar ( ) #NEWLINE# fileMenu = menu . addMenu ( '&File' ) #NEWLINE# fileMenu . addAction ( self . menus [ 'file' ] [ 'preferences' ] ) #NEWLINE# fileMenu . addAction ( self . menus [ 'file' ] [ 'systray' ] ) #NEWLINE# fileMenu . addSeparator ( ) #NEWLINE# fileMenu . addAction ( self . menus [ 'file' ] [ 'addTeam' ] ) #NEWLINE# fileMenu . addAction ( self . menus [ 'file' ] [ 'signout' ] ) #NEWLINE# fileMenu . addSeparator ( ) #NEWLINE# fileMenu . addAction ( self . menus [ 'file' ] [ 'close' ] ) #NEWLINE# fileMenu . addAction ( self . menus [ 'file' ] [ 'exit' ] ) #NEWLINE# editMenu = menu . addMenu ( '&Edit' ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'undo' ] ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'redo' ] ) #NEWLINE# editMenu . addSeparator ( ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'cut' ] ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'copy' ] ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'paste' ] ) #NEWLINE# editMenu . addSeparator ( ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'back' ] ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'forward' ] ) #NEWLINE# editMenu . addAction ( self . menus [ 'edit' ] [ 'reload' ] ) #NEWLINE# viewMenu = menu . addMenu ( '&View' ) #NEWLINE# viewMenu . addAction ( self . menus [ 'view' ] [ 'zoomin' ] ) #NEWLINE# viewMenu . addAction ( self . menus [ 'view' ] [ 'zoomout' ] ) #NEWLINE# viewMenu . addAction ( self . menus [ 'view' ] [ 'reset' ] ) #NEWLINE# viewMenu . addSeparator ( ) #NEWLINE# viewMenu . addAction ( self . menus [ 'view' ] [ 'fullscreen' ] ) #NEWLINE# viewMenu . addAction ( self . menus [ 'view' ] [ 'hidemenu' ] ) #NEWLINE# helpMenu = menu . addMenu ( '&Help' ) #NEWLINE# helpMenu . addAction ( self . menus [ 'help' ] [ 'help' ] ) #NEWLINE# helpMenu . addAction ( self . menus [ 'help' ] [ 'center' ] ) #NEWLINE# helpMenu . addSeparator ( ) #NEWLINE# helpMenu . addAction ( self . menus [ 'help' ] [ 'about' ] ) #NEWLINE# self . enableMenus ( False ) #NEWLINE# showSystray = ( self . settings . value ( 'Systray' ) == 'True' ) #NEWLINE# self . menus [ 'file' ] [ 'systray' ] . setChecked ( showSystray ) #NEWLINE# self . menus [ 'file' ] [ 'close' ] . setEnabled ( showSystray ) #NEWLINE# visible = self . settings . value ( 'Menu' ) #NEWLINE# if ( ( visible is not None ) and ( visible == 'False' ) ) : #NEWLINE# #INDENT# menu . setVisible ( False )