예제 #1
0
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(362, 205)
        self.gridLayoutWidget = QtGui.QWidget(Dialog)
        self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 50, 341, 135))
        self.gridLayoutWidget.setObjectName("gridLayoutWidget")
        self.gridLayout_2 = QtGui.QGridLayout(self.gridLayoutWidget)
        self.gridLayout_2.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.textColor_button = KColorButton(self.gridLayoutWidget)
        self.textColor_button.setObjectName("textColor_button")
        self.gridLayout_2.addWidget(self.textColor_button, 0, 1, 1, 1)
        self.Dropshadow_label = QtGui.QLabel(self.gridLayoutWidget)
        self.Dropshadow_label.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.Dropshadow_label.setObjectName("Dropshadow_label")
        self.gridLayout_2.addWidget(self.Dropshadow_label, 1, 0, 1, 1)
        self.shadowColor_button = KColorButton(self.gridLayoutWidget)
        self.shadowColor_button.setObjectName("shadowColor_button")
        self.gridLayout_2.addWidget(self.shadowColor_button, 1, 1, 1, 1)
        self.TextColor_label = QtGui.QLabel(self.gridLayoutWidget)
        self.TextColor_label.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.TextColor_label.setTextFormat(QtCore.Qt.AutoText)
        self.TextColor_label.setObjectName("TextColor_label")
        self.gridLayout_2.addWidget(self.TextColor_label, 0, 0, 1, 1)
        self.Logo_checkbox = QtGui.QCheckBox(self.gridLayoutWidget)
        self.Logo_checkbox.setObjectName("Logo_checkbox")
        self.gridLayout_2.addWidget(self.Logo_checkbox, 2, 1, 1, 1)
        self.Background_checkbox = QtGui.QCheckBox(self.gridLayoutWidget)
        self.Background_checkbox.setObjectName("Background_checkbox")
        self.gridLayout_2.addWidget(self.Background_checkbox, 3, 1, 1, 1)
        self.Interval_label = QtGui.QLabel(self.gridLayoutWidget)
        self.Interval_label.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.Interval_label.setObjectName("Interval_label")
        self.gridLayout_2.addWidget(self.Interval_label, 4, 0, 1, 1)
        self.update_SpinBox = KIntSpinBox(self.gridLayoutWidget)
        self.update_SpinBox.setMaximum(120)
        self.update_SpinBox.setProperty("value", 5)
        self.update_SpinBox.setObjectName("update_SpinBox")
        self.gridLayout_2.addWidget(self.update_SpinBox, 4, 1, 1, 1)
        self.Font_combo = QtGui.QFontComboBox(Dialog)
        self.Font_combo.setGeometry(QtCore.QRect(7, 20, 208, 25))
        self.Font_combo.setObjectName("Font_combo")
        self.Italic_button = QtGui.QPushButton(Dialog)
        self.Italic_button.setGeometry(QtCore.QRect(330, 20, 25, 25))
        self.Italic_button.setObjectName("Italic_button")
        self.fontSize_combo = QtGui.QComboBox(Dialog)
        self.fontSize_combo.setGeometry(QtCore.QRect(215, 20, 91, 25))
        self.fontSize_combo.setObjectName("fontSize_combo")
        self.Bold_button = QtGui.QPushButton(Dialog)
        self.Bold_button.setGeometry(QtCore.QRect(305, 20, 25, 25))
        self.Bold_button.setObjectName("Bold_button")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
    def setupUi(self, ItemEditor):
        ItemEditor.setObjectName("ItemEditor")
        ItemEditor.resize(536, 584)
        self.verticalLayout_2 = QtGui.QVBoxLayout(ItemEditor)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label = QtGui.QLabel(ItemEditor)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
        self.nameEdit = QtGui.QLineEdit(ItemEditor)
        self.nameEdit.setObjectName("nameEdit")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.nameEdit)
        self.verticalLayout.addLayout(self.formLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        self.fontChooser = KFontChooser(ItemEditor)
        self.fontChooser.setObjectName("fontChooser")
        self.verticalLayout_2.addWidget(self.fontChooser)
        self.formLayout_2 = QtGui.QFormLayout()
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_2 = QtGui.QLabel(ItemEditor)
        self.label_2.setObjectName("label_2")
        self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
        self.colorButton = KColorButton(ItemEditor)
        self.colorButton.setObjectName("colorButton")
        self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.colorButton)
        self.verticalLayout_2.addLayout(self.formLayout_2)

        self.retranslateUi(ItemEditor)
        QtCore.QMetaObject.connectSlotsByName(ItemEditor)
