Example #1
0
 def __init__(self, data):
     QAbstractTableModel.__init__(self, None)
     self.playlist = data
     self.activeInd = -1
     self.mode = 'Audio'
     self.changed = set()
     self.horizontalHeaderOfTable = ['', '', '']
Example #2
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
Example #3
0
    def __init__(self, parent=None):
        QAbstractTableModel.__init__(self, parent)
        self.gui_parent = parent

        self.plugins = []
        self.enabled_overrides = {}
        self.cover_overrides = {}
Example #4
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.')
          ]))
Example #5
0
    def __init__(self, parent=None):
        QAbstractTableModel.__init__(self, parent)
        self.gui_parent = parent

        self.plugins = []
        self.enabled_overrides = {}
        self.cover_overrides = {}
Example #6
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 = self.accounts.keys()
     self.do_sort()
     self.headers  = map(unicode, [_('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(unicode, 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.')
          ])))
Example #7
0
 def __init__(self, parent, value):
     if not isinstance(value, dict):
         raise TypeError('value must be dict')
     QAbstractTableModel.__init__(self, parent)
     self._value = value
     self._pasting = False
     self._pasted_properties = {}
Example #8
0
 def __init__(self, accounts, subjects, aliases={}):
     QAbstractTableModel.__init__(self)
     self.accounts = accounts
     self.subjects = subjects
     self.aliases = aliases
     self.sorted_on = (0, True)
     self.account_order = self.accounts.keys()
     self.do_sort()
     self.headers = map(unicode, [
         _('Email'),
         _('Formats'),
         _('Subject'),
         _('Auto send'),
         _('Alias')
     ])
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = (self.default_font)
     self.tooltips = [None] + list(
         map(
             unicode,
             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')
             ])))
Example #9
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(unicode, [_("Email"), _("Formats"), _("Subject"), _("Auto send"), _("Alias")])
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = self.default_font
     self.tooltips = [None] + list(
         map(
             unicode,
             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"),
                 ],
             ),
         )
     )
Example #10
0
 def __init__(self,
              parent,
              data,
              display_column=None,
              editable=False,
              row_headers=False):
     QAbstractTableModel.__init__(self, parent)
     self._data = data.copy()
     self._display_column_index = (0 if display_column is None else
                                   data.columns.get_loc(display_column))
     self._selection_model = QItemSelectionModel(self)
     self._editable = editable
     self._row_headers = row_headers
Example #11
0
 def __init__(self, display_plugins):
     QAbstractTableModel.__init__(self)
     self.display_plugins = display_plugins
     self.headers = map(unicode, [
         _('Plugin Name'),
         _('Donate'),
         _('Status'),
         _('Installed'),
         _('Available'),
         _('Released'),
         _('Calibre'),
         _('Author')
     ])
Example #12
0
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         try:
             return self.COLUMN_HEADERS[section]
         except IndexError:
             pass
     return QAbstractTableModel.headerData(self, section, orientation, role)
Example #13
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)
Example #14
0
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         try:
             return self.COLUMN_HEADERS[section]
         except IndexError:
             pass
     return QAbstractTableModel.headerData(self, section, orientation, role)
    def __init__(self, parent=None, columns_to_center=[], *args):
        """
        datain: a list of lists
        headerdata: a list of strings
        """
        QAbstractTableModel.__init__(self, parent, *args)
        self.arraydata = parent.tabledata
        self.centered_columns = columns_to_center
        self.headerdata = parent.annotations_header
        self.show_confidence_colors = parent.show_confidence_colors

        self.AUTHOR_COL = parent.AUTHOR_COL
        self.CONFIDENCE_COL = parent.CONFIDENCE_COL
        self.ENABLED_COL = parent.ENABLED_COL
        self.LAST_ANNOTATION_COL = parent.LAST_ANNOTATION_COL
        self.READER_APP_COL = parent.READER_APP_COL
        self.TITLE_COL = parent.TITLE_COL
    def __init__(self, parent=None, columns_to_center=[], *args):
        """
        datain: a list of lists
        headerdata: a list of strings
        """
        QAbstractTableModel.__init__(self, parent, *args)
        self.arraydata = parent.tabledata
        self.centered_columns = columns_to_center
        self.headerdata = parent.annotations_header
        self.show_confidence_colors = parent.show_confidence_colors

        self.AUTHOR_COL = parent.AUTHOR_COL
        self.CONFIDENCE_COL = parent.CONFIDENCE_COL
        self.ENABLED_COL = parent.ENABLED_COL
        self.LAST_ANNOTATION_COL = parent.LAST_ANNOTATION_COL
        self.READER_APP_COL = parent.READER_APP_COL
        self.TITLE_COL = parent.TITLE_COL
Example #17
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', 'language'  # some plugins use language instead of languages
        ])
Example #18
0
File: jobs.py Project: kba/calibre
    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=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)
Example #19
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=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)
Example #20
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', 'language'  # some plugins use language instead of languages
        ])
Example #21
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(unicode, [_('Email'), _('Formats'), _('Subject'),
         _('Auto send'), _('Alias')])
     self.default_font = QFont()
     self.default_font.setBold(True)
     self.default_font = (self.default_font)
     self.tooltips =[None] + list(map(unicode, 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')
          ])))
Example #22
0
 def __init__(self, parent=None):
     self.files = self.sort_keys = ()
     self.total_size = 0
     QAbstractTableModel.__init__(self, parent)
Example #23
0
 def __init__(self, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.items = []
     self.font_data = {}
     self.sorted_on = ('name', True)
Example #24
0
 def __init__(self, parent=None):
     self.files = self.sort_keys = ()
     self.total_size = 0
     QAbstractTableModel.__init__(self, parent)
 def __init__(self, data, func=lambda x: x.name):
     QAbstractTableModel.__init__(self, None)
     self.table_values = data
     self.horizontalHeaderOfTable = ['№', 'Name', 'Club', 'Goals']
     self.func = func
     self.players = sorted(self.table_values, key=self.func, reverse=True)
Example #26
0
 def __init__(self, parent, books = [], db = None):
     QAbstractTableModel.__init__(self, parent)
     self.db = db
     self.books = self.makeMetadataFromParsedOpds(books)
     self.filterBooks()
Example #27
0
 def flags(self, index):
     col = index.column()
     ans = QAbstractTableModel.flags(self, index)
     if col == 0:
         return ans | Qt.ItemIsUserCheckable
     return Qt.ItemIsEditable | ans
Example #28
0
 def flags(self, index):
     col = index.column()
     ans = QAbstractTableModel.flags(self, index)
     if col == 0:
         return ans | Qt.ItemIsUserCheckable
     return Qt.ItemIsEditable | ans
Example #29
0
 def __init__(self, results, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.results = results
     self.yes_icon = (QIcon(I('ok.png')))
Example #30
0
 def __init__(self, results, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.results = results
     self.yes_icon = (QIcon(I('ok.png')))
Example #31
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)
Example #32
0
 def flags(self, index):
     if index.column() == 3:
         return QAbstractTableModel.flags(self, index)|Qt.ItemIsUserCheckable
     else:
         return QAbstractTableModel.flags(self, index)|Qt.ItemIsEditable
Example #33
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')]))
Example #34
0
 def __init__(self, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.items = []
     self.font_data = {}
     self.sorted_on = ('name', True)