main.cpp 3.23 KB
Newer Older
1 2 3 4 5
/***************************************************************************
                          main.cpp  -  description
                             -------------------
    begin                : Mon Feb  4 23:40:41 EST 2002
    copyright            : (C) 2002 by Scott Wheeler
6
    email                : wheeler@kde.org
7
***************************************************************************/
8 9 10 11 12 13 14 15 16 17

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

Scott Wheeler's avatar
Scott Wheeler committed
18
#include <kuniqueapplication.h>
19 20
#include <kcmdlineargs.h>
#include <kaboutdata.h>
21
#include <dcopclient.h>
22 23 24

#include "juk.h"

Scott Wheeler's avatar
Scott Wheeler committed
25
static const char *description = I18N_NOOP("Jukebox and music manager for KDE");
Daniel Stone's avatar
Daniel Stone committed
26
static const char *scott = I18N_NOOP("Author, chief dork and keeper of the funk");
Scott Wheeler's avatar
Scott Wheeler committed
27
static const char *daniel = I18N_NOOP("System tray docking, \"inline\" tag editing,\nbug fixes, evangelism, moral support");
28
static const char *tim = I18N_NOOP("GStreamer port");
29
static const char *stefan = I18N_NOOP("Global keybindings support");
30
static const char *stephan = I18N_NOOP("Track announcement popups");
31
static const char *frerich = I18N_NOOP("Automagic track data guessing, bugfixes");
32

33 34 35
#if KDE_IS_VERSION(3,1,90)
typedef KUniqueApplication Application;
#else
36 37 38 39 40 41 42 43 44 45 46 47
class Application : public KUniqueApplication
{
public:
    Application() : KUniqueApplication(true, true, false) {}
    virtual ~Application() {}
    virtual int newInstance() {
	QWidget *w = mainWidget();
	if(w)
	    w->setShown(true);
	return KUniqueApplication::newInstance();
    }
};
48
#endif
49

50 51
static KCmdLineOptions options[] =
{
52
    { "+[file(s)]", I18N_NOOP("File(s) to open"), 0 },
53
    { 0, 0, 0 }
54 55 56 57
};

int main(int argc, char *argv[])
{
58
    KAboutData aboutData("juk", I18N_NOOP("JuK"),
59
                         "1.90 (2.0 Pre-Alpha)", description, KAboutData::License_GPL,
60
                         "(c) 2002, 2003, Scott Wheeler", 0, "http://www.slackorama.net/oss/juk/");
Scott Wheeler's avatar
Scott Wheeler committed
61 62 63

    aboutData.addAuthor("Scott Wheeler", scott, "wheeler@kde.org");
    aboutData.addCredit("Daniel Molkentin", daniel, "molkentin@kde.org");
64
    aboutData.addCredit("Tim Jansen", tim, "tim@tjansen.de");
Scott Wheeler's avatar
Scott Wheeler committed
65
    aboutData.addCredit("Stefan Asserhäll", stefan, "stefan.asserhall@telia.com");
66
    aboutData.addCredit("Stephan Douglas", stephan, "stephen_douglas@yahoo.com");
67
    aboutData.addCredit("Frerich Raabe", frerich, "raabe@kde.org");
68 69 70

    KCmdLineArgs::init(argc, argv, &aboutData);
    KCmdLineArgs::addCmdLineOptions(options);
71

72
    Application a;
73 74 75 76 77

    // Here we do some DCOP locking of sorts to prevent incoming DCOP calls
    // before JuK has finished its initialization.
    
    a.dcopClient()->suspend();
78
    JuK *juk = new JuK();
79 80
    a.dcopClient()->resume();

81 82
    a.setMainWidget(juk);
    juk->show();
83

84
    return a.exec();
85
}