main.cpp 2.87 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 21 22 23
#include <kcmdlineargs.h>
#include <kaboutdata.h>

#include "juk.h"

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

31 32 33
#if KDE_IS_VERSION(3,1,90)
typedef KUniqueApplication Application;
#else
34 35 36 37 38 39 40 41 42 43 44 45
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();
    }
};
46
#endif
47

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

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

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

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

69
    Application a;
70 71 72
    JuK *juk = new JuK();
    a.setMainWidget(juk);
    juk->show();
73

74
    return a.exec();
75
}