2004-08-26 21:17:24 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
|
|
|
|
* Copyright (C) 2003 by Christophe Devriese *
|
|
|
|
* <Christophe.Devriese@student.kuleuven.ac.be> *
|
|
|
|
* Copyright (C) 2003 by Laurent Montel <montel@kde.org> *
|
2007-10-11 18:57:28 +00:00
|
|
|
* Copyright (C) 2003-2007 by Albert Astals Cid <aacid@kde.org> *
|
2004-08-26 21:17:24 +00:00
|
|
|
* Copyright (C) 2004 by Andy Goossens <andygoossens@telenet.be> *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2005-01-02 14:29:37 +00:00
|
|
|
#include "shell.h"
|
2002-08-30 09:14:01 +00:00
|
|
|
#include <kapplication.h>
|
|
|
|
#include <kcmdlineargs.h>
|
2007-10-02 16:23:28 +00:00
|
|
|
#include <kicon.h>
|
2002-08-30 09:14:01 +00:00
|
|
|
#include <klocale.h>
|
2007-03-10 23:45:12 +00:00
|
|
|
#include "aboutdata.h"
|
2002-08-30 09:14:01 +00:00
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2007-09-30 16:52:27 +00:00
|
|
|
KAboutData about = okularAboutData( "okular", I18N_NOOP( "okular" ) );
|
2004-08-28 16:59:55 +00:00
|
|
|
|
2007-09-30 16:52:27 +00:00
|
|
|
KCmdLineArgs::init(argc, argv, &about);
|
2007-07-02 08:52:55 +00:00
|
|
|
|
|
|
|
KCmdLineOptions options;
|
|
|
|
options.add("p");
|
|
|
|
options.add("page <number>", ki18n("Page of the document to be shown"));
|
|
|
|
options.add("presentation", ki18n("Start the document in presentation mode"));
|
|
|
|
options.add("+[URL]", ki18n("Document to open"));
|
2003-08-15 00:55:25 +00:00
|
|
|
KCmdLineArgs::addCmdLineOptions( options );
|
|
|
|
KApplication app;
|
2007-10-02 16:23:28 +00:00
|
|
|
QApplication::setWindowIcon( KIcon( "graphics-viewer-document" ) );
|
2003-08-15 00:55:25 +00:00
|
|
|
|
|
|
|
// see if we are starting with session management
|
2006-03-21 20:03:08 +00:00
|
|
|
if (app.isSessionRestored())
|
2002-08-30 09:14:01 +00:00
|
|
|
{
|
2006-09-21 08:45:36 +00:00
|
|
|
RESTORE(Shell);
|
2003-08-15 00:55:25 +00:00
|
|
|
} else {
|
|
|
|
// no session.. just start up normally
|
|
|
|
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
|
|
|
|
|
|
|
|
if (args->count() == 0)
|
|
|
|
{
|
2007-01-04 00:20:50 +00:00
|
|
|
Shell* widget = new Shell(args);
|
2003-08-15 00:55:25 +00:00
|
|
|
widget->show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (int i = 0; i < args->count(); ++i)
|
|
|
|
{
|
2007-01-04 00:20:50 +00:00
|
|
|
Shell* widget = new Shell(args, args->url(i));
|
2003-08-15 00:55:25 +00:00
|
|
|
widget->show();
|
|
|
|
}
|
|
|
|
}
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
2007-06-06 15:33:17 +00:00
|
|
|
|
2007-09-30 16:52:27 +00:00
|
|
|
return app.exec();
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// vim:ts=2:sw=2:tw=78:et
|