Example #1
0
    def __init__(self, prefs, fm, pref_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fm = fm
        self.pref_name = pref_name
        if pref_name == 'column_color_rules':
            self.rule_kind = 'color'
            rules = list(prefs[pref_name])
            self.rules = []
            for col, template in rules:
                if col not in self.fm and col != color_row_key:
                    continue
                try:
                    rule = rule_from_template(self.fm, template)
                except:
                    rule = template
                self.rules.append(('color', col, rule))
        else:
            self.rule_kind = 'icon' if pref_name == 'column_icon_rules' else 'emblem'
            rules = list(prefs[pref_name])
            self.rules = []
            for kind, col, template in rules:
                if col not in self.fm and col != color_row_key:
                    continue
                try:
                    rule = rule_from_template(self.fm, template)
                except:
                    rule = template
                self.rules.append((kind, col, rule))
Example #2
0
    def __init__(self, db, parent=None, pref_name=None):
        self.pref_name = pref_name or 'book_display_fields'
        QAbstractListModel.__init__(self, parent)

        self.fields = []
        self.db = db
        self.changed = False
Example #3
0
    def __init__(self, prefs, fm, pref_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fm = fm
        self.pref_name = pref_name
        if pref_name == 'column_color_rules':
            self.rule_kind = 'color'
            rules = list(prefs[pref_name])
            self.rules = []
            for col, template in rules:
                if col not in self.fm and col != color_row_key:
                    continue
                try:
                    rule = rule_from_template(self.fm, template)
                except:
                    rule = template
                self.rules.append(('color', col, rule))
        else:
            self.rule_kind = 'icon' if pref_name == 'column_icon_rules' else 'emblem'
            rules = list(prefs[pref_name])
            self.rules = []
            for kind, col, template in rules:
                if col not in self.fm and col != color_row_key:
                    continue
                try:
                    rule = rule_from_template(self.fm, template)
                except:
                    rule = template
                self.rules.append((kind, col, rule))
Example #4
0
    def __init__(self, db, parent=None, pref_name=None):
        self.pref_name = pref_name or 'book_display_fields'
        QAbstractListModel.__init__(self, parent)

        self.fields = []
        self.db = db
        self.changed = False
Example #5
0
    def __init__(self, current_cover, parent=None):
        QAbstractListModel.__init__(self, parent)

        if current_cover is None:
            current_cover = QPixmap(I('default_cover.png'))

        self.blank = QPixmap(I('blank.png')).scaled(150, 200)
        self.cc = current_cover
        self.reset_covers(do_reset=False)
Example #6
0
 def __init__(self,
              parent=None,
              sort_func=sort_key,
              strip_completion_entries=True):
     QAbstractListModel.__init__(self, parent)
     self.strip_completion_entries = strip_completion_entries
     self.sort_func = sort_func
     self.all_items = self.current_items = ()
     self.current_prefix = ''
Example #7
0
    def __init__(self, current_cover, parent=None):
        QAbstractListModel.__init__(self, parent)

        if current_cover is None:
            current_cover = QPixmap(I("default_cover.png"))

        self.blank = QPixmap(I("blank.png")).scaled(150, 200)
        self.cc = current_cover
        self.reset_covers(do_reset=False)
Example #8
0
    def __init__(self, current_cover, parent=None):
        QAbstractListModel.__init__(self, parent)

        if current_cover is None:
            current_cover = QPixmap(I('default_cover.png'))
        current_cover.setDevicePixelRatio(QApplication.instance().devicePixelRatio())

        self.blank = QIcon(I('blank.png')).pixmap(*CoverDelegate.ICON_SIZE)
        self.cc = current_cover
        self.reset_covers(do_reset=False)
Example #9
0
    def __init__(self, current_cover, parent=None):
        QAbstractListModel.__init__(self, parent)

        if current_cover is None:
            current_cover = QPixmap(I('default_cover.png'))
        current_cover.setDevicePixelRatio(QApplication.instance().devicePixelRatio())

        self.blank = QIcon(I('blank.png')).pixmap(*CoverDelegate.ICON_SIZE)
        self.cc = current_cover
        self.reset_covers(do_reset=False)
Example #10
0
    def __init__(self, shortcuts, config_file_base_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.descriptions = {}
        for k, v in shortcuts.items():
            self.descriptions[k] = v[-1]
        self.keys = {}
        for k, v in shortcuts.items():
            self.keys[k] = v[0]
        self.order = list(shortcuts)
        self.order.sort(key=lambda x: sort_key(self.descriptions[x]))
        self.sequences = {}
        for k, v in self.keys.items():
            self.sequences[k] = [QKeySequence(x) for x in v]

        self.custom = XMLConfig(config_file_base_name)
Example #11
0
    def __init__(self, shortcuts, config_file_base_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.descriptions = {}
        for k, v in shortcuts.items():
            self.descriptions[k] = v[-1]
        self.keys = {}
        for k, v in shortcuts.items():
            self.keys[k] = v[0]
        self.order = list(shortcuts)
        self.order.sort(key=lambda x: sort_key(self.descriptions[x]))
        self.sequences = {}
        for k, v in self.keys.items():
            self.sequences[k] = [QKeySequence(x) for x in v]

        self.custom = XMLConfig(config_file_base_name)
Example #12
0
    def __init__(self, prefs, fm, pref_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fm = fm
        self.pref_name = pref_name
        if pref_name == 'column_color_rules':
            self.rule_kind = 'color'
            rules = list(prefs[pref_name])
            self.rules = []
            for col, template in rules:
                rule = self.load_rule(col, template)
                if rule is not None:
                    self.rules.append(('color', col, rule))
        else:
            self.rule_kind = 'icon' if pref_name == 'column_icon_rules' else 'emblem'
            rules = list(prefs[pref_name])
            self.rules = []
            for kind, col, template in rules:
                rule = self.load_rule(col, template)
                if rule is not None:
                    self.rules.append((kind, col, rule))
Example #13
0
    def __init__(self, prefs, fm, pref_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fm = fm
        self.pref_name = pref_name
        if pref_name == 'column_color_rules':
            self.rule_kind = 'color'
            rules = list(prefs[pref_name])
            self.rules = []
            for col, template in rules:
                rule = self.load_rule(col, template)
                if rule is not None:
                    self.rules.append(('color', col, rule))
        else:
            self.rule_kind = 'icon' if pref_name == 'column_icon_rules' else 'emblem'
            rules = list(prefs[pref_name])
            self.rules = []
            for kind, col, template in rules:
                rule = self.load_rule(col, template)
                if rule is not None:
                    self.rules.append((kind, col, rule))
Example #14
0
    def __init__(self, parent: QWidget = None):
        QAbstractListModel.__init__(self, parent)

        self.image_names: List[Path] = []
        self.processed_images_count: int = 0
        self.camera: Optional[Camera] = None
        self.snow_level1 = QPixmap(':/icons/snowflake.svg')
        self.snow_level1 = self.snow_level1.scaledToWidth(24)
        self.snow_level2 = QPixmap()
        self.snow_level3 = QPixmap()
        self.sun = QIcon(':/icons/sun.svg')
        self.moon = QIcon(':/icons/moon.svg')
        self.quality_colors = {
            'BAD': QColor(200, 0, 0),
            'OK': QColor(200, 100, 0),
            'GOOD': QColor(100, 200, 0),
        }
        self._generate_snow_level_icons()
        self.thumbnails = ThumbnailStorage()
        self.thumbnails.thumbnails_loaded.connect(
            self.handle_thumbnails_loaded)
        self.dragging = False
Example #15
0
 def __init__(self, recipe_model):
     QAbstractListModel.__init__(self)
     self.recipe_model = recipe_model
Example #16
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     SearchQueryParser.__init__(self, ['all'])
     self.parse_tweaks()
Example #17
0
 def __init__(self, db, parent=None):
     self.keys = sorted(db, key=lambda x: x.lower())
     QAbstractListModel.__init__(self, parent)
Example #18
0
 def __init__(self, widgets):
     self.widgets = widgets
     QAbstractListModel.__init__(self)
Example #19
0
 def __init__(self, parent, items, display_name_map=None):
     QAbstractListModel.__init__(self, parent)
     self._items = items
     self._display_name_map = display_name_map or {}
Example #20
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.chars = []
     self.allow_dnd = False
Example #21
0
 def __init__(self, parent=None, is_half_star=False):
     QAbstractListModel.__init__(self, parent)
     self.is_half_star = is_half_star
     self.rating_font = QFont(rating_font())
     self.null_text = _("Not rated")
Example #22
0
 def __init__(self, manufacturer):
     QAbstractListModel.__init__(self)
     self.devices = get_devices_of(manufacturer)
Example #23
0
    def __init__(self, parent=None):
        QAbstractListModel.__init__(self, parent)
        SearchQueryParser.__init__(self, ['all'])
        raw_defaults, raw_custom = read_raw_tweaks()

        self.parse_tweaks(raw_defaults, raw_custom)
Example #24
0
 def __init__(self, parent=None, sort_func=sort_key):
     QAbstractListModel.__init__(self, parent)
     self.sort_func = sort_func
     self.all_items = self.current_items = ()
     self.current_prefix = ''
Example #25
0
 def __init__(self, fmt_count):
     QAbstractListModel.__init__(self)
     self.fmts = sorted(set(fmt_count))
     self.counts = fmt_count
     self.fi = file_icon_provider()
Example #26
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     SearchQueryParser.__init__(self, ['all'])
     self.parse_tweaks()
Example #27
0
 def __init__(self, db, parent=None):
     self.keys = sorted(db, key=lambda x: x.lower())
     QAbstractListModel.__init__(self, parent)
Example #28
0
 def __init__(self, parent):
     QAbstractListModel.__init__(self, parent)
     self.icon_size = parent.iconSize()
     self.build()
Example #29
0
 def __init__(self, parent):
     QAbstractListModel.__init__(self, parent)
     self.searches = tprefs['saved_searches']
     self.filtered_searches = list(xrange(len(self.searches)))
Example #30
0
 def __init__(self):
     QAbstractListModel.__init__(self)
     self.manufacturers = get_manufacturers()
Example #31
0
 def __init__(self, profiles):
     QAbstractListModel.__init__(self)
     self.profiles = list(profiles)
Example #32
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.states = []
     self.pos = 0
Example #33
0
 def __init__(self):
     QAbstractListModel.__init__(self)
     self.manufacturers = get_manufacturers()
Example #34
0
 def __init__(self, fmt_count):
     QAbstractListModel.__init__(self)
     self.fmts = sorted(set(fmt_count))
     self.counts = fmt_count
     self.fi = file_icon_provider()
Example #35
0
    def __init__(self, db, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fields = []
        self.db = db
        self.changed = False
Example #36
0
 def __init__(self, names, parent=None):
     self.items = []
     QAbstractListModel.__init__(self, parent)
     self.set_names(names)
Example #37
0
 def __init__(self, parent):
     QAbstractListModel.__init__(self, parent)
     self.searches = tprefs['saved_searches']
     self.filtered_searches = list(xrange(len(self.searches)))
Example #38
0
    def __init__(self, parent=None):
        QAbstractListModel.__init__(self, parent)
        SearchQueryParser.__init__(self, ['all'])
        raw_defaults, raw_custom = read_raw_tweaks()

        self.parse_tweaks(raw_defaults, raw_custom)
Example #39
0
 def __init__(self, manufacturer):
     QAbstractListModel.__init__(self)
     self.devices = get_devices_of(manufacturer)
Example #40
0
 def __init__(self, profiles):
     QAbstractListModel.__init__(self)
     self.profiles = list(profiles)
Example #41
0
    def __init__(self, db, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fields = []
        self.db = db
        self.changed = False
Example #42
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.states = []
     self.pos = 0
 def __init__(self, recipe_model):
     QAbstractListModel.__init__(self)
     self.recipe_model = recipe_model
Example #44
0
 def __init__(self, parent=None, sort_func=sort_key):
     QAbstractListModel.__init__(self, parent)
     self.sort_func = sort_func
     self.all_items = self.current_items = ()
     self.current_prefix = ''
Example #45
0
 def __init__(self, names, parent=None):
     self.items = []
     self.names = []
     QAbstractListModel.__init__(self, parent=parent)
Example #46
0
File: ask.py Project: alok/vise
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.items = []
Example #47
0
 def __init__(self, widgets):
     self.widgets = widgets
     QAbstractListModel.__init__(self)
Example #48
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.chars = []
     self.allow_dnd = False
Example #49
0
 def __init__(self, parent=None, is_half_star=False):
     QAbstractListModel.__init__(self, parent)
     self.is_half_star = is_half_star
     self.rating_font = QFont(rating_font())
     self.null_text = _('Not rated')
Example #50
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.items = []