1 | /* |
2 | This file is part of KNewStuff. |
3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> |
4 | Copyright (c) 2007-2009 Jeremy Whiting <jpwhiting@kde.org> |
5 | Copyright (c) 2009 Frederik Gladhorn <gladhorn@kde.org> |
6 | |
7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public |
9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. |
11 | |
12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | Boston, MA 02110-1301, USA. |
21 | */ |
22 | |
23 | #include <kapplication.h> |
24 | #include <kdebug.h> |
25 | #include <klocale.h> |
26 | #include <kcmdlineargs.h> |
27 | #include <kaboutdata.h> |
28 | |
29 | #include <knewstuff3/downloaddialog.h> |
30 | |
31 | int main(int argc, char **argv) |
32 | { |
33 | KAboutData about("khotnewstuff" , 0, ki18n("KHotNewStuff" ), "0.4" ); |
34 | about.setProgramIconName("get-hot-new-stuff" ); |
35 | KCmdLineArgs *args; |
36 | |
37 | KCmdLineArgs::init(argc, argv, &about); |
38 | |
39 | KCmdLineOptions op; |
40 | op.add("+filename" , ki18n("Name of .knsrc file to read configuration from" )); |
41 | |
42 | KCmdLineArgs::addCmdLineOptions(op); |
43 | args = KCmdLineArgs::parsedArgs(); |
44 | |
45 | KApplication i; |
46 | |
47 | if (args->count() > 0) { |
48 | KNS3::DownloadDialog dialog(args->arg(0)); |
49 | dialog.exec(); |
50 | foreach (const KNS3::Entry& e, dialog.changedEntries()) { |
51 | kDebug() << "Changed Entry: " << e.name(); |
52 | } |
53 | } |
54 | else |
55 | { |
56 | args->usage(); |
57 | return -1; |
58 | } |
59 | |
60 | return 0; |
61 | } |
62 | |
63 | |