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> *
|
|
|
|
* Copyright (C) 2003-2004 by Albert Astals Cid <tsdgeos@terra.es> *
|
|
|
|
* 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2002-09-02 20:21:47 +00:00
|
|
|
#include "kpdf_shell.h"
|
2002-08-30 09:14:01 +00:00
|
|
|
#include <kapplication.h>
|
|
|
|
#include <kaboutdata.h>
|
|
|
|
#include <kcmdlineargs.h>
|
|
|
|
#include <klocale.h>
|
|
|
|
|
2004-02-06 23:46:21 +00:00
|
|
|
static const char description[] =
|
2003-08-15 00:55:25 +00:00
|
|
|
I18N_NOOP("kpdf, a kde pdf viewer based on xpdf");
|
2002-08-30 09:14:01 +00:00
|
|
|
|
2004-09-19 10:56:25 +00:00
|
|
|
static const char version[] = "0.4";
|
2002-08-30 09:14:01 +00:00
|
|
|
|
|
|
|
static KCmdLineOptions options[] =
|
|
|
|
{
|
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)
|
|
|
|
{
|
2003-08-15 00:55:25 +00:00
|
|
|
KAboutData about(
|
|
|
|
"kpdf",
|
|
|
|
I18N_NOOP("KPDF"),
|
|
|
|
version,
|
|
|
|
description,
|
|
|
|
KAboutData::License_GPL,
|
2003-11-09 22:20:29 +00:00
|
|
|
"(C) 2002 Wilco Greven, Christophe Devriese");
|
2003-08-15 00:55:25 +00:00
|
|
|
|
|
|
|
about.addAuthor("Wilco Greven", 0, "greven@kde.org");
|
|
|
|
about.addAuthor("Christophe Devriese", 0, "oelewapperke@oelewapperke.org");
|
2003-09-14 19:04:36 +00:00
|
|
|
about.addAuthor("Laurent Montel", 0, "montel@kde.org");
|
2004-08-23 00:05:01 +00:00
|
|
|
about.addAuthor("Albert Astals Cid", I18N_NOOP("xpdf 3.0 integration, thumbnails"), "astals11@terra.es");
|
2003-08-15 00:55:25 +00:00
|
|
|
|
2004-08-28 16:59:55 +00:00
|
|
|
about.addCredit("Derek Noonburg", I18N_NOOP("Xpdf author"), 0, "http://www.foolabs.com/xpdf/");
|
|
|
|
|
2003-08-15 00:55:25 +00:00
|
|
|
KCmdLineArgs::init(argc, argv, &about);
|
|
|
|
KCmdLineArgs::addCmdLineOptions( options );
|
|
|
|
KApplication app;
|
|
|
|
|
|
|
|
// see if we are starting with session management
|
|
|
|
if (app.isRestored())
|
2002-08-30 09:14:01 +00:00
|
|
|
{
|
2003-08-15 00:55:25 +00:00
|
|
|
RESTORE(KPDF::Shell);
|
|
|
|
} else {
|
|
|
|
// no session.. just start up normally
|
|
|
|
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
|
|
|
|
|
|
|
|
if (args->count() == 0)
|
|
|
|
{
|
|
|
|
KPDF::Shell* widget = new KPDF::Shell;
|
|
|
|
widget->show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (int i = 0; i < args->count(); ++i)
|
|
|
|
{
|
|
|
|
KPDF::Shell* widget = new KPDF::Shell;
|
|
|
|
widget->show();
|
2003-09-14 17:44:18 +00:00
|
|
|
widget->openURL(args->url(i));
|
2003-08-15 00:55:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
args->clear();
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
|
|
|
|
2003-08-15 00:55:25 +00:00
|
|
|
return app.exec();
|
2002-08-30 09:14:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// vim:ts=2:sw=2:tw=78:et
|