예제 #3
0
    def __init__(self, window, parent, name, view=None, color=True):
        #print "creating ", name, " under ", parent
        if view:
            self.view = view
        if not view:
            try:
                self.view = parent.view
            except AttributeError:
                self.view = parent
        self.window = window
        self._name = name
        ## Init super class ( QtGui.QTreeWidgetItem )
        super(CustomTreeItem, self).__init__(parent)

        ## Column 0 - Text:
        self.setText(0, name)

        ## Column 1 - Color:
        if color:
            #print type(self.view.view)
            self.colorChooser = KColorButton(self.view)
            self.colorChooser.setColor(
                QtGui.QColor(randint(0, 255), randint(0, 255), randint(0,
                                                                       255)))
            #self.colorChooser.setGeometry(QtCore.QRect(0, 0, 10, 10))
            self.colorChooser.setFixedSize(30, 20)
            self.view.setItemWidget(self, 1, self.colorChooser)
            self.view.connect(self.colorChooser,
                              QtCore.SIGNAL("changed (const QColor&)"),
                              self.colorChanged)

        ## Column 2 - CheckBox:
        self.button = QtGui.QCheckBox(self.view)
        self.button.setChecked(True)
        self.view.setItemWidget(self, 2, self.button)

        ## Column 3 - Current value:
        if color:
            self.setText(3, 'N/A')
        else:
            self.setText(3, '')

        ## Signals
        self.view.connect(self.button, QtCore.SIGNAL("clicked()"),
                          self.buttonPressed)
예제 #4
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox1 = KHBox(self)
        hBox1.setSpacing(10)
        hBox1.setMargin(40)

        colorButtonLabel = QLabel("KColorButton", hBox1)
        colorButton = KColorButton(hBox1)

        colorCellsLabel = QLabel("KColorCells", hBox1)
        colorCells = KColorCells(hBox1, 1, 8)
        colorCells.setMaximumSize(160, 20)
        colorCells.setColor(0, Qt.black)
        colorCells.setColor(1, Qt.red)
        colorCells.setColor(2, Qt.yellow)
        colorCells.setColor(3, Qt.blue)
        colorCells.setColor(4, Qt.darkGreen)
        colorCells.setColor(5, Qt.magenta)
        colorCells.setColor(6, Qt.gray)
        colorCells.setColor(7, Qt.white)

        colorComboLabel = QLabel("KColorCombo", hBox1)
        colorCombo = KColorCombo(hBox1)

        colorList = [
            Qt.black, Qt.red, Qt.yellow, Qt.blue, Qt.darkGreen, Qt.magenta,
            Qt.gray, Qt.white
        ]
        colorCombo.setColors(colorList)
        colorCombo.setMaximumWidth(80)

        hBox2 = KHBox(self)
        hBox2.setSpacing(10)
        self.layout().setAlignment(hBox2, Qt.AlignHCenter | Qt.AlignTop)
        self.setStretchFactor(hBox2, 1)

        colorPatchLabel = QLabel("KColorPatch", hBox2)
        hBox2.layout().setAlignment(colorPatchLabel, Qt.AlignHCenter)
        self.colorPatch = KColorPatch(hBox2)
        self.colorPatch.setFixedSize(40, 40)
        hBox2.layout().setAlignment(self.colorPatch, Qt.AlignHCenter)

        self.colorPatch.setColor(Qt.red)
        self.colorPatch.show()

        self.connect(colorButton, SIGNAL("changed (const QColor&)"),
                     self.colorPatch.setColor)
        self.connect(colorCells, SIGNAL("colorSelected (int, const QColor&)"),
                     self.colorCellSelected)
        self.connect(colorCombo, SIGNAL("activated (const QColor&)"),
                     self.colorPatch.setColor)
