main.cpp 6.19 KB
Newer Older
1 2
/**
 * Copyright (C) 2002-2007 Scott Wheeler <wheeler@kde.org>
3
 * Copyright (C) 2004-2017 Michael Pyne  <mpyne@kde.org>
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */
17

Michael Pyne's avatar
Michael Pyne committed
18 19 20 21
#include <KAboutData>
#include <KConfigBase>
#include <KConfig>
#include <KConfigGroup>
22
#include <KCrash>
Michael Pyne's avatar
Michael Pyne committed
23 24 25
#include <KNotification>
#include <KSharedConfig>
#include <KLocalizedString>
26

27 28
#include <QCommandLineParser>
#include <QCommandLineOption>
Michael Pyne's avatar
Michael Pyne committed
29
#include <QApplication>
30

31
#include "juk.h"
Yuri Chornoivan's avatar
Yuri Chornoivan committed
32
#include <config-juk.h>
33

34
static const char description[] = I18N_NOOP("Jukebox and music manager by the KDE community");
35
static const char scott[]       = I18N_NOOP("Author, chief dork and keeper of the funk");
36
static const char michael[]     = I18N_NOOP("Assistant super-hero, fixer of many things");
37
static const char georg[]       = I18N_NOOP("More KDE Platform 4 porting efforts");
38 39 40
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");
41
static const char stephen[]     = I18N_NOOP("Track announcement popups");
42 43
static const char frerich[]     = I18N_NOOP("Automagic track data guessing, bugfixes");
static const char zack[]        = I18N_NOOP("More automagical things, now using MusicBrainz");
44
static const char adam[]        = I18N_NOOP("Co-conspirator in MusicBrainz wizardry");
45
static const char matthias[]    = I18N_NOOP("Friendly, neighborhood aRts guru");
46
static const char maks[]        = I18N_NOOP("Making JuK friendlier to people with terabytes of music");
47
static const char antonio[]     = I18N_NOOP("DCOP interface");
48
static const char allan[]       = I18N_NOOP("FLAC and MPC support");
Scott Wheeler's avatar
Scott Wheeler committed
49
static const char nathan[]      = I18N_NOOP("Album cover manager");
50
static const char pascal[]      = I18N_NOOP("Gimper of splash screen");
51
static const char laurent[]     = I18N_NOOP("Porting to KDE 4 when no one else was around");
52
static const char giorgos[]     = I18N_NOOP("Badly-needed tag editor bugfixes.");
53
static const char sandsmark[]   = I18N_NOOP("Last.fm scrobbling support, lyrics, prepping for KDE Frameworks.");
54
static const char sho[]         = I18N_NOOP("MPRIS2 Interface implementation.");
55
static const char kacper[]      = I18N_NOOP("Porting to KF5 when no one else was around");
56

57 58
int main(int argc, char *argv[])
{
59
    QApplication a(argc, argv);
60 61 62
    KLocalizedString::setApplicationDomain("juk");

    KAboutData aboutData(QStringLiteral("juk"), i18n("JuK"),
63 64
                         QStringLiteral(JUK_VERSION), i18n(description), KAboutLicense::GPL,
                         i18n("© 2002–2017, Scott Wheeler, Michael Pyne, and others"),
65
                         QStringLiteral(""),
66
                         QStringLiteral("https://www.kde.org/applications/multimedia/juk/"));
67 68 69

    aboutData.addAuthor(i18n("Scott Wheeler"), i18n(scott), "wheeler@kde.org");
    aboutData.addAuthor(i18n("Michael Pyne"), i18n(michael), "mpyne@kde.org");
70
    aboutData.addCredit(i18n("Kacper Kasper"), i18n(kacper), "kacperkasper@gmail.com", "http://kacperkasper.pl/");
71 72
    aboutData.addCredit(i18n("Eike Hein"), i18n(sho), "hein@kde.org");
    aboutData.addCredit(i18n("Martin Sandsmark"), i18n(sandsmark), "martin.sandsmark@kde.org");
73
    aboutData.addCredit(i18n("Γιώργος Κυλάφας (Giorgos Kylafas)"), i18n(giorgos), "gekylafas@gmail.com");
74 75 76 77
    aboutData.addCredit(i18n("Georg Grabler"), i18n(georg), "georg@grabler.net");
    aboutData.addCredit(i18n("Laurent Montel"), i18n(laurent), "montel@kde.org");
    aboutData.addCredit(i18n("Nathan Toone"), i18n(nathan), "nathan@toonetown.com");
    aboutData.addCredit(i18n("Matthias Kretz"), i18n(matthias), "kretz@kde.org");
78 79 80 81 82 83 84 85 86 87 88 89 90
    aboutData.addCredit(i18n("Daniel Molkentin"), i18n(daniel), "molkentin@kde.org");
    aboutData.addCredit(i18n("Tim Jansen"), i18n(tim), "tim@tjansen.de");
    aboutData.addCredit(i18n("Stefan Asserhäll"), i18n(stefan), "stefan.asserhall@telia.com");
    aboutData.addCredit(i18n("Stephen Douglas"), i18n(stephen), "stephen_douglas@yahoo.com");
    aboutData.addCredit(i18n("Frerich Raabe"), i18n(frerich), "raabe@kde.org");
    aboutData.addCredit(i18n("Zack Rusin"), i18n(zack), "zack@kde.org");
    aboutData.addCredit(i18n("Adam Treat"), i18n(adam), "manyoso@yahoo.com");
    aboutData.addCredit(i18n("Maks Orlovich"), i18n(maks), "maksim@kde.org");
    aboutData.addCredit(i18n("Antonio Larrosa Jimenez"), i18n(antonio), "larrosa@kde.org");
    aboutData.addCredit(i18n("Allan Sandfeld Jensen"), i18n(allan), "kde@carewolf.com");
    aboutData.addCredit(i18n("Pascal Klein"), i18n(pascal), "4pascal@tpg.com.au");
    KAboutData::setApplicationData(aboutData);

91 92 93 94 95
    QCommandLineParser parser;
    aboutData.setupCommandLine(&parser);
    parser.addPositionalArgument(QLatin1String("[file(s)]"), i18n("File(s) to open"));
    parser.process(a);
    aboutData.processCommandLine(&parser);
96

97 98
    KCrash::initialize();

Michael Pyne's avatar
Michael Pyne committed
99
    // Create the main window and such
100
    JuK *juk = new JuK(parser.positionalArguments());
101

102
    if(a.isSessionRestored() && KMainWindow::canBeRestored(1))
103 104
        juk->restore(1, false /* don't show */);

105
    KConfigGroup config(KSharedConfig::openConfig(), "Settings");
106
    if(!config.readEntry("StartDocked", false) || !config.readEntry("DockInSystemTray", false)) {
107
        juk->show();
108
    }
109
    else if(!a.isSessionRestored()) {
110
        QString message = i18n("JuK running in docked mode\nUse context menu in system tray to restore.");
111
        KNotification::event("dock_mode",i18n("JuK Docked"), message);
112
    }
113

114 115
    a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);

116
    return a.exec();
117
}
118

119
// vim: set et sw=4 tw=0 sta fileencoding=utf8: