Ejemplo n.º 1
0
    def __init__(self, parent):
        self.comar = comar.Link()
        self.comar.localize()
        self.notifier = QSocketNotifier(self.comar.sock.fileno(), QSocketNotifier.Read)
        self.connect(self.notifier, SIGNAL('activated(int)'), self.slotComar)

        formMain.__init__(self, parent)

        self.listServices.setSorting(1)
        self.listServices.setColumnText(0, '')
        self.listServices.setColumnWidth(0, 22)
        self.listServices.setColumnWidthMode(0, QListView.Manual)

        self.buttonStart.setIconSet(getIconSet('player_play', 32))
        self.buttonStop.setIconSet(getIconSet('player_stop', 32))
        self.buttonRestart.setIconSet(getIconSet('reload', 32))

        self.radioAutoRun.setEnabled(False)
        self.radioNoAutoRun.setEnabled(False)
        self.buttonStart.setEnabled(False)
        self.buttonStop.setEnabled(False)
        self.buttonRestart.setEnabled(False)

        # Access Control
        self.wheel = False
        self.comar.can_access('System.Service.setState', id=SERVICE_ACCESS)

        # Populate list
        self.populateList()

        # Configuration file
        self.config = self.parent().config
        if self.config.readEntry("servers_only") == "off":
            self.checkServersOnly.setChecked(False)

        # Notify list
        self.comar.ask_notify('System.Service.changed', id=SERVICE_UPDATE)

        # Connections
        self.connect(self.checkServersOnly, SIGNAL('clicked()'), self.slotListServers)
        self.connect(self.listServices, SIGNAL('selectionChanged()'), self.slotSelectionChanged)
        self.connect(self.buttonStart, SIGNAL('clicked()'), self.slotStart)
        self.connect(self.buttonStop, SIGNAL('clicked()'), self.slotStop)
        self.connect(self.buttonRestart, SIGNAL('clicked()'), self.slotRestart)
        self.connect(self.radioAutoRun, SIGNAL('clicked()'), self.slotOn)
        self.connect(self.radioNoAutoRun, SIGNAL('clicked()'), self.slotOff)

        self.connect(self.listServices, SIGNAL('doubleClicked(QListViewItem*)'), self.slotDoubleClicked)
Ejemplo n.º 2
0
    def __init__(self, parent):
        formMain.__init__(self, parent)

        if not self.setupBusses():
            sys.exit(1)

        self.listenSignals()

        self.editSearch.setFocus()

        self.listServices.setSorting(1)
        self.listServices.setColumnText(0, '')
        self.listServices.setColumnWidth(0, 22)
        self.listServices.setColumnWidthMode(0, QListView.Manual)

        self.buttonClearSearch.setIconSet(getIconSet('locationbar_erase', 16))
        self.buttonStart.setIconSet(getIconSet('player_play', 32))
        self.buttonStop.setIconSet(getIconSet('player_stop', 32))
        self.buttonRestart.setIconSet(getIconSet('reload', 32))

        self.radioAutoRun.setEnabled(False)
        self.radioNoAutoRun.setEnabled(False)
        self.buttonStart.setEnabled(False)
        self.buttonStop.setEnabled(False)
        self.buttonRestart.setEnabled(False)

        # Populate list
        self.populateList()

        # Configuration file
        self.config = self.parent().config
        if self.config.readEntry("servers_only") == "off":
            self.checkServersOnly.setChecked(False)

        # Connections
        self.connect(self.checkServersOnly, SIGNAL('clicked()'), self.slotListServers)
        self.connect(self.listServices, SIGNAL('selectionChanged()'), self.slotSelectionChanged)
        self.connect(self.buttonClearSearch, SIGNAL('clicked()'), self.editSearch.clear)
        self.connect(self.buttonStart, SIGNAL('clicked()'), self.slotStart)
        self.connect(self.buttonStop, SIGNAL('clicked()'), self.slotStop)
        self.connect(self.buttonRestart, SIGNAL('clicked()'), self.slotRestart)
        self.connect(self.radioAutoRun, SIGNAL('clicked()'), self.slotOn)
        self.connect(self.radioNoAutoRun, SIGNAL('clicked()'), self.slotOff)
        self.connect(self.editSearch, SIGNAL('textChanged(const QString &)'), self.slotSearch)

        self.connect(self.listServices, SIGNAL('doubleClicked(QListViewItem*)'), self.slotDoubleClicked)
Ejemplo n.º 3
0
    def __init__(self, parent):
        self.comar = comar.Link()
        self.comar.localize()
        self.notifier = QSocketNotifier(self.comar.sock.fileno(), QSocketNotifier.Read)
        self.connect(self.notifier, SIGNAL('activated(int)'), self.slotComar)

        formMain.__init__(self, parent)

        self.listServices.setSorting(1)
        self.listServices.setColumnText(0, '')
        self.listServices.setColumnWidth(0, 22)
        self.listServices.setColumnWidthMode(0, QListView.Manual)

        self.buttonStart.setIconSet(getIconSet('player_play', 32))
        self.buttonStop.setIconSet(getIconSet('player_stop', 32))

        self.radioAutoRun.setEnabled(False)
        self.radioNoAutoRun.setEnabled(False)
        self.buttonStart.setEnabled(False)
        self.buttonStop.setEnabled(False)

        # Access Control
        self.wheel = False
        self.comar.can_access('System.Service.setState', id=10)

        # Populate list
        self.populateList()

        # Notify list
        self.comar.ask_notify('System.Service.changed', id=1)

        # Connections
        self.connect(self.checkServersOnly, SIGNAL('clicked()'), self.slotListServers)
        self.connect(self.listServices, SIGNAL('selectionChanged()'), self.slotSelectionChanged)
        self.connect(self.buttonStart, SIGNAL('clicked()'), self.slotStart)
        self.connect(self.buttonStop, SIGNAL('clicked()'), self.slotStop)
        self.connect(self.radioAutoRun, SIGNAL('clicked()'), self.slotOn)
        self.connect(self.radioNoAutoRun, SIGNAL('clicked()'), self.slotOff)