mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add colors icon to preferences dialog. Correctly clean template values when the column is set to empty.
This commit is contained in:
parent
6d19e4279f
commit
478369c7cb
@ -194,7 +194,8 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
choices = db.field_metadata.displayable_field_keys()
|
choices = db.field_metadata.displayable_field_keys()
|
||||||
choices.sort(key=sort_key)
|
choices.sort(key=sort_key)
|
||||||
choices.insert(0, '')
|
choices.insert(0, '')
|
||||||
for i in range(1, db.column_color_count+1):
|
self.column_color_count = db.column_color_count+1
|
||||||
|
for i in range(1, self.column_color_count):
|
||||||
r('column_color_name_'+str(i), db.prefs, choices=choices)
|
r('column_color_name_'+str(i), db.prefs, choices=choices)
|
||||||
r('column_color_template_'+str(i), db.prefs)
|
r('column_color_template_'+str(i), db.prefs)
|
||||||
all_colors = [unicode(s) for s in list(QColor.colorNames())]
|
all_colors = [unicode(s) for s in list(QColor.colorNames())]
|
||||||
@ -267,6 +268,11 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
self.changed_signal.emit()
|
self.changed_signal.emit()
|
||||||
|
|
||||||
def commit(self, *args):
|
def commit(self, *args):
|
||||||
|
for i in range(1, self.column_color_count):
|
||||||
|
col = getattr(self, 'opt_column_color_name_'+str(i))
|
||||||
|
if not col.currentText():
|
||||||
|
temp = getattr(self, 'opt_column_color_template_'+str(i))
|
||||||
|
temp.setText('')
|
||||||
rr = ConfigWidgetBase.commit(self, *args)
|
rr = ConfigWidgetBase.commit(self, *args)
|
||||||
if self.current_font != self.initial_font:
|
if self.current_font != self.initial_font:
|
||||||
gprefs['font'] = (self.current_font[:4] if self.current_font else
|
gprefs['font'] = (self.current_font[:4] if self.current_font else
|
||||||
|
@ -410,7 +410,7 @@ then the tags will be displayed each on their own line.</string>
|
|||||||
<widget class="QWidget" name="tab_5">
|
<widget class="QWidget" name="tab_5">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/cover_flow.png</normaloff>:/images/cover_flow.png</iconset>
|
<normaloff>:/images/format-fill-color.png</normaloff>:/images/format-fill-color.png</iconset>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Column Coloring</string>
|
<string>Column Coloring</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user