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

/***************************************************************************
 *                                                                         *
 *   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
16
#include <kuniqueapplication.h>
17 18
#include <kcmdlineargs.h>
#include <kaboutdata.h>
19
#include <dcopclient.h>
20 21
#include <kconfigbase.h>
#include <kconfig.h>
22 23 24

#include "juk.h"

25 26 27 28 29
static const char description[] = I18N_NOOP("Jukebox and music manager for KDE");
static const char scott[]       = I18N_NOOP("Author, chief dork and keeper of the funk");
static const char daniel[]      = I18N_NOOP("System tray docking, \"inline\" tag editing,\nbug fixes, evangelism, moral support");
static const char tim[]         = I18N_NOOP("GStreamer port");
static const char stefan[]      = I18N_NOOP("Global keybindings support");
30
static const char stephen[]     = I18N_NOOP("Track announcement popups");
31 32
static const char frerich[]     = I18N_NOOP("Automagic track data guessing, bugfixes");
static const char zack[]        = I18N_NOOP("More automagical things, now using MusicBrainz");
33
static const char adam[]        = I18N_NOOP("Co-conspirator in MusicBrainz wizardry");
34
static const char matthias[]    = I18N_NOOP("Friendly, neighborhood aRts guru");
Malcolm Hunter's avatar
Malcolm Hunter committed
35
static const char maks[]        = I18N_NOOP("Making JuK friendlier to people with\nterabytes of music");
Scott Wheeler's avatar
Scott Wheeler committed
36
static const char michael[]     = I18N_NOOP("Bugfixes, K3b integration, endurer of pedantry");
37
static const char antonio[]     = I18N_NOOP("DCOP interface");
38

39 40
static KCmdLineOptions options[] =
{
41
    { "+[file(s)]", I18N_NOOP("File(s) to open"), 0 },
42
    KCmdLineLastOption
43 44 45 46
};

int main(int argc, char *argv[])
{
47
    KAboutData aboutData("juk", I18N_NOOP("JuK"),
48
                         "2.1", description, KAboutData::License_GPL,
Scott Wheeler's avatar
Scott Wheeler committed
49
                         "(c) 2002 - 2004, Scott Wheeler", 0,
50
                         "http://developer.kde.org/~wheeler/juk.html");
Scott Wheeler's avatar
Scott Wheeler committed
51 52 53

    aboutData.addAuthor("Scott Wheeler", scott, "wheeler@kde.org");
    aboutData.addCredit("Daniel Molkentin", daniel, "molkentin@kde.org");
54
    aboutData.addCredit("Tim Jansen", tim, "tim@tjansen.de");
55
    aboutData.addCredit("Stefan Asserhäll", stefan, "stefan.asserhall@telia.com");
56
    aboutData.addCredit("Stephen Douglas", stephen, "stephen_douglas@yahoo.com");
57
    aboutData.addCredit("Frerich Raabe", frerich, "raabe@kde.org");
Scott Wheeler's avatar
Scott Wheeler committed
58
    aboutData.addCredit("Zack Rusin", zack, "zack@kde.org");
59 60 61 62
    aboutData.addCredit("Adam Treat", adam, "manyoso@yahoo.com");
    aboutData.addCredit("Matthias Kretz", matthias, "kretz@kde.org");
    aboutData.addCredit("Maks Orlovich", maks, "maksim@kde.org");
    aboutData.addCredit("Antonio Larrosa Jimenez", antonio, "larrosa@kde.org");
63
    aboutData.addCredit("Michael Pyne", michael, "michael.pyne@kdemail.net");
64 65 66

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

68
    KUniqueApplication::addCmdLineOptions();
69

70
    KUniqueApplication a;
71 72 73

    // Here we do some DCOP locking of sorts to prevent incoming DCOP calls
    // before JuK has finished its initialization.
74

75
    a.dcopClient()->suspend();
76
    JuK *juk = new JuK();
77 78
    a.dcopClient()->resume();

79
    a.setMainWidget(juk);
80 81 82

    bool startDocked;

83 84 85
    KConfigGroup config(KGlobal::config(), "Settings");
    startDocked = config.readBoolEntry("StartDocked", false);

86
    if(!startDocked)
87
        juk->show();
88

89
    return a.exec();
90
}