Commit 89c63718 authored by Scott Wheeler's avatar Scott Wheeler

Make it possible to turn off the splash screen.

svn path=/trunk/kdemultimedia/juk/; revision=216590
parent 250ee8cb
...@@ -48,12 +48,15 @@ ...@@ -48,12 +48,15 @@
JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name, WDestructiveClose), JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name, WDestructiveClose),
m_shuttingDown(false) m_shuttingDown(false)
{ {
SplashScreen::instance()->show();
kapp->processEvents();
// Expect segfaults if you change this order. // Expect segfaults if you change this order.
readSettings(); readSettings();
if(m_showSplash) {
SplashScreen::instance()->show();
kapp->processEvents();
}
setupLayout(); setupLayout();
setupActions(); setupActions();
slotPlaylistChanged(); slotPlaylistChanged();
...@@ -146,7 +149,8 @@ void JuK::setupActions() ...@@ -146,7 +149,8 @@ void JuK::setupActions()
new KToggleAction(i18n("Show Menu Bar"), "CTRL+m", this, SLOT(slotToggleMenuBar()), actionCollection(), "toggleMenuBar"); new KToggleAction(i18n("Show Menu Bar"), "CTRL+m", this, SLOT(slotToggleMenuBar()), actionCollection(), "toggleMenuBar");
new KToggleAction(i18n("Show Tool Bar"), "CTRL+b", this, SLOT(slotToggleToolBar()), actionCollection(), "toggleToolBar"); new KToggleAction(i18n("Show Tool Bar"), "CTRL+b", this, SLOT(slotToggleToolBar()), actionCollection(), "toggleToolBar");
m_restoreOnLoadAction = new KToggleAction(i18n("&Restore Playlists on Load"), 0, actionCollection(), "restoreOnLoad"); m_restoreOnLoadAction = new KToggleAction(i18n("&Restore Playlists on Load"), 0, actionCollection(), "restoreOnLoad");
m_toggleSplashAction = new KToggleAction(i18n("Show Splash Screen on Startup"), 0, actionCollection(), "showSplashScreen");
m_toggleSystemTrayAction = new KToggleAction(i18n("&Dock in System Tray"), KShortcut(), actionCollection(), "toggleSystemTray"); m_toggleSystemTrayAction = new KToggleAction(i18n("&Dock in System Tray"), KShortcut(), actionCollection(), "toggleSystemTray");
connect(m_toggleSystemTrayAction, SIGNAL(toggled(bool)), this, SLOT(slotToggleSystemTray(bool))); connect(m_toggleSystemTrayAction, SIGNAL(toggled(bool)), this, SLOT(slotToggleSystemTray(bool)));
...@@ -281,6 +285,7 @@ void JuK::readSettings() ...@@ -281,6 +285,7 @@ void JuK::readSettings()
{ // general settings { // general settings
KConfigGroupSaver saver(config, "Settings"); KConfigGroupSaver saver(config, "Settings");
m_restore = config->readBoolEntry("RestoreOnLoad", true); m_restore = config->readBoolEntry("RestoreOnLoad", true);
m_showSplash = config->readBoolEntry("ShowSplashScreen", true);
} }
} }
...@@ -290,7 +295,7 @@ void JuK::readConfig() ...@@ -290,7 +295,7 @@ void JuK::readConfig()
setAutoSaveSettings(); setAutoSaveSettings();
KConfig *config = KGlobal::config(); KConfig *config = KGlobal::config();
{ // m_player settings { // player settings
KConfigGroupSaver saver(config, "Player"); KConfigGroupSaver saver(config, "Player");
if(m_sliderAction->getVolumeSlider()) { if(m_sliderAction->getVolumeSlider()) {
int volume = config->readNumEntry("Volume", m_sliderAction->getVolumeSlider()->maxValue()); int volume = config->readNumEntry("Volume", m_sliderAction->getVolumeSlider()->maxValue());
...@@ -298,8 +303,9 @@ void JuK::readConfig() ...@@ -298,8 +303,9 @@ void JuK::readConfig()
} }
bool randomPlay = config->readBoolEntry("RandomPlay", false); bool randomPlay = config->readBoolEntry("RandomPlay", false);
m_randomPlayAction->setChecked(randomPlay); m_randomPlayAction->setChecked(randomPlay);
const bool loopPlaylist = config->readBoolEntry("LoopPlaylist", false);
m_loopPlaylistAction->setChecked(loopPlaylist); bool loopPlaylist = config->readBoolEntry("LoopPlaylist", false);
m_loopPlaylistAction->setChecked(loopPlaylist);
} }
{ // view settings { // view settings
KConfigGroupSaver saver(config, "View"); KConfigGroupSaver saver(config, "View");
...@@ -321,11 +327,10 @@ void JuK::readConfig() ...@@ -321,11 +327,10 @@ void JuK::readConfig()
if(m_outputSelectAction) if(m_outputSelectAction)
m_outputSelectAction->setCurrentItem(config->readNumEntry("MediaSystem", 0)); m_outputSelectAction->setCurrentItem(config->readNumEntry("MediaSystem", 0));
} }
m_restoreOnLoadAction->setChecked(m_restore); m_restoreOnLoadAction->setChecked(m_restore);
m_toggleSplashAction->setChecked(m_showSplash);
} }
void JuK::saveConfig() void JuK::saveConfig()
...@@ -337,8 +342,8 @@ void JuK::saveConfig() ...@@ -337,8 +342,8 @@ void JuK::saveConfig()
config->writeEntry("Volume", m_sliderAction->getVolumeSlider()->value()); config->writeEntry("Volume", m_sliderAction->getVolumeSlider()->value());
if(m_randomPlayAction) if(m_randomPlayAction)
config->writeEntry("RandomPlay", m_randomPlayAction->isChecked()); config->writeEntry("RandomPlay", m_randomPlayAction->isChecked());
if(m_loopPlaylistAction) if(m_loopPlaylistAction)
config->writeEntry("LoopPlaylist", m_loopPlaylistAction->isChecked()); config->writeEntry("LoopPlaylist", m_loopPlaylistAction->isChecked());
} }
{ // view settings { // view settings
KConfigGroupSaver saver(config, "View"); KConfigGroupSaver saver(config, "View");
...@@ -347,13 +352,14 @@ void JuK::saveConfig() ...@@ -347,13 +352,14 @@ void JuK::saveConfig()
{ // general settings { // general settings
KConfigGroupSaver saver(config, "Settings"); KConfigGroupSaver saver(config, "Settings");
config->writeEntry("RestoreOnLoad", m_restoreOnLoadAction->isChecked()); config->writeEntry("RestoreOnLoad", m_restoreOnLoadAction->isChecked());
config->writeEntry("ShowSplashScreen", m_toggleSplashAction->isChecked());
config->writeEntry("DockInSystemTray", m_toggleSystemTrayAction->isChecked()); config->writeEntry("DockInSystemTray", m_toggleSystemTrayAction->isChecked());
config->writeEntry("DockOnClose", m_toggleDockOnCloseAction->isChecked()); config->writeEntry("DockOnClose", m_toggleDockOnCloseAction->isChecked());
config->writeEntry("TrackPopup", m_togglePopupsAction->isChecked()); config->writeEntry("TrackPopup", m_togglePopupsAction->isChecked());
if(m_outputSelectAction) if(m_outputSelectAction)
config->writeEntry("MediaSystem", m_outputSelectAction->currentItem()); config->writeEntry("MediaSystem", m_outputSelectAction->currentItem());
} }
config->sync(); config->sync();
} }
bool JuK::queryExit() bool JuK::queryExit()
......
...@@ -154,6 +154,7 @@ private: ...@@ -154,6 +154,7 @@ private:
KToggleAction *m_toggleSystemTrayAction; KToggleAction *m_toggleSystemTrayAction;
KToggleAction *m_toggleDockOnCloseAction; KToggleAction *m_toggleDockOnCloseAction;
KToggleAction *m_togglePopupsAction; KToggleAction *m_togglePopupsAction;
KToggleAction *m_toggleSplashAction;
KSelectAction *m_outputSelectAction; KSelectAction *m_outputSelectAction;
KAction *m_playAction; KAction *m_playAction;
...@@ -175,6 +176,7 @@ private: ...@@ -175,6 +176,7 @@ private:
bool m_trackPositionDragging; bool m_trackPositionDragging;
bool m_noSeek; bool m_noSeek;
bool m_restore; bool m_restore;
bool m_showSplash;
bool m_shuttingDown; bool m_shuttingDown;
bool m_volmute; bool m_volmute;
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<Menu name="settings"><text>&amp;Settings</text> <Menu name="settings"><text>&amp;Settings</text>
<!-- <Action name="showGenreListEditor"/> --> <!-- <Action name="showGenreListEditor"/> -->
<Action name="restoreOnLoad"/> <Action name="restoreOnLoad"/>
<Action name="showSplashScreen"/>
<Action name="toggleSystemTray"/> <Action name="toggleSystemTray"/>
<Action name="dockOnClose"/> <Action name="dockOnClose"/>
<Action name="togglePopups"/> <Action name="togglePopups"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment