summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp31
1 files changed, 19 insertions, 12 deletions
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();
}