Git commit b0d8e7b75c822f2ffb55ddb5c63b20157bc88eb2 by Michael Pyne. Committed on 30/08/2017 at 02:58. Pushed by mpyne into branch 'frameworks'.
Remove splash screen. It has a long and proud history, but it's time to retire it... this type of UI element is now outmoded. M +0 -1 CMakeLists.txt M +0 -7 collectionlist.cpp M +3 -3 collectionlist.h M +0 -11 doc/index.docbook M +2 -17 juk.cpp M +0 -2 juk.h M +1 -2 jukui-rtl.rc M +1 -2 jukui.rc M +1 -1 pics/CMakeLists.txt D +- -- pics/splash.png D +0 -110 splashscreen.cpp D +0 -55 splashscreen.h https://commits.kde.org/juk/b0d8e7b75c822f2ffb55ddb5c63b20157bc88eb2 diff --git a/CMakeLists.txt b/CMakeLists.txt index d89b6d8..8f71d85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,6 @@ set(juk_SRCS ${tunepimp_SRCS} searchwidget.cpp slideraction.cpp sortedstringlist.cpp - splashscreen.cpp statuslabel.cpp stringshare.cpp systemtray.cpp diff --git a/collectionlist.cpp b/collectionlist.cpp index c146a32..6a56dd8 100644 --- a/collectionlist.cpp +++ b/collectionlist.cpp @@ -38,7 +38,6 @@ #include <QSaveFile> #include "playlistcollection.h" -#include "splashscreen.h" #include "stringshare.h" #include "cache.h" #include "actioncollection.h" @@ -100,8 +99,6 @@ void CollectionList::loadNextBatchCachedItems() } } - SplashScreen::update(); - if(!done) { QTimer::singleShot(0, this, SLOT(loadNextBatchCachedItems())); } @@ -122,8 +119,6 @@ void CollectionList::completedLoadingCachedItems() m_list->sortByColumn(config.readEntry("CollectionListSortColumn", 1), order); - SplashScreen::finishedLoading(); - qCDebug(JUK_LOG) << "Finished loading cached items, took" << stopwatch.elapsed() << "ms"; qCDebug(JUK_LOG) << m_itemsDict.size() << "items are in the CollectionList"; @@ -557,8 +552,6 @@ CollectionListItem::CollectionListItem(CollectionList *parent, const FileHandle else { qCCritical(JUK_LOG) << "CollectionListItem::CollectionListItem() -- Tag() could not be created."; } - - SplashScreen::increment(); } CollectionListItem::~CollectionListItem() diff --git a/collectionlist.h b/collectionlist.h index 69f91e3..a1622e5 100644 --- a/collectionlist.h +++ b/collectionlist.h @@ -14,8 +14,8 @@ * this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef COLLECTIONLIST_H -#define COLLECTIONLIST_H +#ifndef JUK_COLLECTIONLIST_H +#define JUK_COLLECTIONLIST_H #include <QHash> #include <QVector> @@ -193,7 +193,7 @@ public slots: void loadNextBatchCachedItems(); /** - * Teardown from cache loading (e.g. splash screen, sorting, etc.). Should + * Teardown from cache loading (e.g. a sort operation). Should * always be called if startLoadingCachedItems is called. */ void completedLoadingCachedItems(); diff --git a/doc/index.docbook b/doc/index.docbook index 3ff0751..4b8c137 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -1471,17 +1471,6 @@ Toolbar</link> and the <link linkend="play-toolbar">Play Toolbar</link>.</para> </listitem> </varlistentry> -<varlistentry> -<term><menuchoice> -<guimenu>Settings</guimenu> -<guimenuitem>Show Splash Screen on Startup</guimenuitem> -</menuchoice> -</term> -<listitem><para>This is a toggle option. If enabled, &juk; will display -an informational screen upon startup as it loads your music collection.</para> -</listitem> -</varlistentry> - <varlistentry> <term><menuchoice> <guimenu>Settings</guimenu> diff --git a/juk.cpp b/juk.cpp index 1dd6db6..d34bf96 100644 --- a/juk.cpp +++ b/juk.cpp @@ -42,7 +42,6 @@ #include "slideraction.h" #include "statuslabel.h" -#include "splashscreen.h" #include "systemtray.h" #include "keydialog.h" #include "tagguesserconfigdlg.h" @@ -79,8 +78,8 @@ JuK::JuK(const QStringList &filesToOpen, QWidget *parent) : m_systemTray(0), m_player(new PlayerManager), m_scrobbler(0), - m_shuttingDown(false), - m_filesToOpen(filesToOpen) + m_filesToOpen(filesToOpen), + m_shuttingDown(false) { // Expect segfaults if you change this order. @@ -90,13 +89,6 @@ JuK::JuK(const QStringList &filesToOpen, QWidget *parent) : Cache::ensureAppDataStorageExists(); - if(m_showSplash && !m_startDocked && Cache::cacheFileExists()) { - if(SplashScreen* splash = SplashScreen::instance()) { - splash->show(); - qApp->processEvents(); - } - } - setupActions(); setupLayout(); @@ -302,9 +294,6 @@ void JuK::setupActions() // settings menu ////////////////////////////////////////////////// - m_toggleSplashAction = collection->add<KToggleAction>("showSplashScreen"); - m_toggleSplashAction->setText(i18n("Show Splash Screen on Startup")); - m_toggleSystemTrayAction = collection->add<KToggleAction>("toggleSystemTray"); m_toggleSystemTrayAction->setText(i18n("&Dock in System Tray")); connect(m_toggleSystemTrayAction, SIGNAL(triggered(bool)), SLOT(slotToggleSystemTray(bool))); @@ -411,7 +400,6 @@ void JuK::keyPressEvent(QKeyEvent *e) void JuK::readSettings() { KConfigGroup config(KSharedConfig::openConfig(), "Settings"); - m_showSplash = config.readEntry("ShowSplashScreen", true); m_startDocked = config.readEntry("StartDocked", false); } @@ -457,8 +445,6 @@ void JuK::readConfig() bool showPopups = settingsConfig.readEntry("TrackPopup", false); m_togglePopupsAction->setChecked(showPopups); - - m_toggleSplashAction->setChecked(m_showSplash); } void JuK::saveConfig() @@ -491,7 +477,6 @@ void JuK::saveConfig() // general settings KConfigGroup settingsConfig(KSharedConfig::openConfig(), "Settings"); - settingsConfig.writeEntry("ShowSplashScreen", m_toggleSplashAction->isChecked()); settingsConfig.writeEntry("StartDocked", m_startDocked); settingsConfig.writeEntry("DockInSystemTray", m_toggleSystemTrayAction->isChecked()); settingsConfig.writeEntry("DockOnClose", m_toggleDockOnCloseAction->isChecked()); diff --git a/juk.h b/juk.h index 210749b..a13e36a 100644 --- a/juk.h +++ b/juk.h @@ -91,14 +91,12 @@ private: KToggleAction *m_toggleSystemTrayAction; KToggleAction *m_toggleDockOnCloseAction; KToggleAction *m_togglePopupsAction; - KToggleAction *m_toggleSplashAction; PlayerManager *m_player; Scrobbler *m_scrobbler; QStringList m_filesToOpen; bool m_startDocked; - bool m_showSplash; bool m_shuttingDown; static JuK* m_instance; diff --git a/jukui-rtl.rc b/jukui-rtl.rc index 77c3b89..38d7447 100644 --- a/jukui-rtl.rc +++ b/jukui-rtl.rc @@ -1,5 +1,5 @@ <!DOCTYPE kpartgui> -<kpartgui name="juk" version="12"> +<kpartgui name="juk" version="13"> <MenuBar> <Menu name="file" noMerge="1"><text>&File</text> <Action name="file_new"/> @@ -66,7 +66,6 @@ <Action name="renameFile"/> </Menu> <Menu name="settings"><text>&Settings</text> - <Action name="showSplashScreen" append="show_merge"/> <Action name="toggleSystemTray" append="show_merge"/> <Action name="dockOnClose" append="show_merge"/> <Action name="togglePopups" append="show_merge"/> diff --git a/jukui.rc b/jukui.rc index 4a14d45..4277d28 100644 --- a/jukui.rc +++ b/jukui.rc @@ -1,7 +1,7 @@ <!-- PLEASE UPDATE jukui-rtl.rc WHEN UPDATING THIS FILE --> <!DOCTYPE kpartgui> -<kpartgui name="juk" version="12"> +<kpartgui name="juk" version="13"> <MenuBar> <Menu name="file" noMerge="1"><text>&File</text> <Action name="file_new"/> @@ -68,7 +68,6 @@ <Action name="renameFile"/> </Menu> <Menu name="settings"><text>&Settings</text> - <Action name="showSplashScreen" append="show_merge"/> <Action name="toggleSystemTray" append="show_merge"/> <Action name="dockOnClose" append="show_merge"/> <Action name="togglePopups" append="show_merge"/> diff --git a/pics/CMakeLists.txt b/pics/CMakeLists.txt index 66a3587..11ff67c 100644 --- a/pics/CMakeLists.txt +++ b/pics/CMakeLists.txt @@ -1,3 +1,3 @@ -install( FILES theme.svg playing.png splash.png DESTINATION ${DATA_INSTALL_DIR}/juk/pics ) +install( FILES theme.svg playing.png DESTINATION ${DATA_INSTALL_DIR}/juk/pics ) diff --git a/pics/splash.png b/pics/splash.png deleted file mode 100644 index 3cbaca7..0000000 Binary files a/pics/splash.png and /dev/null differ diff --git a/splashscreen.cpp b/splashscreen.cpp deleted file mode 100644 index ca7b1bb..0000000 --- a/splashscreen.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (C) 2002-2004 Scott Wheeler <[email protected]> - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "splashscreen.h" -#include "juk_debug.h" - -#include <kiconloader.h> -#include <klocale.h> -#include <kstandarddirs.h> - -#include <QPixmap> -#include <QLabel> -#include <QPalette> - -SplashScreen *SplashScreen::splash = 0; -bool SplashScreen::done = false; -int SplashScreen::count = 0; - -static QString loadedText(int i) -{ - return i18nc("%1 is a count of loaded music tracks", "Loading: %1", i); -} - -//////////////////////////////////////////////////////////////////////////////// -// pubic members -//////////////////////////////////////////////////////////////////////////////// - -SplashScreen *SplashScreen::instance() -{ - if(!splash && !done) - splash = new SplashScreen(); - return splash; -} - -void SplashScreen::finishedLoading() -{ - done = true; - delete splash; - splash = 0; -} - -void SplashScreen::increment() -{ - if(splash) { - count++; - if(( count & 63 ) == 0) - splash->processEvents(); - } -} - -void SplashScreen::update() -{ - if(splash) - splash->processEvents(); -} - -//////////////////////////////////////////////////////////////////////////////// -// protected members -//////////////////////////////////////////////////////////////////////////////// - -SplashScreen::SplashScreen() : QLabel(0, Qt::SplashScreen) -{ - setObjectName( QLatin1String("splashScreen" )); - - QPixmap background = UserIcon("splash"); - resize(background.size()); - QPalette palette; - palette.setBrush(backgroundRole(), QBrush(background)); - - setMargin(7); - setAlignment(Qt::AlignLeft | Qt::AlignBottom); - - palette.setColor(foregroundRole(), QColor(107, 158, 194)); - setPalette(palette); - - QFont f = font(); - f.setPixelSize(10); - setFont(f); - - setText(loadedText(0)); -} - -SplashScreen::~SplashScreen() -{ - -} - -//////////////////////////////////////////////////////////////////////////////// -// private methods -//////////////////////////////////////////////////////////////////////////////// - -void SplashScreen::processEvents() -{ - setText(loadedText(count)); -} - -// vim: set et sw=4 tw=0 sta: diff --git a/splashscreen.h b/splashscreen.h deleted file mode 100644 index 5ef87e7..0000000 --- a/splashscreen.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2002-2004 Scott Wheeler <[email protected]> - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef SPLASHSCREEN_H -#define SPLASHSCREEN_H - -#include <QLabel> - -/** - * Well, all of this session restoration sure is fun, but it's starting to take - * a while, especially say, if you're building KDE and indexing your file system - * in the background. ;-) So, despite my general hate of splashscreens I - * thought on appropriate here. - * - * As in other places, this is a singleton. That makes it relatively easy to - * handle the updates from whichever class seems appropriate through static - * methods. - */ - -class SplashScreen : public QLabel -{ -public: - static SplashScreen *instance(); - static void finishedLoading(); - static void increment(); - static void update(); - -protected: - SplashScreen(); - virtual ~SplashScreen(); - -private: - void processEvents(); - - static SplashScreen *splash; - static bool done; - static int count; -}; - -#endif - -// vim: set et sw=4 tw=0 sta:
