示例#1
0
class Widget(QtGui.QWidget, Screen):
    title = ki18n("Packages")
    desc = ki18n("Install / Remove Programs")

    # min update time
    updateTime = 12

    def __init__(self, *args):
        QtGui.QWidget.__init__(self, None)
        self.ui = Ui_packageWidget()
        self.ui.setupUi(self)

        # set updateTime
        self.ui.updateInterval.setValue(self.updateTime)

        # set initial states
        self.ui.checkUpdate.setChecked(True)
        self.ui.showTray.setChecked(True)

        # set signals
        self.ui.showTray.connect(self.ui.showTray, SIGNAL("toggled(bool)"),
                                 self.enableCheckTime)
        self.ui.checkUpdate.connect(self.ui.checkUpdate,
                                    SIGNAL("toggled(bool)"),
                                    self.updateSelected)

    def enableCheckTime(self):
        if self.ui.showTray.isChecked():
            self.ui.checkUpdate.setVisible(True)
            self.ui.updateInterval.setVisible(True)
        else:
            self.ui.checkUpdate.setChecked(False)
            self.ui.checkUpdate.setVisible(False)
            self.ui.checkUpdate.setCheckState(Qt.Unchecked)
            self.ui.updateInterval.setVisible(False)

    def updateSelected(self):
        if self.ui.checkUpdate.isChecked():
            self.ui.updateInterval.setEnabled(True)
        else:
            self.ui.updateInterval.setEnabled(False)

    def applySettings(self):
        # write selected configurations to future package-managerrc
        config = PMConfig()
        config.setSystemTray(QVariant(self.ui.showTray.isChecked()))
        config.setUpdateCheck(QVariant(self.ui.checkUpdate.isChecked()))
        config.setUpdateCheckInterval(
            QVariant(self.ui.updateInterval.value() * 60))

        if self.ui.showTray.isChecked():
            p = subprocess.Popen(["package-manager"], stdout=subprocess.PIPE)

    def shown(self):
        pass

    def execute(self):
        self.applySettings()
        return True
示例#2
0
class Widget(QtGui.QWidget, Screen):
    title = ki18n("Packages")
    desc = ki18n("Install / Remove Programs")

    # min update time
    updateTime = 12

    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_packageWidget()
        self.ui.setupUi(self)

        # set updateTime
        self.ui.updateInterval.setValue(self.updateTime)

        # set initial states
        self.ui.checkUpdate.setChecked(True)
        self.ui.showTray.setChecked(True)

        # set signals
        self.ui.showTray.connect(self.ui.showTray, SIGNAL("toggled(bool)"), self.enableCheckTime)
        self.ui.checkUpdate.connect(self.ui.checkUpdate, SIGNAL("toggled(bool)"), self.updateSelected)

    def enableCheckTime(self):
        if self.ui.showTray.isChecked():
            self.ui.checkUpdate.setVisible(True)
            self.ui.updateInterval.setVisible(True)
        else:
            self.ui.checkUpdate.setChecked(False)
            self.ui.checkUpdate.setVisible(False)
            self.ui.checkUpdate.setCheckState(Qt.Unchecked)
            self.ui.updateInterval.setVisible(False)

    def updateSelected(self):
        if self.ui.checkUpdate.isChecked():
            self.ui.updateInterval.setEnabled(True)
        else:
            self.ui.updateInterval.setEnabled(False)

    def applySettings(self):
        # write selected configurations to future package-managerrc
        config = PMConfig()
        config.setSystemTray(QVariant(self.ui.showTray.isChecked()))
        config.setUpdateCheck(QVariant(self.ui.checkUpdate.isChecked()))
        config.setUpdateCheckInterval(QVariant(self.ui.updateInterval.value() * 60))

        if self.ui.showTray.isChecked():
            p = subprocess.Popen(["package-manager"], stdout=subprocess.PIPE)

    def shown(self):
        pass

    def execute(self):
        self.applySettings()
        return True
示例#3
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self, None)
        self.ui = Ui_packageWidget()
        self.ui.setupUi(self)

        # set initial checkbox visibility
        self.ui.checkUpdate.setVisible(False)
        self.ui.updateInterval.setVisible(False)

        # set signals
        self.ui.showTray.connect(self.ui.showTray, SIGNAL("toggled(bool)"),
                                 self.enableCheckTime)
        self.ui.checkUpdate.connect(self.ui.checkUpdate,
                                    SIGNAL("toggled(bool)"),
                                    self.updateSelected)
示例#4
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self, None)
        self.ui = Ui_packageWidget()
        self.ui.setupUi(self)

        # set updateTime
        self.ui.updateInterval.setValue(self.updateTime)

        # set initial states
        self.ui.checkUpdate.setChecked(True)
        self.ui.showTray.setChecked(True)

        # set signals
        self.ui.showTray.connect(self.ui.showTray, SIGNAL("toggled(bool)"),
                                 self.enableCheckTime)
        self.ui.checkUpdate.connect(self.ui.checkUpdate,
                                    SIGNAL("toggled(bool)"),
                                    self.updateSelected)
示例#5
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_packageWidget()
        self.ui.setupUi(self)

        # set initial checkbox visibility
        self.ui.checkUpdate.setVisible(False)
        self.ui.updateInterval.setVisible(False)

        # set signals
        self.ui.showTray.connect(self.ui.showTray, SIGNAL("toggled(bool)"), self.enableCheckTime)
        self.ui.checkUpdate.connect(self.ui.checkUpdate, SIGNAL("toggled(bool)"), self.updateSelected)
示例#6
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_packageWidget()
        self.ui.setupUi(self)

        # set updateTime
        self.ui.updateInterval.setValue(self.updateTime)

        # set initial states
        self.ui.checkUpdate.setChecked(True)
        self.ui.showTray.setChecked(True)

        # set signals
        self.ui.showTray.connect(self.ui.showTray, SIGNAL("toggled(bool)"), self.enableCheckTime)
        self.ui.checkUpdate.connect(self.ui.checkUpdate, SIGNAL("toggled(bool)"), self.updateSelected)