Commit b0d8e7b7 authored by Michael Pyne's avatar Michael Pyne

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.
parent 17828b06
......@@ -115,7 +115,6 @@ set(juk_SRCS ${tunepimp_SRCS}
searchwidget.cpp
slideraction.cpp
sortedstringlist.cpp
splashscreen.cpp
statuslabel.cpp
stringshare.cpp
systemtray.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()
......
......@@ -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();
......
......@@ -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>
......
......@@ -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());
......
......@@ -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;
......
<!DOCTYPE kpartgui>
<kpartgui name="juk" version="12">
<kpartgui name="juk" version="13">
<MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text>
<Action name="file_new"/>
......@@ -66,7 +66,6 @@
<Action name="renameFile"/>
</Menu>
<Menu name="settings"><text>&amp;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"/>
......
<!-- 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>&amp;File</text>
<Action name="file_new"/>
......@@ -68,7 +68,6 @@
<Action name="renameFile"/>
</Menu>
<Menu name="settings"><text>&amp;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"/>
......
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 )
/**
* Copyright (C) 2002-2004 Scott Wheeler <wheeler@kde.org>
*
* 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:
/**
* Copyright (C) 2002-2004 Scott Wheeler <wheeler@kde.org>
*
* 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:
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