def generate_toolbar(self):
"""
Description: There will be a toolbar in the main widget with some buttons,
this method will render them.
Arguments: None
Returns: Nothing
"""
global IMGDIR, conf
self.toolBar = QToolBar(self)
refreshAction = QAction(QIcon(IMGDIR + 'refresh.png'), _('refresh'), self)
refreshAction.setShortcut('Ctrl+R')
refreshAction.triggered.connect(self.refresh_grid)
self.toolBar.addAction(refreshAction)
self.forgetCredsAction = QAction(QIcon(IMGDIR + 'forget.png'), _('forget_credentials'), self)
self.forgetCredsAction.setShortcut('Ctrl+F')
self.forgetCredsAction.triggered.connect(self.forget_creds)
if not isfile(conf.USERCREDSFILE):
self.forgetCredsAction.setDisabled(True)
self.toolBar.addAction(self.forgetCredsAction)
aboutAction = QAction(QIcon(IMGDIR + 'about.png'), _('about'), self)
aboutAction.setShortcut('Ctrl+I')
aboutAction.triggered.connect(self.about)
self.toolBar.addAction(aboutAction)
exitAction = QAction(QIcon(IMGDIR + 'exit.png'), _('exit'), self)
exitAction.setShortcut('Ctrl+Q')
exitAction.triggered.connect(self.quit_button)
self.toolBar.addAction(exitAction)
self.grid.addWidget(self.toolBar, 0, 3, Qt.AlignRight)
评论列表
文章目录