예제 #1
0
 def __init__(self):
     KSystemTray.__init__(self)
     self.hasActions = False
     self.checkAction = KAction()
     self.checkAction.setText("Check")
     self.startSmartAction = KAction()
     self.startSmartAction.setText("Start Smart...")
     self.stopAction = KAction()
     self.stopAction.setText("Stop")
     self.stopAction.setIcon("stop")
     self.stopAction.setEnabled(False)
 def __init__(self):
     KSystemTray.__init__(self)
     self.hasActions = False
     self.checkAction = KAction()
     self.checkAction.setText("Check")
     self.startSmartAction = KAction()
     self.startSmartAction.setText("Start Smart...")
     self.stopAction = KAction()
     self.stopAction.setText("Stop")
     self.stopAction.setIcon("stop")
     self.stopAction.setEnabled(False)
예제 #3
0
 def __init__(self, app, *args):
     KMainWindow.__init__(self, *args)
     self.app = app
     self.icons = KIconLoader()
     if self.app.pgpool is not None:
         self.systray = KSystemTray(self)
         self.systray.setPixmap(self.icons.loadIcon('connect_no', 1))
         self.systray.show()
     self.initActions()
     self.initMenus()
     self.initToolbar()
     self.db = app.db
     self.cfg = app.cfg
예제 #4
0
 def setupKDE(app, wnd):
     try:
         icons = KIconLoader()
         systray = KSystemTray(wnd)
         systray.setPixmap(icons.loadIcon("kedit", 1))
         QToolTip.add(systray, "PyQLogger - Blogger GUI")
         systray.show()
     except Exception, inst:
         sys.stderr.write("setupKDE: cannot set tray, exception: %s\n" %
                          inst)
예제 #5
0
 def _setupTray(app, wnd):
     try:
         icons = KIconLoader()
         systray = KSystemTray(wnd["Class"])
         p = QPixmap()
         p.loadFromData(icon)
         systray.setPixmap(p)
         QToolTip.add(systray, "PyQLogger - Blogger GUI")
         systray.show()
         wnd["Impl"].systray = systray
     except Exception, inst:
         sys.stderr.write(
             "setupKDE: cannot set tray, exception: %s\n" %
             inst)
예제 #6
0
class KonsultantMainWindow(KMainWindow):
    def __init__(self, app, *args):
        KMainWindow.__init__(self, *args)
        self.app = app
        self.icons = KIconLoader()
        if self.app.pgpool is not None:
            self.systray = KSystemTray(self)
            self.systray.setPixmap(self.icons.loadIcon('connect_no', 1))
            self.systray.show()
        self.initActions()
        self.initMenus()
        self.initToolbar()
        self.db = app.db
        self.cfg = app.cfg
        
    def initActions(self):
        collection = self.actionCollection()
        self.editaddressAction = EditAddresses(self.slotEditAddresses, collection)
        self.manageclientsAction = ManageClients(self.slotManageClients, collection)
        self.manageticketsAction = ManageTickets(self.slotManageTickets, collection)
        self.configureAction = ConfigureKonsultant(self.slotConfigure, collection)
        self.quitAction = KStdAction.quit(self.app.quit, collection)
        
    def initMenus(self):
        mainMenu = KPopupMenu(self)
        menus = [mainMenu]
        if self.app.pgpool is not None:
            trayMenu = self.systray.contextMenu()
            menus.append(trayMenu)
        self.menuBar().insertItem('&Main', mainMenu)
        self.menuBar().insertItem('&Help', self.helpMenu(''))
        for menu in menus:
            self.editaddressAction.plug(menu)
            self.manageclientsAction.plug(menu)
            self.manageticketsAction.plug(menu)
            self.configureAction.plug(menu)
            self.quitAction.plug(menu)
            
    def initToolbar(self):
        toolbar = self.toolBar()
        actions = [self.manageclientsAction, self.manageticketsAction,
                   self.editaddressAction, self.configureAction,
                   self.quitAction]
        for action in actions:
            action.plug(toolbar)
        
    def slotEditAddresses(self):
        AddressSelector(self, self.db, 'AddressBrowser', modal=False)

    def slotManageClients(self):
        win = ClientManagerWidget(self, self.app)
        win.show()

    def slotManageTickets(self):
        win = TicketManagerWidget(self, self.db)
        win.show()

    def slotConfigure(self):
        print 'Configure Konsultant'
        c = ConfigureDialog(self, self.cfg)
        c.show()
예제 #7
0
 def mousePressEvent(self, event):
     if self.rect().contains(event.pos()):
         if event.button() == Qt.LeftButton:
             self.emit(PYSIGNAL("activated()"), ())
         else:
             KSystemTray.mousePressEvent(self, event)
예제 #8
0
 def __init__(self, parent):
     KSystemTray.__init__(self, parent)
     self.mainwin = parent
     icons = KIconLoader()
     self.setPixmap(icons.loadIcon('edit', KIcon.Desktop, 22))
 def mousePressEvent(self, event):
     if self.rect().contains(event.pos()):
         if event.button() == Qt.LeftButton:
             self.emit(PYSIGNAL("activated()"), ())
         else:
             KSystemTray.mousePressEvent(self, event)