-rw-r--r-- | noncore/apps/zsafe/main.cpp | 96 | ||||
-rw-r--r-- | noncore/apps/zsafe/zsafe.pro | 4 |
2 files changed, 3 insertions, 97 deletions
diff --git a/noncore/apps/zsafe/main.cpp b/noncore/apps/zsafe/main.cpp index 2707730..6dfd455 100644 --- a/noncore/apps/zsafe/main.cpp +++ b/noncore/apps/zsafe/main.cpp | |||
@@ -1,123 +1,31 @@ | |||
1 | /* | 1 | /* |
2 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> | 2 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> |
3 | ** | 3 | ** |
4 | ** $Id$ | 4 | ** $Id$ |
5 | ** | 5 | ** |
6 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html | 6 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html |
7 | */ | 7 | */ |
8 | 8 | ||
9 | 9 | ||
10 | #include "zsafe.h" | 10 | #include "zsafe.h" |
11 | 11 | ||
12 | #ifndef NO_OPIE | ||
13 | /* OPIE */ | 12 | /* OPIE */ |
14 | #include <opie2/odebug.h> | 13 | #include <opie2/odebug.h> |
15 | using namespace Opie::Core; | ||
16 | #endif | ||
17 | 14 | ||
18 | /* QT */ | 15 | /* QT */ |
19 | #ifdef DESKTOP | 16 | #include <opie2/oapplicationfactory.h> |
20 | #include <qapplication.h> | ||
21 | #else | ||
22 | #include <qpe/qpeapplication.h> | ||
23 | #endif | ||
24 | |||
25 | /* STD */ | ||
26 | #include <stdio.h> | ||
27 | #include <signal.h> | ||
28 | |||
29 | ZSafe *zs; | ||
30 | #ifdef DESKTOP | ||
31 | QApplication *appl; | ||
32 | #else | ||
33 | QPEApplication *appl; | ||
34 | #endif | ||
35 | |||
36 | int DeskW; | ||
37 | int DeskH; | ||
38 | 17 | ||
39 | void suspend (int signum) | 18 | void suspend (int signum) |
40 | { | 19 | { |
41 | printf ("Suspend signal %d received\n", signum); | 20 | printf ("Suspend signal %d received\n", signum); |
42 | } | 21 | } |
43 | 22 | ||
44 | void resume (int signum) | 23 | void resume (int signum) |
45 | { | 24 | { |
46 | printf ("Resume signal %d received\n", signum); | 25 | printf ("Resume signal %d received\n", signum); |
47 | zs->resume(signum); | 26 | zs->resume(signum); |
48 | } | 27 | } |
49 | 28 | ||
50 | int main( int argc, char ** argv ) | ||
51 | { | ||
52 | #ifndef Q_WS_WIN | ||
53 | // install signal handler | ||
54 | // signal (SIGSTOP, suspend); | ||
55 | #endif | ||
56 | |||
57 | #ifdef DESKTOP | ||
58 | QApplication a( argc, argv ); | ||
59 | #else | ||
60 | QPEApplication a( argc, argv ); | ||
61 | #endif | ||
62 | appl = &a; | ||
63 | 29 | ||
64 | #ifdef DESKTOP | 30 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<ZSafe> ) |
65 | if (argc >= 3) | ||
66 | { | ||
67 | #ifndef Q_WS_WIN | ||
68 | DeskW = atoi(argv[1]); | ||
69 | DeskH = atoi(argv[2]); | ||
70 | #else | ||
71 | int w, h; | ||
72 | sscanf (argv[1], "%d", &w); | ||
73 | sscanf (argv[2], "%d", &h); | ||
74 | DeskW = w; | ||
75 | DeskH = h; | ||
76 | #endif | ||
77 | } | ||
78 | else | ||
79 | { | ||
80 | DeskW = 600; | ||
81 | DeskH = 400; | ||
82 | } | ||
83 | #else | ||
84 | DeskW = a.desktop()->width(); | ||
85 | DeskH = a.desktop()->height(); | ||
86 | 31 | ||
87 | #ifndef NO_OPIE | ||
88 | owarn << "Width: " << DeskW << " Height: " << DeskH << oendl; | ||
89 | #endif | ||
90 | #ifdef JPATCH_HDE | ||
91 | // nothings | ||
92 | #else | ||
93 | if (DeskW > 240) | ||
94 | { | ||
95 | DeskW -= 20; | ||
96 | DeskH += 25; | ||
97 | #ifndef NO_OPIE | ||
98 | owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl; | ||
99 | #endif | ||
100 | } | ||
101 | #endif | ||
102 | |||
103 | #endif | ||
104 | |||
105 | ZSafe *mw = new ZSafe( 0, 0, QWidget::WDestructiveClose ); | ||
106 | // ZSafe mw; | ||
107 | // zs = &mw; | ||
108 | zs = mw; | ||
109 | |||
110 | #ifndef Q_WS_WIN | ||
111 | // signal (SIGCONT, resume); | ||
112 | #endif | ||
113 | #ifdef DESKTOP | ||
114 | a.setMainWidget(mw); | ||
115 | mw->show(); | ||
116 | #else | ||
117 | // a.showMainWidget( &mw ); | ||
118 | a.showMainDocumentWidget( mw ); | ||
119 | #endif | ||
120 | int ret = a.exec(); | ||
121 | |||
122 | return ret; | ||
123 | } | ||
diff --git a/noncore/apps/zsafe/zsafe.pro b/noncore/apps/zsafe/zsafe.pro index 236d11e..e53015d 100644 --- a/noncore/apps/zsafe/zsafe.pro +++ b/noncore/apps/zsafe/zsafe.pro | |||
@@ -1,31 +1,29 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG = qt quick-app |
2 | CONFIG = qt warn_on | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = zsafe.h krc2.h category.h categorylist.h zlistview.h \ | 2 | HEADERS = zsafe.h krc2.h category.h categorylist.h zlistview.h \ |
5 | scqtfiledlg.h | 3 | scqtfiledlg.h |
6 | SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \ | 4 | SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \ |
7 | categorylist.cpp zlistview.cpp shadedlistitem.cpp\ | 5 | categorylist.cpp zlistview.cpp shadedlistitem.cpp\ |
8 | scqtfileedit.cpp scqtfileedit.moc.cpp \ | 6 | scqtfileedit.cpp scqtfileedit.moc.cpp \ |
9 | scqtfiledlg.cpp | 7 | scqtfiledlg.cpp |
10 | INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui | 8 | INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui |
11 | INCLUDEPATH += $(OPIEDIR)/include | 9 | INCLUDEPATH += $(OPIEDIR)/include |
12 | DEPENDPATH += $(OPIEDIR)/include | 10 | DEPENDPATH += $(OPIEDIR)/include |
13 | LIBS += -lqpe -lopiecore2 -lopieui2 | 11 | LIBS += -lqpe -lopiecore2 -lopieui2 |
14 | TARGET = zsafe | 12 | TARGET = zsafe |
15 | 13 | ||
16 | include ( $(OPIEDIR)/include.pro ) | 14 | include ( $(OPIEDIR)/include.pro ) |
17 | 15 | ||
18 | QWS { | 16 | QWS { |
19 | message( "Configuring for multi-threaded Qt..." ) | 17 | message( "Configuring for multi-threaded Qt..." ) |
20 | 18 | ||
21 | } | 19 | } |
22 | 20 | ||
23 | win32 { | 21 | win32 { |
24 | TEMPLATE = app | 22 | TEMPLATE = app |
25 | DEFINES += DESKTOP QT_DLL QT_THREAD_SUPPORT | 23 | DEFINES += DESKTOP QT_DLL QT_THREAD_SUPPORT |
26 | SOURCES += extra/qsettings.cpp | 24 | SOURCES += extra/qsettings.cpp |
27 | HEADERS += extra/qsettings.h | 25 | HEADERS += extra/qsettings.h |
28 | INCLUDEPATH+= extra | 26 | INCLUDEPATH+= extra |
29 | DEPENDPATH += extra | 27 | DEPENDPATH += extra |
30 | RC_FILE = zsafe.rc | 28 | RC_FILE = zsafe.rc |
31 | } | 29 | } |