Exemple #1
0
 def init(self):
     """Start Pylou Widget."""
     self.layou = QGraphicsLinearLayout(self)
     self.stringlist = QStringList()
     self.model = QStringListModel(self.applet)
     self.model.setStringList(self.stringlist)
     self.treeview = MyTreeView(self)
     self.treeview.setModel(self.model)
     self.lineEdit, self.label = MyLineEdit(self), Plasma.Label(self)
     self.label.setText("Search")
     self.layou.setOrientation(0x2)  # Qt.Vertical
     self.layou.addItem(self.treeview)
     self.layou.addItem(self.label)
     self.layou.addItem(self.lineEdit)
     self.setLayout(self.layou)
     self.lineEdit.returnPressed.connect(self.addItem)
     self.setMinimumSize(200, 99)
     self.setMaximumSize(666, 666)
     # custom user choosed fonts
     user_font_family = QVariant(self.applet.configurations.readEntry(
         "TextFont", QVariant(QFont())))
     self.treeview.nativeWidget().setFont(QFont(user_font_family))
     # custom user choosed styles
     user_style_sheet = "color:{};alternate-background-color:{}".format(
         self.applet.configurations.readEntry("TextColor"),
         self.applet.configurations.readEntry("AlternateBColor"))
     self.treeview.nativeWidget().setStyleSheet(user_style_sheet)
     # Qt connecting people
     Applet.connect(
         self.lineEdit, SIGNAL("keyUPPressed"), self.prevHistoryItem)
     Applet.connect(
         self.lineEdit, SIGNAL("keyDownPressed"), self.nextHistoryItem)
     Applet.connect(self.treeview, SIGNAL("DblClick"), self.openFile)
     Applet.connect(self.treeview, SIGNAL("Click"), self.openDirectory)
     self.applet.appletDestroyed.connect(self.saveHistory)
     # History file
     self.histfile = HISTORY_FILE_PATH
     with open(self.histfile, 'r') as history_file:
         self.history = history_file.readlines()
     self.historyCurrentItem = 0
     self.treeview.nativeWidget().hide()
     self.resize(self.minimumSize())
Exemple #2
0
 def __init__(self, parent, args = None):
     Applet.__init__(self, parent)
     self.frame = None
Exemple #3
0
 def __init__(self, parent, args=None):
     """Init class."""
     Applet.__init__(self, parent)
Exemple #4
0
 def __init__(self, parent, args = None):
     Applet.__init__(self, parent)
     self.cfg = {}
     self.halfSecondSource = False