class Ui_ItemEditor(object):
    def setupUi(self, ItemEditor):
        ItemEditor.setObjectName("ItemEditor")
        ItemEditor.resize(536, 584)
        self.verticalLayout_2 = QtGui.QVBoxLayout(ItemEditor)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label = QtGui.QLabel(ItemEditor)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
        self.nameEdit = QtGui.QLineEdit(ItemEditor)
        self.nameEdit.setObjectName("nameEdit")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.nameEdit)
        self.verticalLayout.addLayout(self.formLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        self.fontChooser = KFontChooser(ItemEditor)
        self.fontChooser.setObjectName("fontChooser")
        self.verticalLayout_2.addWidget(self.fontChooser)
        self.formLayout_2 = QtGui.QFormLayout()
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_2 = QtGui.QLabel(ItemEditor)
        self.label_2.setObjectName("label_2")
        self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
        self.colorButton = KColorButton(ItemEditor)
        self.colorButton.setObjectName("colorButton")
        self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.colorButton)
        self.verticalLayout_2.addLayout(self.formLayout_2)

        self.retranslateUi(ItemEditor)
        QtCore.QMetaObject.connectSlotsByName(ItemEditor)

    def retranslateUi(self, ItemEditor):
        self.label.setText(QtGui.QApplication.translate("ItemEditor", "Item name:", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("ItemEditor", "Font color:", None, QtGui.QApplication.UnicodeUTF8))
예제 #6
0
    def __init__(self, window, parent, name, view=None, color=True):
        #print "creating ", name, " under ", parent
        if view:
            self.view = view
        if not view:
            try:
                self.view = parent.view
            except AttributeError:
                self.view = parent
        self.window = window
        self._name = name
        ## Init super class ( QtGui.QTreeWidgetItem )
        super(CustomTreeItem, self).__init__(parent)

        ## Column 0 - Text:
        self.setText(0, name)

        ## Column 1 - Color:
        if color:
            #print type(self.view.view)
            self.colorChooser = KColorButton(self.view)
            self.colorChooser.setColor(QtGui.QColor(randint(0, 255), randint(0, 255), randint(0, 255)))
            #self.colorChooser.setGeometry(QtCore.QRect(0, 0, 10, 10))
            self.colorChooser.setFixedSize(30,20)
            self.view.setItemWidget(self, 1, self.colorChooser)
            self.view.connect(self.colorChooser, QtCore.SIGNAL("changed (const QColor&)"), self.colorChanged)

        ## Column 2 - CheckBox:
        self.button = QtGui.QCheckBox(self.view)
        self.button.setChecked(True)
        self.view.setItemWidget(self, 2, self.button)

        ## Column 3 - Current value:
        if color:
            self.setText(3, 'N/A')
        else:
            self.setText(3, '')

        ## Signals
        self.view.connect(self.button, QtCore.SIGNAL("clicked()"), self.buttonPressed)
예제 #7
0
    def prepareConfigDialog(self):
        """Prepare the Configuration Dialog."""
        self.bcolor, self.dialog = QColor(), KDialog()
        self.dialog.setWindowTitle(__package__ + "Settings")
        self.layBox = QGridLayout(self.dialog.mainWidget())
        self.title = KTitleWidget(self.dialog)
        self.title.setText(__doc__ + " !")
        self.title.setAutoHideTimeout(3000)
        self.FontButton = KFontRequester(self.dialog)
        self.tfont = QFont(QVariant(self.configurations.readEntry("TextFont",
                           QVariant(QFont()))))
        self.FontButton.setFont(self.tfont)
        self.ColorButton = KColorButton(self.dialog)
        self.tcolor = QColor(self.configurations.readEntry("TextColor",
                             QColor("#000").name()))
        self.ColorButton.setColor(self.tcolor)
        self.BColorButton = KColorButton(self.dialog)
        # button to update the DB via sudo updatedb

        self.UpdateDB = KPushButton("Update Database", self.dialog,
                                    clicked=lambda: self.update_db())
        self.UpdateDB.setToolTip("Database is Updated every Reboot and Daily!")
        self.Histor = KPushButton("Delete my History", self.dialog,
                                  clicked=delete_my_history)
        self.Histor.setToolTip("History is Deleted every Reboot !")
        # list of banned words separated by spaces
        self.banned = KTextEdit(self.dialog)
        self.banned.setPlainText(self.configurations.readEntry(
            "Banned", "sex p**n drugs suicide decapitate religion").toString())
        # set the colors
        cg = KConfig("kdeglobals")
        color = cg.group("Colors:View").readEntry(
            "BackgroundAlternate").split(",")
        self.bcolor = QColor(int(color[0]), int(color[1]), int(color[2]))
        self.BColorButton.setColor(self.bcolor)
        self.history_file_path_field = KLineEdit(HISTORY_FILE_PATH)
        self.history_file_path_field.setDisabled(True)
        self.python_file_path_field = KLineEdit(__file__)
        self.python_file_path_field.setDisabled(True)
        self.kill_baloo = QCheckBox("Disable Baloo")
        self.kill_baloo.setToolTip("Enable/Disable Desktop Search Indexing")
        self.kill_baloo.stateChanged.connect(lambda: call(
            DISABLE_BALOO_CMD.format(str(
                not self.kill_baloo.isChecked()).lower()), shell=True))
        self.kill_baloo.stateChanged.connect(lambda: QMessageBox.information(
            self.dialog, __doc__, """
            <b>Indexing Disabled, Baloo is Dead !
            """ if self.kill_baloo.isChecked() else """
            <b>Indexing Enabled, Baloo is Running !"""))
        self.updatez = KPushButton("Check for Updates", self.dialog,
                                   clicked=lambda: self.check_for_updates())
        self.updatez.setToolTip("Check for Pylou updates from the internet")
        self.home_sweet_home = QCheckBox("Only Search Home")
        self.home_sweet_home.setToolTip("Only Search on my Home folders")
        self.home_sweet_home.setChecked(
            bool(self.configurations.readEntry("Home", True)))
        # pack all widgets
        self.layBox.addWidget(self.title, 0, 1)
        self.layBox.addWidget(QLabel("Font"), 1, 0)
        self.layBox.addWidget(self.FontButton, 1, 1)
        self.layBox.addWidget(QLabel("Text Color"), 2, 0)
        self.layBox.addWidget(self.ColorButton, 2, 1)
        self.layBox.addWidget(QLabel("Alternate Color"), 3, 0)
        self.layBox.addWidget(self.BColorButton, 3, 1)
        self.layBox.addWidget(QLabel(), 4, 0)
        self.layBox.addWidget(QLabel("Mainteniance"), 5, 0)
        self.layBox.addWidget(self.UpdateDB, 5, 1)
        self.layBox.addWidget(QLabel("Privacy"), 6, 0)
        self.layBox.addWidget(self.Histor, 6, 1)
        self.layBox.addWidget(QLabel("History file"), 7, 0)
        self.layBox.addWidget(self.history_file_path_field, 7, 1)
        self.layBox.addWidget(QLabel(__package__ + "file"), 8, 0)
        self.layBox.addWidget(self.python_file_path_field, 8, 1)
        self.layBox.addWidget(QLabel("Banned Words"), 9, 0)
        self.layBox.addWidget(self.banned, 9, 1)
        self.layBox.addWidget(QLabel("SelfUpdating"), 10, 0)
        self.layBox.addWidget(self.updatez, 10, 1)
        self.layBox.addWidget(QLabel("<b>Disable Indexing"), 12, 0)
        self.layBox.addWidget(self.kill_baloo, 12, 1)
        self.layBox.addWidget(QLabel("Search Paths"), 13, 0)
        self.layBox.addWidget(self.home_sweet_home, 13, 1)
        # button box on the bottom
        self.dialog.setButtons(KDialog.ButtonCodes(
            KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel | KDialog.Apply)))
        # connect
        self.dialog.applyClicked.connect(self.configAccepted)
        self.dialog.okClicked.connect(self.configAccepted)
