1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#include <stdlib.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <kuniqueapplication.h>
#include "app.h"
static KCmdLineOptions options[] =
{
{ "dist-upgrade", I18N_NOOP("add toolbar button to launch the version upgrade tool to the latest release"), 0},
{ "dist-upgrade-proposed", I18N_NOOP("add toolbar button to launch the version upgrade tool to proposed next release"), 0},
{ "dist-upgrade-devel", I18N_NOOP("add toolbar button to launch the version upgrade tool to development version"), 0},
KCmdLineLastOption
};
int main(int argc, char *argv[])
{
KLocale::setMainCatalogue("adept");
putenv( "QT_IM_MODULE=xim" );
QString description = i18n("Adept Manager");
KAboutData aboutData( "adept_manager",
I18N_NOOP("Adept Manager"),
"2.1 Cruiser",
description.latin1(),
KAboutData::License_BSD,
I18N_NOOP("(c) 2005, 2006 Peter Rockai"),
0,
"http://web.mornfall.net/adept.html");
aboutData.addAuthor ( "Peter Rockai",
I18N_NOOP("developer"),
"me at mornfall dot net",
"http://web.mornfall.net");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
// if (args && args->isSet("xy")) ...
/* KConfig* config = KGlobal::config();
config->setGroup("General Settings");
QString version = config->readEntry("Version"); */
KGlobal::locale()->insertCatalogue(QString::fromUtf8("libept"));
KGlobal::locale()->insertCatalogue(QString::fromUtf8("libapt-front"));
TestApp *ta = new TestApp();
app.setMainWidget(ta);
#ifdef KUBUNTU
if (args && args->isSet("dist-upgrade")) {
ta->addVersionUpgrade(QString("http://changelogs.ubuntu.com/meta-release"));
} else if (args && args->isSet("dist-upgrade-proposed")) {
ta->addVersionUpgrade(QString("http://changelogs.ubuntu.com/meta-release-proposed"));
} else if (args && args->isSet("dist-upgrade-devel")) {
ta->addVersionUpgrade(QString("http://changelogs.ubuntu.com/meta-release-development"), true);
}
#endif
ta->show();
return app.exec();
}
|