author | Markus Bröker <mbroeker@largo.homelinux.org> |
Sat, 03 Jan 2009 01:28:28 +0100 | |
changeset 4 | fdf04a93faeb |
parent 0 | 826dd5531eb0 |
permissions | -rw-r--r-- |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
1 |
/* |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
2 |
* $Id: main.cpp 54 2008-01-10 00:24:52Z mbroeker $ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
3 |
* $URL: http://localhost/svn/cpp/qMonitor/trunk/main.cpp $ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
4 |
*/ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
5 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
6 |
#include <QApplication> |
4
fdf04a93faeb
Codebase indented by me and gnu-indent
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
7 |
#include <cstdlib> |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
8 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
9 |
#include "include/monitor.h" |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
10 |
#include <version.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
11 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
12 |
int main (int argc, char *argv[]) |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
13 |
{ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
14 |
int i; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
15 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
16 |
while ((i = getopt (argc, argv, "hv")) >= 0) { |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
17 |
switch (i) { |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
18 |
case 'h': |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
19 |
std::cout << "Usage: " << argv[0] << " [OPTIONS]" << std::endl; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
20 |
std::cout << "qMonitor displays the online traffic." << std::endl << std::endl; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
21 |
std::cout << "Options:" << std::endl << std::endl; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
22 |
std::cout << "-h: \t\t\tShow this help" << std::endl; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
23 |
std::cout << "-v: \t\t\tShow Version" << std::endl; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
24 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
25 |
exit (0); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
26 |
break; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
27 |
case 'v': |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
28 |
std::cout << VERSION_STRING << std::endl; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
29 |
exit (0); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
30 |
break; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
31 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
32 |
default: |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
33 |
; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
34 |
} |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
35 |
} |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
36 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
37 |
QApplication app (argc, argv); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
38 |
Monitor *dialog = new Monitor; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
39 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
40 |
dialog->show (); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
41 |
return app.exec (); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
42 |
} |