mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Hook to create icon themes from Preferences->Misc
This commit is contained in:
parent
26deb88793
commit
7e8b0cafc6
@ -28,6 +28,8 @@ IMAGE_EXTENSIONS = {'png', 'jpg', 'jpeg'}
|
|||||||
THEME_COVER = 'icon-theme-cover.jpg'
|
THEME_COVER = 'icon-theme-cover.jpg'
|
||||||
THEME_METADATA = 'metadata.json'
|
THEME_METADATA = 'metadata.json'
|
||||||
|
|
||||||
|
# Theme creation {{{
|
||||||
|
|
||||||
def render_svg(filepath):
|
def render_svg(filepath):
|
||||||
must_use_qt(headless=False)
|
must_use_qt(headless=False)
|
||||||
pngpath = filepath[:-4] + '.png'
|
pngpath = filepath[:-4] + '.png'
|
||||||
@ -304,6 +306,8 @@ def create_theme(folder=None, parent=None):
|
|||||||
with open(dest, 'wb') as f:
|
with open(dest, 'wb') as f:
|
||||||
f.write(raw)
|
f.write(raw)
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
app = Application([])
|
app = Application([])
|
||||||
|
@ -36,6 +36,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
' conversion. Lower this number'
|
' conversion. Lower this number'
|
||||||
' if you want calibre to use less CPU.')))
|
' if you want calibre to use less CPU.')))
|
||||||
self.device_detection_button.clicked.connect(self.debug_device_detection)
|
self.device_detection_button.clicked.connect(self.debug_device_detection)
|
||||||
|
self.icon_theme_button.clicked.connect(self.create_icon_theme)
|
||||||
self.button_open_config_dir.clicked.connect(self.open_config_dir)
|
self.button_open_config_dir.clicked.connect(self.open_config_dir)
|
||||||
self.user_defined_device_button.clicked.connect(self.user_defined_device)
|
self.user_defined_device_button.clicked.connect(self.user_defined_device)
|
||||||
proxies = get_proxies(debug=False)
|
proxies = get_proxies(debug=False)
|
||||||
@ -46,6 +47,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
txt = _('<b>Using proxies:</b>') + ''.join(lines)
|
txt = _('<b>Using proxies:</b>') + ''.join(lines)
|
||||||
self.proxies.setText(txt)
|
self.proxies.setText(txt)
|
||||||
|
|
||||||
|
def create_icon_theme(self):
|
||||||
|
from calibre.gui2.icon_theme import create_theme
|
||||||
|
create_theme(parent=self)
|
||||||
|
|
||||||
def debug_device_detection(self, *args):
|
def debug_device_detection(self, *args):
|
||||||
from calibre.gui2.preferences.device_debug import DebugDevice
|
from calibre.gui2.preferences.device_debug import DebugDevice
|
||||||
d = DebugDevice(self.gui, self)
|
d = DebugDevice(self.gui, self)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Max. simultaneous conversion/news download/plugin jobs:</string>
|
<string>Max. simultaneous conversion/&news download/plugin jobs:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>opt_worker_limit</cstring>
|
<cstring>opt_worker_limit</cstring>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="10" column="0">
|
||||||
<spacer name="verticalSpacer_8">
|
<spacer name="verticalSpacer_8">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -104,14 +104,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="9" column="0" colspan="2">
|
||||||
<widget class="QPushButton" name="button_open_config_dir">
|
<widget class="QPushButton" name="button_open_config_dir">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open calibre &configuration directory</string>
|
<string>Open calibre &configuration directory</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="21" column="0">
|
<item row="22" column="0">
|
||||||
<spacer name="verticalSpacer_9">
|
<spacer name="verticalSpacer_9">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -124,7 +124,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0" colspan="2">
|
<item row="11" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="proxies">
|
<widget class="QLabel" name="proxies">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@ -134,7 +134,7 @@
|
|||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Abort jobs that take more than:</string>
|
<string>Abort &jobs that take more than:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>opt_worker_max_time</cstring>
|
<cstring>opt_worker_max_time</cstring>
|
||||||
@ -157,6 +157,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" column="0" colspan="2">
|
||||||
|
<widget class="QPushButton" name="icon_theme_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>Create a calibre &icon theme</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user