Exemplo n.º 1
0
 def _update_recents(self):
     """
     Updates the recent files list.
     """
     self.ui.listWidgetRecents.clear()
     for file in self.app.file.recent_files_manager.get_recent_files():
         item = QtWidgets.QListWidgetItem()
         fi = QtCore.QFileInfo(file)
         icon = FileIconProvider().icon(fi)
         item.setText(fi.fileName())
         item.setToolTip(file)
         item.setIcon(icon)
         item.setData(QtCore.Qt.UserRole, file)
         self.ui.listWidgetRecents.addItem(item)
Exemplo n.º 2
0
 def _reset_panels(self):
     self.ui.lw_panels.clear()
     editor = Preferences().editor
     installed_panels = self._get_installed_panels()
     for mode, description in installed_panels:
         enabled = True
         if mode in editor.panels.keys():
             enabled = editor.panels[mode]
         item = QtWidgets.QListWidgetItem(mode, self.ui.lw_panels)
         item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
         item.setCheckState(
             QtCore.Qt.Checked if enabled else QtCore.Qt.Unchecked)
         self.ui.lw_panels.addItem(item)
         item.setToolTip(description)
Exemplo n.º 3
0
 def _update_recents(self):
     """
     Updates the recent files list.
     """
     self.ui.listWidgetRecents.clear()
     for file in self.app.file.recent_files_manager.get_recent_files():
         item = QtWidgets.QListWidgetItem()
         if ('.' + QtCore.QFileInfo(file).suffix().upper()
                 in CobolCodeEdit.extensions):
             icon = QtGui.QIcon(icons.ICON_MIMETYPE)
         else:
             icon = QtWidgets.QFileIconProvider().icon(
                 QtCore.QFileInfo(file))
         item.setText(QtCore.QFileInfo(file).fileName())
         item.setToolTip(file)
         item.setIcon(icon)
         item.setData(QtCore.Qt.UserRole, file)
         self.ui.listWidgetRecents.addItem(item)
Exemplo n.º 4
0
 def _add_file(self, path):
     icon = QtWidgets.QFileIconProvider().icon(QtCore.QFileInfo(path))
     item = QtWidgets.QListWidgetItem(icon, path)
     self.listWidget.addItem(item)
Exemplo n.º 5
0
 def addSnipplet(self, description, contents):
     item = QtWidgets.QListWidgetItem(self.snippletView)
     item.setText(description)
     item.setToolTip(contents)