summaryrefslogtreecommitdiff
path: root/noncore/settings
Side-by-side diff
Diffstat (limited to 'noncore/settings') (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
-rw-r--r--noncore/settings/sysinfo/main.cpp11
-rw-r--r--noncore/settings/sysinfo/storage.cpp27
-rw-r--r--noncore/settings/sysinfo/sysinfo.h1
-rw-r--r--noncore/settings/sysinfo/sysinfo.pro9
9 files changed, 43 insertions, 112 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
@@ -1,2 +1,3 @@
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,8 +1,7 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
HEADERS = global.h \
mainwin.h \
datamgr.h \
settingsimpl.h \
ipkg.h \
packagewin.h \
@@ -29,34 +28,13 @@ SOURCES = mainwin.cpp \
utils.cpp \
server.cpp \
letterpushbutton.cpp \
inputdlg.cpp \
version.cpp \
categoryfilterimpl.cpp
-INTERFACES =
TARGET = aqpkg
INCLUDEPATH += $(OPIEDIR)/include
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
@@ -24,55 +24,15 @@
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-#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>
/* be less intrusive for translation -zecke */
extern QString LOCAL_SERVER;
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
@@ -1,9 +1,9 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
@@ -63,15 +63,21 @@
#include "packagewin.h"
#include "settingsimpl.h"
#include "utils.h"
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" ) );
// Create UI widgets
initMainWidget();
initProgressWidget();
@@ -231,12 +237,15 @@ MainWindow :: MainWindow()
QTimer::singleShot( 100, this, SLOT( init() ) );
}
MainWindow :: ~MainWindow()
{
delete mgr;
+
+ // Reenable suspend mode
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
}
void MainWindow :: initMainWidget()
{
networkPkgWindow = new QWidget( this );
@@ -1009,13 +1018,12 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
return newitem;
}
else
{
InstallData *newitem = new InstallData();
newitem->option = "D";
-
// If local file, remove using package name, not filename
if ( p->isPackageStoredLocally() )
name = item->text();
if ( !p->isPackageStoredLocally() )
newitem->packageName = p->getInstalledPackageName();
@@ -1043,13 +1051,12 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
// Error - should handle
}
else if ( val == -1 )
{
// Version available is older - remove only
newitem->option = "D";
-
// If local file, remove using package name, not filename
if ( p->isPackageStoredLocally() )
name = item->text();
}
else
{
@@ -1186,48 +1193,48 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn )
: QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog )
{
setCaption( caption );
resize( 175, 100 );
-
+
QGridLayout *layout = new QGridLayout( this );
-
+
QLabel *l = new QLabel( text, this );
l->setAlignment( AlignCenter | WordBreak );
layout->addMultiCellWidget( l, 0, 0, 0, 1 );
-
+
btn1 = new QPushButton( tr( "Remove" ), this );
connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) );
layout->addWidget( btn1, 1, 0 );
-
+
btn2 = new QPushButton( secondbtn, this );
connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) );
layout->addWidget( btn2, 1, 1 );
-
+
executing = FALSE;
}
int QuestionDlg::exec()
{
show();
if ( !executing )
{
executing = TRUE;
qApp->enter_loop();
}
-
+
return buttonpressed;
}
void QuestionDlg::slotButtonPressed()
{
if ( sender() == btn1 )
buttonpressed = 1;
else if ( sender() == btn2 )
buttonpressed = 2;
else
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
@@ -48,17 +48,18 @@ class QToolBar;
class QProgressBar;
class QPushButton;
class QWidgetStack;
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" ); };
protected:
void closeEvent( QCloseEvent* e );
private:
DataManager *mgr;
diff --git a/noncore/settings/sysinfo/main.cpp b/noncore/settings/sysinfo/main.cpp
index 6e889db..02b1098 100644
--- a/noncore/settings/sysinfo/main.cpp
+++ b/noncore/settings/sysinfo/main.cpp
@@ -18,17 +18,10 @@
**
**********************************************************************/
#include "sysinfo.h"
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main( int argc, char *argv[] )
-{
- QPEApplication a( argc, argv );
-
- SystemInfo *si = new SystemInfo();
- a.showMainWidget( si );
-
- return a.exec();
-}
+OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> )
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index c4474d5..4ef7122 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -47,63 +47,55 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name )
container = new QWidget( sv->viewport() );
sv->addChild( container );
vb = 0x0;
storage = new StorageInfo( this );
connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) );
-
+
lines.setAutoDelete(TRUE);
rebuildDisks = TRUE;
updateMounts();
startTimer( 5000 );
}
+
void FileSysInfo::timerEvent(QTimerEvent*)
{
updateMounts();
}
void FileSysInfo::updateMounts()
{
storage->update();
-
+
if ( rebuildDisks )
{
- // Cannot auto delete QDict<MountInfo> disks because it seems to delete
- // the filesystem object as well causing a segfault
- MountInfo *mi;
- for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit )
- {
- mi = delit.current();
- mi->fs = 0x0;
- delete mi;
- }
disks.clear();
lines.clear();
-
+
delete vb;
vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ );
bool frst=TRUE;
-
+
FileSystem *fs;
for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it )
{
fs = it.current();
-
+
if ( !frst )
{
QFrame *f = new QFrame( container );
vb->addWidget(f);
f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
lines.append(f);
f->show();
}
frst = FALSE;
-
+
MountInfo *mi = new MountInfo( fs, container );
vb->addWidget( mi );
disks.insert( fs->path(), mi );
mi->show();
QString tempstr = fs->name().left( 2 );
if ( tempstr == tr( "CF" ) )
@@ -123,13 +115,13 @@ void FileSysInfo::updateMounts()
}
else
{
for (QDictIterator<MountInfo> i(disks); i.current(); ++i)
i.current()->updateData();
}
-
+
rebuildDisks = FALSE;
}
void FileSysInfo::disksChanged()
{
rebuildDisks = TRUE;
@@ -142,13 +134,13 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name )
totalSize = new QLabel( this );
vb->addWidget( totalSize );
fs = filesys;
title = fs->name();
-
+
data = new GraphData();
graph = new BarGraph( this );
graph->setFrameStyle( QFrame::Panel | QFrame::Sunken );
vb->addWidget( graph, 1 );
graph->setData( data );
@@ -160,13 +152,12 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name )
updateData();
}
MountInfo::~MountInfo()
{
delete data;
- delete fs;
}
void MountInfo::updateData()
{
long mult = fs->blockSize() / 1024;
long div = 1024 / fs->blockSize();
diff --git a/noncore/settings/sysinfo/sysinfo.h b/noncore/settings/sysinfo/sysinfo.h
index d69346a..94c3876 100644
--- a/noncore/settings/sysinfo/sysinfo.h
+++ b/noncore/settings/sysinfo/sysinfo.h
@@ -26,8 +26,9 @@
class SystemInfo : public QWidget
{
Q_OBJECT
public:
SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+ static QString appName() { return QString::fromLatin1("sysinfo"); }
};
diff --git a/noncore/settings/sysinfo/sysinfo.pro b/noncore/settings/sysinfo/sysinfo.pro
index 2582ea2..2322989 100644
--- a/noncore/settings/sysinfo/sysinfo.pro
+++ b/noncore/settings/sysinfo/sysinfo.pro
@@ -1,9 +1,7 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG = qt warn_on release quick-app
HEADERS = memory.h \
graph.h \
load.h \
storage.h \
processinfo.h \
modulesinfo.h \
@@ -17,17 +15,18 @@ SOURCES = main.cpp \
storage.cpp \
processinfo.cpp \
modulesinfo.cpp \
detail.cpp \
versioninfo.cpp \
sysinfo.cpp
-INTERFACES =
+
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
-TARGET = sysinfo
+
+TARGET = sysinfo
TRANSLATIONS = ../../../i18n/de/sysinfo.ts \
../../../i18n/nl/sysinfo.ts \
../../../i18n/xx/sysinfo.ts \
../../../i18n/en/sysinfo.ts \
../../../i18n/es/sysinfo.ts \