예제 #8
0
class PylouApplet(Applet):

    """Main Applet containing the UI of Pylou."""

    def __init__(self, parent, args=None):
        """Init class."""
        Applet.__init__(self, parent)

    def init(self):
        """Start the Applet."""
        self._widget = None
        self.setHasConfigurationInterface(True)
        self.setAspectRatioMode(Plasma.IgnoreAspectRatio)
        self.configurations = self.config()
        self._widget = PylouWidget(self)
        self._widget.init()
        self.setGraphicsWidget(self._widget)
        self.applet.setPassivePopup(True)
        self.setPopupIcon(QIcon.fromTheme("edit-find"))
        # for some odd reason this has to be called twice?
        self.setGraphicsWidget(self._widget)
        self.prepareConfigDialog()

    def update_db(self):
        """Update the DB."""
        return call("kdesudo --noignorebutton -c updatedb", shell=True)

    def prepareConfigDialog(self):
        """Prepare the Configuration Dialog."""
        self.bcolor, self.dialog = QColor(), KDialog()
        self.dialog.setWindowTitle(__package__ + "Settings")
        self.layBox = QGridLayout(self.dialog.mainWidget())
        self.title = KTitleWidget(self.dialog)
        self.title.setText(__doc__ + " !")
        self.title.setAutoHideTimeout(3000)
        self.FontButton = KFontRequester(self.dialog)
        self.tfont = QFont(QVariant(self.configurations.readEntry("TextFont",
                           QVariant(QFont()))))
        self.FontButton.setFont(self.tfont)
        self.ColorButton = KColorButton(self.dialog)
        self.tcolor = QColor(self.configurations.readEntry("TextColor",
                             QColor("#000").name()))
        self.ColorButton.setColor(self.tcolor)
        self.BColorButton = KColorButton(self.dialog)
        # button to update the DB via sudo updatedb

        self.UpdateDB = KPushButton("Update Database", self.dialog,
                                    clicked=lambda: self.update_db())
        self.UpdateDB.setToolTip("Database is Updated every Reboot and Daily!")
        self.Histor = KPushButton("Delete my History", self.dialog,
                                  clicked=delete_my_history)
        self.Histor.setToolTip("History is Deleted every Reboot !")
        # list of banned words separated by spaces
        self.banned = KTextEdit(self.dialog)
        self.banned.setPlainText(self.configurations.readEntry(
            "Banned", "sex p**n drugs suicide decapitate religion").toString())
        # set the colors
        cg = KConfig("kdeglobals")
        color = cg.group("Colors:View").readEntry(
            "BackgroundAlternate").split(",")
        self.bcolor = QColor(int(color[0]), int(color[1]), int(color[2]))
        self.BColorButton.setColor(self.bcolor)
        self.history_file_path_field = KLineEdit(HISTORY_FILE_PATH)
        self.history_file_path_field.setDisabled(True)
        self.python_file_path_field = KLineEdit(__file__)
        self.python_file_path_field.setDisabled(True)
        self.kill_baloo = QCheckBox("Disable Baloo")
        self.kill_baloo.setToolTip("Enable/Disable Desktop Search Indexing")
        self.kill_baloo.stateChanged.connect(lambda: call(
            DISABLE_BALOO_CMD.format(str(
                not self.kill_baloo.isChecked()).lower()), shell=True))
        self.kill_baloo.stateChanged.connect(lambda: QMessageBox.information(
            self.dialog, __doc__, """
            <b>Indexing Disabled, Baloo is Dead !
            """ if self.kill_baloo.isChecked() else """
            <b>Indexing Enabled, Baloo is Running !"""))
        self.updatez = KPushButton("Check for Updates", self.dialog,
                                   clicked=lambda: self.check_for_updates())
        self.updatez.setToolTip("Check for Pylou updates from the internet")
        self.home_sweet_home = QCheckBox("Only Search Home")
        self.home_sweet_home.setToolTip("Only Search on my Home folders")
        self.home_sweet_home.setChecked(
            bool(self.configurations.readEntry("Home", True)))
        # pack all widgets
        self.layBox.addWidget(self.title, 0, 1)
        self.layBox.addWidget(QLabel("Font"), 1, 0)
        self.layBox.addWidget(self.FontButton, 1, 1)
        self.layBox.addWidget(QLabel("Text Color"), 2, 0)
        self.layBox.addWidget(self.ColorButton, 2, 1)
        self.layBox.addWidget(QLabel("Alternate Color"), 3, 0)
        self.layBox.addWidget(self.BColorButton, 3, 1)
        self.layBox.addWidget(QLabel(), 4, 0)
        self.layBox.addWidget(QLabel("Mainteniance"), 5, 0)
        self.layBox.addWidget(self.UpdateDB, 5, 1)
        self.layBox.addWidget(QLabel("Privacy"), 6, 0)
        self.layBox.addWidget(self.Histor, 6, 1)
        self.layBox.addWidget(QLabel("History file"), 7, 0)
        self.layBox.addWidget(self.history_file_path_field, 7, 1)
        self.layBox.addWidget(QLabel(__package__ + "file"), 8, 0)
        self.layBox.addWidget(self.python_file_path_field, 8, 1)
        self.layBox.addWidget(QLabel("Banned Words"), 9, 0)
        self.layBox.addWidget(self.banned, 9, 1)
        self.layBox.addWidget(QLabel("SelfUpdating"), 10, 0)
        self.layBox.addWidget(self.updatez, 10, 1)
        self.layBox.addWidget(QLabel("<b>Disable Indexing"), 12, 0)
        self.layBox.addWidget(self.kill_baloo, 12, 1)
        self.layBox.addWidget(QLabel("Search Paths"), 13, 0)
        self.layBox.addWidget(self.home_sweet_home, 13, 1)
        # button box on the bottom
        self.dialog.setButtons(KDialog.ButtonCodes(
            KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel | KDialog.Apply)))
        # connect
        self.dialog.applyClicked.connect(self.configAccepted)
        self.dialog.okClicked.connect(self.configAccepted)

    @pyqtSignature("configAccepted()")
    def configAccepted(self):
        """Save configuration settings."""
        self.tcolor = self.ColorButton.color()
        self.bcolor = self.BColorButton.color()
        self._widget.treeview.nativeWidget().setFont(self.tfont)
        self._widget.treeview.nativeWidget().setStyleSheet(
            "color:{};alternate-background-color:{}".format(
                self.tcolor.name(), self.bcolor.name()))
        self.configurations.writeEntry("TextColor", self.tcolor.name())
        self.configurations.writeEntry("AlternateBColor", self.bcolor.name())
        self.configurations.writeEntry("TextFont", QVariant(self.tfont))
        self.configurations.writeEntry("Banned", self.banned.toPlainText())
        self.configurations.writeEntry("Home",
                                       self.home_sweet_home.isChecked())

    def showConfigurationInterface(self):
        """Show configuration dialog."""
        self.dialog.show()
        self.dialog.raise_()

    def check_for_updates(self):
        """Method to check for updates from Git repo versus this version."""
        this_version = str(open(__file__).read())
        last_version = str(urlopen(__source__).read())
        if this_version != last_version:
            m = "Theres new Version available!<br>Download update from the web"
        else:
            m = "No new updates!<br>You have the lastest version of this app!."
        return QMessageBox.information(None, __doc__.title(), "<b>" + m)
