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> *
|
2006-05-14 19:11:03 +00:00
|
|
|
* Copyright (C) 2003-2006 by Albert Astals Cid <tsdgeos@terra.es> *
|
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>
|
|
|
|
#include <klocale.h>
|
2007-03-10 23:45:12 +00:00
|
|
|
#include "aboutdata.h"
|
2002-08-30 09:14:01 +00:00
|
|
|
|
|
|
|
static KCmdLineOptions options[] =
|
|
|
|
{
|
2007-01-04 00:20:50 +00:00
|
|
|
{ "p", 0, 0 },
|
|
|
|
{ "page <number>", I18N_NOOP("Page of the document to be shown"), 0 },
|
|
|
|
{ "presentation", I18N_NOOP("Start the document in presentation mode"), 0 },
|
2004-06-21 19:03:29 +00:00
|
|
|
{ "+[URL]", I18N_NOOP("Document to open"), 0 },
|
2003-09-14 19:04:36 +00:00
|
|
|
KCmdLineLastOption
|
2002-08-30 09:14:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2007-03-10 23:45:12 +00:00
|
|
|
KAboutData * about = okularAboutData( "okular", I18N_NOOP( "okular" ) );
|
2004-08-28 16:59:55 +00:00
|
|
|
|
2007-03-10 23:45:12 +00:00
|
|
|
KCmdLineArgs::init(argc, argv, about);
|
2003-08-15 00:55:25 +00:00
|
|
|
KCmdLineArgs::addCmdLineOptions( options );
|
|
|
|
KApplication app;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
}
|
|
|
|
}
|
2007-06-06 15:21:56 +00:00
|
|
|
args->clear();
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
2007-03-10 23:45:12 +00:00
|
|
|
int ret = app.exec();
|
|
|
|
delete about;
|
|
|
|
return ret;
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// vim:ts=2:sw=2:tw=78:et
|