Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

main.cpp 4.06 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"

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");
36
static const char antonio[]     = I18N_NOOP("DCOP interface");
37

38 39
static KCmdLineOptions options[] =
{
40
#ifndef NO_DEBUG
41
    { "norestore", I18N_NOOP("Restore playlists.  Use --norestore for debugging."), 0 },
42
#endif
43
    { "+[file(s)]", I18N_NOOP("File(s) to open"), 0 },
44
    KCmdLineLastOption
45 46 47 48
};

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

    aboutData.addAuthor("Scott Wheeler", scott, "wheeler@kde.org");
    aboutData.addCredit("Daniel Molkentin", daniel, "molkentin@kde.org");
56
    aboutData.addCredit("Tim Jansen", tim, "tim@tjansen.de");
Scott Wheeler's avatar
Scott Wheeler committed
57
    aboutData.addCredit("Stefan Asserhäll", stefan, "stefan.asserhall@telia.com");
58
    aboutData.addCredit("Stephen Douglas", stephen, "stephen_douglas@yahoo.com");
59
    aboutData.addCredit("Frerich Raabe", frerich, "raabe@kde.org");
Scott Wheeler's avatar
Scott Wheeler committed
60
    aboutData.addCredit("Zack Rusin", zack, "zack@kde.org");
61 62 63 64
    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");
65 66 67

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

69
    KUniqueApplication::addCmdLineOptions();
70

71
    KUniqueApplication a;
72 73 74

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

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

80
    a.setMainWidget(juk);
81 82 83 84 85 86

    bool startDocked;

    KConfig *config = KGlobal::config();
    {
        KConfigGroupSaver saver(config, "Settings");
87
        startDocked = config->readBoolEntry("StartDocked", false);
88 89
    }
    if(!startDocked)
90
        juk->show();
91

92
    return a.exec();
93
}