summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/.cvsignore1
-rw-r--r--noncore/settings/aqpkg/aqpkg.pro26
-rw-r--r--noncore/settings/aqpkg/main.cpp44
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp31
-rw-r--r--noncore/settings/aqpkg/mainwin.h5
5 files changed, 27 insertions, 80 deletions
diff --git a/noncore/settings/aqpkg/.cvsignore b/noncore/settings/aqpkg/.cvsignore
index 2888d4a..4183697 100644
--- a/noncore/settings/aqpkg/.cvsignore
+++ b/noncore/settings/aqpkg/.cvsignore
@@ -2 +2,2 @@ Makefile*
moc*
+.moc*
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro
index d241d1b..882cfd4 100644
--- a/noncore/settings/aqpkg/aqpkg.pro
+++ b/noncore/settings/aqpkg/aqpkg.pro
@@ -1,3 +1,2 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
HEADERS = global.h \
@@ -34,3 +33,2 @@ SOURCES = mainwin.cpp \
categoryfilterimpl.cpp
-INTERFACES =
TARGET = aqpkg
@@ -39,24 +37,4 @@ DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie -lstdc++
-DESTDIR = $(OPIEDIR)/bin
-
-TRANSLATIONS = ../../../i18n/de/aqpkg.ts \
- ../../../i18n/nl/aqpkg.ts \
- ../../../i18n/xx/aqpkg.ts \
- ../../../i18n/en/aqpkg.ts \
- ../../../i18n/es/aqpkg.ts \
- ../../../i18n/fr/aqpkg.ts \
- ../../../i18n/hu/aqpkg.ts \
- ../../../i18n/ja/aqpkg.ts \
- ../../../i18n/ko/aqpkg.ts \
- ../../../i18n/no/aqpkg.ts \
- ../../../i18n/pl/aqpkg.ts \
- ../../../i18n/pt/aqpkg.ts \
- ../../../i18n/pt_BR/aqpkg.ts \
- ../../../i18n/sl/aqpkg.ts \
- ../../../i18n/zh_CN/aqpkg.ts \
- ../../../i18n/zh_TW/aqpkg.ts \
- ../../../i18n/it/aqpkg.ts \
- ../../../i18n/da/aqpkg.ts
-
include ( $(OPIEDIR)/include.pro )
+
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp
index b7f8b7b..179f8b7 100644
--- a/noncore/settings/aqpkg/main.cpp
+++ b/noncore/settings/aqpkg/main.cpp
@@ -29,16 +29,5 @@
-#ifdef QWS
-#include <qpe/qpeapplication.h>
-#include <qpe/qcopenvelope_qws.h>
-#else
-#include <qapplication.h>
-#endif
-
-#include <qobjectdefs.h>
-
#include "mainwin.h"
-#include "server.h"
-
-#include "global.h"
+#include <opie/oapplicationfactory.h>
@@ -48,31 +37,2 @@ extern QString LOCAL_IPKGS;
-int main(int argc, char *argv[])
-{
-#ifdef QWS
- QPEApplication a( argc, argv );
-#else
- QApplication a( argc, argv );
-#endif
-
-#ifdef QWS
- // Disable suspend mode
- QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
-#endif
-
- LOCAL_SERVER = QObject::tr( "Installed packages" );
- LOCAL_IPKGS = QObject::tr( "Local packages" );
-
- MainWindow *win = new MainWindow();
- a.setMainWidget(win);
- win->showMaximized();
-
- a.exec();
-
-#ifdef QWS
- // Reenable suspend mode
- QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
-#endif
- #ifdef _DEBUG
- DumpUnfreed();
- #endif
-}
+OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 42093cf..dbe694e 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -2,3 +2,3 @@
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
@@ -68,5 +68,11 @@ extern int compareVersions( const char *v1, const char *v2 );
-MainWindow :: MainWindow()
- : QMainWindow( 0x0, 0x0, WStyle_ContextHelp )
+MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
+ : QMainWindow( parent, name, fl || WStyle_ContextHelp )
{
+ // Disable suspend mode
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
+
+ LOCAL_SERVER = QObject::tr( "Installed packages" );
+ LOCAL_IPKGS = QObject::tr( "Local packages" );
+
setCaption( tr( "AQPkg - Package Manager" ) );
@@ -236,2 +242,5 @@ MainWindow :: ~MainWindow()
delete mgr;
+
+ // Reenable suspend mode
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
}
@@ -1014,3 +1023,2 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
newitem->option = "D";
-
// If local file, remove using package name, not filename
@@ -1048,3 +1056,2 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
newitem->option = "D";
-
// If local file, remove using package name, not filename
@@ -1191,5 +1198,5 @@ QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QSt
resize( 175, 100 );
-
+
QGridLayout *layout = new QGridLayout( this );
-
+
QLabel *l = new QLabel( text, this );
@@ -1197,3 +1204,3 @@ QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QSt
layout->addMultiCellWidget( l, 0, 0, 0, 1 );
-
+
btn1 = new QPushButton( tr( "Remove" ), this );
@@ -1201,3 +1208,3 @@ QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QSt
layout->addWidget( btn1, 1, 0 );
-
+
btn2 = new QPushButton( secondbtn, this );
@@ -1205,3 +1212,3 @@ QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QSt
layout->addWidget( btn2, 1, 1 );
-
+
executing = FALSE;
@@ -1218,3 +1225,3 @@ int QuestionDlg::exec()
}
-
+
return buttonpressed;
@@ -1230,3 +1237,3 @@ void QuestionDlg::slotButtonPressed()
buttonpressed = 0;
-
+
qApp->exit_loop();
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index 615ff8b..b8e1c98 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -53,7 +53,8 @@ class MainWindow :public QMainWindow
{
- Q_OBJECT
+ Q_OBJECT
public:
- MainWindow();
+ MainWindow( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~MainWindow();
+ static QString appName() { return QString::fromLatin1( "aqpkg" ); };