Esempio n. 1
0
    def __init__(self, parent=None):
        QAbstractTableModel.__init__(self, parent)
        self.gui_parent = parent

        self.plugins = []
        self.enabled_overrides = {}
        self.cover_overrides = {}
Esempio n. 2
0
    def __init__(self, parent=None):
        QAbstractTableModel.__init__(self, parent)
        self.gui_parent = parent

        self.plugins = []
        self.enabled_overrides = {}
        self.cover_overrides = {}
Esempio n. 3
0
 def __init__(self, accounts, subjects):
     QAbstractTableModel.__init__(self)
     self.accounts = accounts
     self.subjects = subjects
     self.account_order = sorted(self.accounts.keys())
     self.headers = map(QVariant, [_("Email"), _("Formats"), _("Subject"), _("Auto send")])
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = QVariant(self.default_font)
     self.tooltips = [NONE] + list(
         map(
             QVariant,
             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 <br>to this email address "
                         "(provided it is in one of the listed formats)."
                     ),
                 ],
             ),
         )
     )
Esempio n. 4
0
 def __init__(self, accounts, subjects):
     QAbstractTableModel.__init__(self)
     self.accounts = accounts
     self.subjects = subjects
     self.account_order = sorted(self.accounts.keys())
     self.headers = map(
         QVariant, [_('Email'),
                    _('Formats'),
                    _('Subject'),
                    _('Auto send')])
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = QVariant(self.default_font)
     self.tooltips = [NONE] + list(
         map(
             QVariant,
             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 <br>to this email address '
                   '(provided it is in one of the listed formats).')
             ])))
Esempio n. 5
0
 def __init__(self, parent):
     QAbstractTableModel.__init__(self, parent)
     self._data = None
     self._subs = [None]
     self._videos = [None]
     self._headers = [_("Videofile"), _("Subtitle")]
     self._main = None
     self.rowsSelected = None
Esempio n. 6
0
 def __init__(self, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.counts = (0, 0)
     self.words = {}  # Map of (word, locale) to location data for the word
     self.spell_map = {}  # Map of (word, locale) to dictionaries.recognized(word, locale)
     self.sort_on = (0, False)
     self.items = []  # The currently displayed items
     self.filter_expression = None
     self.show_only_misspelt = True
     self.headers = (_('Word'), _('Count'), _('Language'), _('Misspelled?'))
Esempio n. 7
0
 def __init__(self, display_plugins):
     QAbstractTableModel.__init__(self)
     self.display_plugins = display_plugins
     self.headers = map(QVariant, [
         _('Plugin Name'),
         _('Donate'),
         _('Status'),
         _('Installed'),
         _('Available'),
         _('Released'),
         _('Calibre'),
         _('Author')
     ])
Esempio n. 8
0
 def __init__(self, display_plugins):
     QAbstractTableModel.__init__(self)
     self.display_plugins = display_plugins
     self.headers = map(
         QVariant,
         [
             _("Plugin Name"),
             _("Donate"),
             _("Status"),
             _("Installed"),
             _("Available"),
             _("Released"),
             _("Calibre"),
             _("Author"),
         ],
     )
Esempio n. 9
0
 def flags(self, index):
     """
     return the item flags
     """
     if not index.isValid():
         return Qt.ItemIsEnabled
     return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
Esempio n. 10
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': _('Series'),
                'languages': _('Languages'),
        }
        self.overrides = {}
        self.exclude = frozenset(['series_index'])
Esempio n. 11
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': _('Series'),
            'languages': _('Languages'),
        }
        self.overrides = {}
        self.exclude = frozenset(['series_index'])
Esempio n. 12
0
    def __init__(self):
        QAbstractTableModel.__init__(self)
        SearchQueryParser.__init__(self, ["all"])

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

        self.jobs = []
        self.add_job = Dispatcher(self._add_job)
        self.server = Server(limit=int(config["worker_limit"] / 2.0), 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.QueuedConnection)
        self.timer.start(1000)
