def update(self): al, c = alerte() if len(al) != 0: self.toolbar2.addAction(QtGui.QIcon('images/war.png'), c, self.goto_alerte) self.addToolBar(QtCore.Qt.LeftToolBarArea, self.toolbar2) self.alerte, c = alerte()
def __init__(self): QtGui.QMainWindow.__init__(self) self.resize(1200, 650) self.setWindowTitle(u"Management chicken coop") self.setWindowIcon(QtGui.QIcon('images/eggs.ico')) self.toolbar2 = QtGui.QToolBar() self.toolbar2.setStyleSheet("color: rgb(255, 45, 8);") # self.toolbar2.setTabPosition(QtGui.QTabWidget.West) self.alerte, c = alerte() self.update() self.toolbar = QtGui.QToolBar() self.toolbar.setEnabled(True) self.toolbar.addAction(QtGui.QIcon('images/quiter.png'), \ _(u"Exit"), self.goto_exit) self.toolbar.addSeparator() self.toolbar.addAction(_(u"Dashboard"), self.accueil) self.toolbar.addSeparator() self.toolbar.addAction(_(u"Management reports"), \ self.goto_gestion_rapport) self.toolbar.addSeparator() self.toolbar.addAction(_(u"Monitoring chiks"), \ self.goto__suivi_chiks) self.addToolBar(self.toolbar) self.menubar = MenuBar(self) self.setMenuBar(self.menubar) self.statusbar = GStatusBar(self) self.setStatusBar(self.statusbar) self.change_context(DashbordViewWidget) self.startTimer(10000)
def set_data_for(self, *args): alert, c = alerte() self.data = [("", al.objets, al.date_a, al.id) for al in alert]
def timerEvent(self, event): al, c = alerte() if len(self.alerte) != len(al): self.update()