1
/****************************************************************************************
2
* Copyright (c) 2002 Mark Kretschmann <kretschmann@kde.org> *
4
* This program is free software; you can redistribute it and/or modify it under *
5
* the terms of the GNU General Public License as published by the Free Software *
6
* Foundation; either version 2 of the License, or (at your option) any later *
9
* This program is distributed in the hope that it will be useful, but WITHOUT ANY *
10
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
11
* PARTICULAR PURPOSE. See the GNU General Public License for more details. *
13
* You should have received a copy of the GNU General Public License along with *
14
* this program. If not, see <http://www.gnu.org/licenses/>. *
15
****************************************************************************************/
20
#include <config-amarok.h>
22
#include "aboutdialog/OcsData.h"
23
#include "amarok_export.h"
24
#include "MainWindow.h"
27
#include <KSplashScreen>
28
#include <KUniqueApplication> //baseclass
41
namespace KIO { class Job; }
44
class MediaDeviceManager;
46
class AMAROK_EXPORT App : public KUniqueApplication
54
static App *instance() { return static_cast<App*>( kapp ); }
56
void setUniqueInstance( bool isUnique ) { m_isUniqueInstance = isUnique; }
57
bool isNonUniqueInstance() const { return m_isUniqueInstance; }
59
Amarok::TrayIcon* trayIcon() const { return m_tray; }
60
static void handleCliArgs();
61
static void initCliArgs( int argc, char *argv[] );
62
static void initCliArgs();
64
static int mainThreadId;
66
virtual int newInstance();
68
inline MainWindow *mainWindow() const { return m_mainWindow; }
71
* Determines location of the "amarokcollectionscanner" tool.
73
* @return path of the collection scanner binary.
75
static QString collectionScannerLocation();
78
friend class MainWindow; //requires access to applySettings()
82
void settingsChanged();
86
void resizeMainWindow();
89
void applySettings( bool firstTime = false );
91
static void runUnitTests( const QStringList options, bool _stdout );
93
void slotConfigAmarok( const QString& page = QString() );
94
void slotConfigShortcuts();
95
KIO::Job *trashFiles( const KUrl::List &files );
99
virtual bool event( QEvent *event );
102
void slotTrashResult( KJob *job );
105
* Checks version of the "amarokcollectionscanner" tool.
106
* If the version does not match, it shows an error dialog.
108
void checkCollectionScannerVersion();
112
bool m_isUniqueInstance;
113
QPointer<MainWindow> m_mainWindow;
114
Amarok::TrayIcon *m_tray;
115
MediaDeviceManager *m_mediaDeviceManager;
117
static QStringList s_delayedAmarokUrls;
120
#define pApp static_cast<App*>(kapp)
123
#endif // AMAROK_APP_H