-rw-r--r-- | noncore/settings/aqpkg/.cvsignore | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 26 | ||||
-rw-r--r-- | noncore/settings/aqpkg/main.cpp | 44 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 15 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 3 | ||||
-rw-r--r-- | noncore/settings/sysinfo/main.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.h | 1 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.pro | 7 |
9 files changed, 25 insertions, 94 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,62 +1,40 @@ -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 \ package.h \ installdlgimpl.h \ instoptionsimpl.h \ destination.h \ utils.h \ server.h \ letterpushbutton.h \ inputdlg.h \ categoryfilterimpl.h SOURCES = mainwin.cpp \ datamgr.cpp \ mem.cpp \ settingsimpl.cpp \ ipkg.cpp \ main.cpp \ packagewin.cpp \ package.cpp \ installdlgimpl.cpp \ instoptionsimpl.cpp \ destination.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 @@ -14,65 +14,25 @@ .i_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General ..}^=.= = ; Public License for more details. ++= -. .` .: : = ...= . :.=- You should have received a copy of the GNU -. .:....=;==+<; General Public License along with this file; -_. . . )=. = see the file COPYING. If not, write to the -- :-=` 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 @@ -53,35 +53,41 @@ #include <qwidgetstack.h> #include "categoryfilterimpl.h" #include "datamgr.h" #include "global.h" #include "inputdlg.h" #include "ipkg.h" #include "installdlgimpl.h" #include "letterpushbutton.h" #include "mainwin.h" #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(); // Build menu and tool bars setToolBarsMovable( FALSE ); QToolBar *bar = new QToolBar( this ); bar->setHorizontalStretchable( TRUE ); QMenuBar *mb = new QMenuBar( bar ); mb->setMargin( 0 ); bar = new QToolBar( this ); // Find toolbar @@ -221,32 +227,35 @@ MainWindow :: MainWindow() findBar->hide(); // Create widget stack and add UI widgets stack = new QWidgetStack( this ); stack->addWidget( progressWindow, 2 ); stack->addWidget( networkPkgWindow, 1 ); setCentralWidget( stack ); stack->raiseWidget( progressWindow ); // Delayed call to finish initialization 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 ); QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); serversList = new QComboBox( networkPkgWindow ); connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) ); QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); installedIcon = Resource::loadPixmap( "installed" ); updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); packagesList = new QListView( networkPkgWindow ); @@ -999,33 +1008,32 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) if ( p->isPackageStoredLocally() ) name = p->getFilename(); QString option; QString dest = "root"; if ( !p->isInstalled() ) { InstallData *newitem = new InstallData(); newitem->option = "I"; newitem->packageName = name; 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(); else newitem->packageName = name; if ( p->getInstalledTo() ) { newitem->destination = p->getInstalledTo(); } else { newitem->destination = p->getLocalPackage()->getInstalledTo(); @@ -1033,33 +1041,32 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) // Now see if version is newer or not int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); // If the version requested is older and user selected a local ipk file, then reinstall the file if ( p->isPackageStoredLocally() && val == -1 ) val = 0; if ( val == -2 ) { // 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 { QString caption; QString text; QString secondButton; QString secondOption; if ( val == 0 ) { // Version available is the same - option to remove or reinstall caption = tr( "Do you wish to remove or reinstall\n%1?" ); text = tr( "Remove or ReInstall" ); secondButton = tr( "ReInstall" ); 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 @@ -41,34 +41,35 @@ class QAction; class QCheckListItem; class QComboBox; class QLabel; class QLineEdit; class QListView; class QListViewItem; class QToolBar; class QProgressBar; class QPushButton; class QWidgetStack; class MainWindow :public QMainWindow { 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; QWidgetStack *stack; QToolBar *findBar; QToolBar *jumpBar; QLineEdit *findEdit; QAction *actionFindNext; QAction *actionFilter; QAction *actionUpgrade; QAction *actionDownload; 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 @@ -8,27 +8,20 @@ ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #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 @@ -45,52 +45,44 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); 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 ); @@ -150,33 +142,32 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) graph = new BarGraph( this ); graph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); vb->addWidget( graph, 1 ); graph->setData( data ); legend = new GraphLegend( this ); legend->setOrientation(Horizontal); vb->addWidget( legend ); legend->setData( data ); updateData(); } MountInfo::~MountInfo() { delete data; - delete fs; } void MountInfo::updateData() { long mult = fs->blockSize() / 1024; long div = 1024 / fs->blockSize(); if ( !mult ) mult = 1; if ( !div ) div = 1; long total = fs->totalBlocks() * mult / div; long avail = fs->availBlocks() * mult / div; long used = total - avail; totalSize->setText( title + tr(" : %1 kB").arg( total ) ); data->clear(); data->addItem( tr("Used (%1 kB)").arg(used), used ); data->addItem( tr("Available (%1 kB)").arg(avail), avail ); graph->repaint( FALSE ); 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 @@ -16,18 +16,19 @@ ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** ********************************************************************** ** ** Enhancements by: Dan Williams, <williamsdr@acm.org> ** **********************************************************************/ #include <qwidget.h> 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,42 +1,41 @@ -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 \ detail.h \ versioninfo.h \ sysinfo.h SOURCES = main.cpp \ memory.cpp \ graph.cpp \ load.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 TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ ../../../i18n/nl/sysinfo.ts \ ../../../i18n/xx/sysinfo.ts \ ../../../i18n/en/sysinfo.ts \ ../../../i18n/es/sysinfo.ts \ ../../../i18n/fr/sysinfo.ts \ ../../../i18n/hu/sysinfo.ts \ ../../../i18n/ja/sysinfo.ts \ ../../../i18n/ko/sysinfo.ts \ ../../../i18n/no/sysinfo.ts \ ../../../i18n/pl/sysinfo.ts \ ../../../i18n/pt/sysinfo.ts \ ../../../i18n/pt_BR/sysinfo.ts \ ../../../i18n/sl/sysinfo.ts \ |