2 * This file is part of the KDE Help Center
4 * Copyright (c) 2002 Frerich Raabe <raabe@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include "application.h"
22 #include "mainwindow.h"
25 #include <kcmdlineargs.h>
26 #include <kaboutdata.h>
31 Application::Application() : KUniqueApplication(), mMainWindow( 0 )
35 int Application::newInstance()
37 if (restoringSession()) return 0;
39 KCmdLineArgs
*args
= KCmdLineArgs::parsedArgs();
46 mMainWindow
= new MainWindow
;
50 mMainWindow
->openUrl( url
);
52 return KUniqueApplication::newInstance();
55 extern "C" int KDE_EXPORT
kdemain( int argc
, char **argv
)
57 KAboutData
aboutData( "khelpcenter", 0, ki18n("KDE Help Center"),
59 ki18n("The KDE Help Center"),
60 KAboutData::License_GPL
,
61 ki18n("(c) 1999-2003, The KHelpCenter developers") );
63 aboutData
.addAuthor( ki18n("Cornelius Schumacher"), KLocalizedString(), "schumacher@kde.org" );
64 aboutData
.addAuthor( ki18n("Frerich Raabe"), KLocalizedString(), "raabe@kde.org" );
65 aboutData
.addAuthor( ki18n("Matthias Elter"), ki18n("Original Author"),
67 aboutData
.addAuthor( ki18n("Wojciech Smigaj"), ki18n("Info page support"),
68 "achu@klub.chip.pl" );
69 aboutData
.setProgramIconName( "help-browser" );
71 KCmdLineArgs::init( argc
, argv
, &aboutData
);
73 KCmdLineOptions options
;
74 options
.add("+[url]", ki18n("URL to display"));
75 KCmdLineArgs::addCmdLineOptions( options
);
76 KCmdLineArgs::addStdCmdLineOptions();
80 if ( app
.isSessionRestored() ) {
81 RESTORE( MainWindow
);