예제 #9
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(384, 148)
        self.verticalLayout_2 = QtGui.QVBoxLayout(Form)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.groupBox)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label_3 = QtGui.QLabel(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
        self.label_3.setSizePolicy(sizePolicy)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout.addWidget(self.label_3)
        self.formLayout_3 = QtGui.QFormLayout()
        self.formLayout_3.setFormAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
        self.formLayout_3.setObjectName(_fromUtf8("formLayout_3"))
        self.label_13 = QtGui.QLabel(self.groupBox)
        self.label_13.setObjectName(_fromUtf8("label_13"))
        self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_13)
        self.activeTaskBackgroundColor = KColorButton(self.groupBox)
        self.activeTaskBackgroundColor.setObjectName(_fromUtf8("activeTaskBackgroundColor"))
        self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole, self.activeTaskBackgroundColor)
        self.label_14 = QtGui.QLabel(self.groupBox)
        self.label_14.setObjectName(_fromUtf8("label_14"))
        self.formLayout_3.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_14)
        self.activeTaskTextColor = KColorButton(self.groupBox)
        self.activeTaskTextColor.setObjectName(_fromUtf8("activeTaskTextColor"))
        self.formLayout_3.setWidget(1, QtGui.QFormLayout.FieldRole, self.activeTaskTextColor)
        self.verticalLayout.addLayout(self.formLayout_3)
        self.horizontalLayout_2.addLayout(self.verticalLayout)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.label_4 = QtGui.QLabel(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
        self.label_4.setSizePolicy(sizePolicy)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.verticalLayout_3.addWidget(self.label_4)
        self.formLayout_4 = QtGui.QFormLayout()
        self.formLayout_4.setFormAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
        self.formLayout_4.setObjectName(_fromUtf8("formLayout_4"))
        self.label_15 = QtGui.QLabel(self.groupBox)
        self.label_15.setObjectName(_fromUtf8("label_15"))
        self.formLayout_4.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_15)
        self.inactiveTaskBackgroundColor = KColorButton(self.groupBox)
        self.inactiveTaskBackgroundColor.setObjectName(_fromUtf8("inactiveTaskBackgroundColor"))
        self.formLayout_4.setWidget(0, QtGui.QFormLayout.FieldRole, self.inactiveTaskBackgroundColor)
        self.label_16 = QtGui.QLabel(self.groupBox)
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.formLayout_4.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_16)
        self.inactiveTaskTextColor = KColorButton(self.groupBox)
        self.inactiveTaskTextColor.setObjectName(_fromUtf8("inactiveTaskTextColor"))
        self.formLayout_4.setWidget(1, QtGui.QFormLayout.FieldRole, self.inactiveTaskTextColor)
        self.verticalLayout_3.addLayout(self.formLayout_4)
        self.horizontalLayout_2.addLayout(self.verticalLayout_3)
        self.verticalLayout_2.addWidget(self.groupBox)
        spacerItem1 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)