mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add option to disable splash screen
This commit is contained in:
parent
4a046a41d0
commit
edc4b10817
@ -14,7 +14,7 @@ from PyQt4.Qt import QDialog, QListWidgetItem, QIcon, \
|
|||||||
from calibre.constants import iswindows, isosx
|
from calibre.constants import iswindows, isosx
|
||||||
from calibre.gui2.dialogs.config.config_ui import Ui_Dialog
|
from calibre.gui2.dialogs.config.config_ui import Ui_Dialog
|
||||||
from calibre.gui2.dialogs.config.create_custom_column import CreateCustomColumn
|
from calibre.gui2.dialogs.config.create_custom_column import CreateCustomColumn
|
||||||
from calibre.gui2 import choose_dir, error_dialog, config, \
|
from calibre.gui2 import choose_dir, error_dialog, config, gprefs, \
|
||||||
ALL_COLUMNS, NONE, info_dialog, choose_files, \
|
ALL_COLUMNS, NONE, info_dialog, choose_files, \
|
||||||
warning_dialog, ResizableDialog, question_dialog
|
warning_dialog, ResizableDialog, question_dialog
|
||||||
from calibre.utils.config import prefs
|
from calibre.utils.config import prefs
|
||||||
@ -480,6 +480,8 @@ class ConfigDialog(ResizableDialog, Ui_Dialog):
|
|||||||
self.opt_enforce_cpu_limit.setChecked(config['enforce_cpu_limit'])
|
self.opt_enforce_cpu_limit.setChecked(config['enforce_cpu_limit'])
|
||||||
self.device_detection_button.clicked.connect(self.debug_device_detection)
|
self.device_detection_button.clicked.connect(self.debug_device_detection)
|
||||||
self.port.editingFinished.connect(self.check_port_value)
|
self.port.editingFinished.connect(self.check_port_value)
|
||||||
|
self.show_splash_screen.setChecked(gprefs.get('show_splash_screen',
|
||||||
|
True))
|
||||||
|
|
||||||
def check_port_value(self, *args):
|
def check_port_value(self, *args):
|
||||||
port = self.port.value()
|
port = self.port.value()
|
||||||
@ -852,6 +854,7 @@ class ConfigDialog(ResizableDialog, Ui_Dialog):
|
|||||||
config['get_social_metadata'] = self.opt_get_social_metadata.isChecked()
|
config['get_social_metadata'] = self.opt_get_social_metadata.isChecked()
|
||||||
config['overwrite_author_title_metadata'] = self.opt_overwrite_author_title_metadata.isChecked()
|
config['overwrite_author_title_metadata'] = self.opt_overwrite_author_title_metadata.isChecked()
|
||||||
config['enforce_cpu_limit'] = bool(self.opt_enforce_cpu_limit.isChecked())
|
config['enforce_cpu_limit'] = bool(self.opt_enforce_cpu_limit.isChecked())
|
||||||
|
gprefs['show_splash_screen'] = bool(self.show_splash_screen.isChecked())
|
||||||
fmts = []
|
fmts = []
|
||||||
for i in range(self.viewer.count()):
|
for i in range(self.viewer.count()):
|
||||||
if self.viewer.item(i).checkState() == Qt.Checked:
|
if self.viewer.item(i).checkState() == Qt.Checked:
|
||||||
|
@ -331,8 +331,8 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page">
|
<widget class="QWidget" name="page">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QGridLayout" name="gridLayout_8">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="roman_numerals">
|
<widget class="QCheckBox" name="roman_numerals">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use &Roman numerals for series number</string>
|
<string>Use &Roman numerals for series number</string>
|
||||||
@ -342,28 +342,35 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="systray_icon">
|
<widget class="QCheckBox" name="systray_icon">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enable system &tray icon (needs restart)</string>
|
<string>Enable system &tray icon (needs restart)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<widget class="QCheckBox" name="systray_notifications">
|
<widget class="QCheckBox" name="systray_notifications">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show &notifications in system tray</string>
|
<string>Show &notifications in system tray</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="show_splash_screen">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show &splash screen at startup</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="separate_cover_flow">
|
<widget class="QCheckBox" name="separate_cover_flow">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show cover &browser in a separate window (needs restart)</string>
|
<string>Show cover &browser in a separate window (needs restart)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="search_as_you_type">
|
<widget class="QCheckBox" name="search_as_you_type">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Search as you type</string>
|
<string>Search as you type</string>
|
||||||
@ -373,21 +380,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="sync_news">
|
<widget class="QCheckBox" name="sync_news">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Automatically send downloaded &news to ebook reader</string>
|
<string>Automatically send downloaded &news to ebook reader</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="delete_news">
|
<widget class="QCheckBox" name="delete_news">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Delete news from library when it is automatically sent to reader</string>
|
<string>&Delete news from library when it is automatically sent to reader</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="7" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
@ -404,7 +411,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="8" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Toolbar</string>
|
<string>Toolbar</string>
|
||||||
@ -452,7 +459,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="9" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@ -527,12 +534,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="add_custcol_button">
|
<widget class="QToolButton" name="add_custcol_button">
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Add a user-defined column</string>
|
<string>Add a user-defined column</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../../../resources/images.qrc">
|
<iconset resource="../../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/plus.svg</normaloff>:/images/plus.svg</iconset>
|
<normaloff>:/images/plus.svg</normaloff>:/images/plus.svg</iconset>
|
||||||
|
@ -9,7 +9,8 @@ from PyQt4.Qt import QCoreApplication, QIcon, QMessageBox, QObject, QTimer, \
|
|||||||
QSplashScreen, QApplication
|
QSplashScreen, QApplication
|
||||||
|
|
||||||
from calibre import prints, plugins
|
from calibre import prints, plugins
|
||||||
from calibre.constants import iswindows, __appname__, isosx, filesystem_encoding
|
from calibre.constants import iswindows, __appname__, isosx, DEBUG, \
|
||||||
|
filesystem_encoding
|
||||||
from calibre.utils.ipc import ADDRESS, RC
|
from calibre.utils.ipc import ADDRESS, RC
|
||||||
from calibre.gui2 import ORG_NAME, APP_UID, initialize_file_icon_provider, \
|
from calibre.gui2 import ORG_NAME, APP_UID, initialize_file_icon_provider, \
|
||||||
Application, choose_dir, error_dialog, question_dialog, gprefs
|
Application, choose_dir, error_dialog, question_dialog, gprefs
|
||||||
@ -114,12 +115,15 @@ class GuiRunner(QObject):
|
|||||||
initialization'''
|
initialization'''
|
||||||
|
|
||||||
def __init__(self, opts, args, actions, listener, app):
|
def __init__(self, opts, args, actions, listener, app):
|
||||||
|
self.startup_time = time.time()
|
||||||
self.opts, self.args, self.listener, self.app = opts, args, listener, app
|
self.opts, self.args, self.listener, self.app = opts, args, listener, app
|
||||||
self.actions = actions
|
self.actions = actions
|
||||||
self.main = None
|
self.main = None
|
||||||
QObject.__init__(self)
|
QObject.__init__(self)
|
||||||
self.splash_screen = None
|
self.splash_screen = None
|
||||||
self.timer = QTimer.singleShot(1, self.initialize)
|
self.timer = QTimer.singleShot(1, self.initialize)
|
||||||
|
if DEBUG:
|
||||||
|
prints('Starting up...')
|
||||||
|
|
||||||
def start_gui(self):
|
def start_gui(self):
|
||||||
from calibre.gui2.ui import Main
|
from calibre.gui2.ui import Main
|
||||||
@ -128,6 +132,8 @@ class GuiRunner(QObject):
|
|||||||
self.splash_screen.showMessage(_('Initializing user interface...'))
|
self.splash_screen.showMessage(_('Initializing user interface...'))
|
||||||
self.splash_screen.finish(main)
|
self.splash_screen.finish(main)
|
||||||
main.initialize(self.library_path, self.db, self.listener, self.actions)
|
main.initialize(self.library_path, self.db, self.listener, self.actions)
|
||||||
|
if DEBUG:
|
||||||
|
prints('Started up in', time.time() - self.startup_time)
|
||||||
add_filesystem_book = partial(main.add_filesystem_book, allow_device=False)
|
add_filesystem_book = partial(main.add_filesystem_book, allow_device=False)
|
||||||
sys.excepthook = main.unhandled_exception
|
sys.excepthook = main.unhandled_exception
|
||||||
if len(self.args) > 1:
|
if len(self.args) > 1:
|
||||||
@ -230,7 +236,6 @@ class GuiRunner(QObject):
|
|||||||
if gprefs.get('show_splash_screen', True):
|
if gprefs.get('show_splash_screen', True):
|
||||||
self.show_splash_screen()
|
self.show_splash_screen()
|
||||||
|
|
||||||
time.sleep(10)
|
|
||||||
self.library_path = get_library_path()
|
self.library_path = get_library_path()
|
||||||
if self.library_path is None:
|
if self.library_path is None:
|
||||||
self.initialization_failed()
|
self.initialization_failed()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user