Ejemplo n.º 1
0
 def flags(self, index):
     if index.column() == 3:
         return QAbstractTableModel.flags(
             self, index) | Qt.ItemFlag.ItemIsUserCheckable
     else:
         return QAbstractTableModel.flags(
             self, index) | Qt.ItemFlag.ItemIsEditable
    def __init__(self, parent=None):
        QAbstractTableModel.__init__(self, parent)
        self.gui_parent = parent

        self.plugins = []
        self.enabled_overrides = {}
        self.cover_overrides = {}
Ejemplo n.º 3
0
 def __init__(self, display_plugins):
     QAbstractTableModel.__init__(self)
     self.display_plugins = display_plugins
     self.headers = list(
         map(unicode_type, [
             _('Plugin name'),
             _('Donate'),
             _('Status'),
             _('Installed'),
             _('Available'),
             _('Released'),
             _('calibre'),
             _('Author')
         ]))
Ejemplo n.º 4
0
 def headerData(self,
                section,
                orientation,
                role=Qt.ItemDataRole.DisplayRole):
     if orientation == Qt.Orientation.Horizontal and role == Qt.ItemDataRole.DisplayRole:
         return _('Font family') if section == 1 else _('Embedded')
     return QAbstractTableModel.headerData(self, section, orientation, role)
Ejemplo n.º 5
0
    def __init__(self):
        QAbstractTableModel.__init__(self)
        SearchQueryParser.__init__(self, ['all'])

        self.wait_icon     = (QIcon(I('jobs.png')))
        self.running_icon  = (QIcon(I('exec.png')))
        self.error_icon    = (QIcon(I('dialog_error.png')))
        self.done_icon     = (QIcon(I('ok.png')))

        self.jobs          = []
        self.add_job       = Dispatcher(self._add_job)
        self.server        = Server(limit=config['worker_limit']//2,
                                enforce_cpu_limit=config['enforce_cpu_limit'])
        self.threaded_server = ThreadedJobServer()
        self.changed_queue = Queue()

        self.timer         = QTimer(self)
        self.timer.timeout.connect(self.update, type=Qt.ConnectionType.QueuedConnection)
        self.timer.start(1000)
Ejemplo n.º 6
0
    def __init__(self, parent=None):
        QAbstractTableModel.__init__(self, parent)

        self.fields = []
        self.descs = {
                'authors': _('Authors'),
                'comments': _('Comments'),
                'pubdate': _('Published date'),
                'publisher': _('Publisher'),
                'rating' : _('Rating'),
                'tags' : _('Tags'),
                'title': _('Title'),
                'series': ngettext('Series', 'Series', 1),
                'languages': _('Languages'),
        }
        self.overrides = {}
        self.exclude = frozenset([
            'series_index', 'language'  # some plugins use language instead of languages
        ])
Ejemplo n.º 7
0
 def __init__(self, accounts, subjects, aliases={}, tags={}):
     QAbstractTableModel.__init__(self)
     self.accounts = accounts
     self.subjects = subjects
     self.aliases = aliases
     self.tags = tags
     self.sorted_on = (0, True)
     self.account_order = list(self.accounts)
     self.do_sort()
     self.headers = [
         _('Email'),
         _('Formats'),
         _('Subject'),
         _('Auto send'),
         _('Alias'),
         _('Auto send only tags')
     ]
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = (self.default_font)
     self.tooltips = [None] + list(
         map(textwrap.fill, [
             _('Formats to email. The first matching format will be sent.'),
             _('Subject of the email to use when sending. When left blank '
               'the title will be used for the subject. Also, the same '
               'templates used for "Save to disk" such as {title} and '
               '{author_sort} can be used here.'), '<p>' +
             _('If checked, downloaded news will be automatically '
               'mailed to this email address '
               '(provided it is in one of the listed formats and has not been filtered by tags).'
               ),
             _('Friendly name to use for this email address'),
             _('If specified, only news with one of these tags will be sent to'
               ' this email address. All news downloads have their title as a'
               ' tag, so you can use this to easily control which news downloads'
               ' are sent to this email address.')
         ]))
Ejemplo n.º 8
0
 def __init__(self, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.items = []
     self.font_data = {}
     self.sorted_on = ('name', True)
 def flags(self, index):
     col = index.column()
     ans = QAbstractTableModel.flags(self, index)
     if col == 0:
         return ans | Qt.ItemFlag.ItemIsUserCheckable
     return Qt.ItemFlag.ItemIsEditable | ans
Ejemplo n.º 10
0
 def __init__(self, results, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.results = results
     self.yes_icon = (QIcon(I('ok.png')))