Esempio n. 13
0
File: jobs.py Progetto: sss/calibre
    def __init__(self):
        QAbstractTableModel.__init__(self)
        SearchQueryParser.__init__(self, ['all'])

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

        self.jobs = []
        self.add_job = Dispatcher(self._add_job)
        self.server = Server(limit=int(config['worker_limit'] / 2.0),
                             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.QueuedConnection)
        self.timer.start(1000)
Esempio n. 14
0
 def __init__(self, accounts, subjects, aliases={}):
     QAbstractTableModel.__init__(self)
     self.accounts = accounts
     self.subjects = subjects
     self.aliases = aliases
     self.account_order = sorted(self.accounts.keys())
     self.headers  = map(QVariant, [_('Email'), _('Formats'), _('Subject'),
         _('Auto send'), _('Alias')])
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = QVariant(self.default_font)
     self.tooltips =[NONE] + list(map(QVariant, 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 <br>to this email address '
                  '(provided it is in one of the listed formats).'),
          _('Friendly name to use for this email address')
          ])))
Esempio n. 15
0
 def flags(self, index):
     if index.column() == 3:
         return QAbstractTableModel.flags(self, index) | Qt.ItemIsUserCheckable
     else:
         return QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable
Esempio n. 16
0
 def __init__(self, results, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.results = results
     self.yes_icon = QVariant(QIcon(I('ok.png')))
Esempio n. 17
0
 def flags(self, index):
     flags = QAbstractTableModel.flags(self, index)
     if index.isValid():
         if index.row() == 0:
             flags |= Qt.ItemIsDropEnabled
     return flags
Esempio n. 18
0
 def __init__(self, parent):
     QAbstractTableModel.__init__(self, parent)
     self._imdb = []
     self._headers = ["Id"]
     self._main = None
     self.rowSelected = None
Esempio n. 19
0
 def __init__(self, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.ls_data = []
Esempio n. 20
0
 def flags(self, index):
     ans = QAbstractTableModel.flags(self, index)
     return ans | Qt.ItemIsUserCheckable
Esempio n. 21
0
 def flags(self, index):
     col = index.column()
     ans = QAbstractTableModel.flags(self, index)
     if col == 0:
         return ans | Qt.ItemIsUserCheckable
     return Qt.ItemIsEditable | ans
 def flags(self, index):
     flags = QAbstractTableModel.flags(self, index)
     flags |= Qt.ItemIsEditable
     return flags
Esempio n. 23
0
 def __init__(self, display_plugins):
     QAbstractTableModel.__init__(self)
     self.display_plugins = display_plugins
     self.headers = map(QVariant, [_('Plugin Name'), _('Donate'), _('Status'), _('Installed'),
                                   _('Available'), _('Released'), _('Calibre'), _('Author')])
Esempio n. 24
0
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if orientation == Qt.Horizontal and role == Qt.DisplayRole:
         return _('Font family') if section == 1 else _('Embedded')
     return QAbstractTableModel.headerData(self, section, orientation, role)
    def __init__(self, parent, bookmarks):
        QAbstractTableModel.__init__(self, parent)

        self.bookmarks = bookmarks[:]
Esempio n. 26
0
 def flags(self, index):
     col = index.column()
     ans = QAbstractTableModel.flags(self, index)
     if col == 0:
         return ans | Qt.ItemIsUserCheckable
     return Qt.ItemIsEditable | ans
Esempio n. 27
0
 def flags(self, index):
     ans = QAbstractTableModel.flags(self, index)
     return ans | Qt.ItemIsUserCheckable
Esempio n. 28
0
 def flags(self, index):
     if index.column() == 3:
         return QAbstractTableModel.flags(self,
                                          index) | Qt.ItemIsUserCheckable
     else:
         return QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable
Esempio n. 29
0
 def __init__(self, results, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.results = results
     self.yes_icon = QVariant(QIcon(I('ok.png')))
Esempio n. 30
0
 def __init__(self, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.items = []
     self.font_data = {}
     self.sorted_on = ('name', True)