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,7 +1,7 @@
/*
                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
@@ -65,11 +65,17 @@
#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();
@@ -233,8 +239,11 @@ MainWindow :: MainWindow()
MainWindow :: ~MainWindow()
{
delete mgr;
+
+ // Reenable suspend mode
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
}
void MainWindow :: initMainWidget()
{
@@ -1011,9 +1020,8 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
else
{
InstallData *newitem = new InstallData();
newitem->option = "D";
-
// If local file, remove using package name, not filename
if ( p->isPackageStoredLocally() )
name = item->text();
@@ -1045,9 +1053,8 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
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();
}
@@ -1188,23 +1195,23 @@ QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QSt
: 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()
@@ -1215,9 +1222,9 @@ int QuestionDlg::exec()
{
executing = TRUE;
qApp->enter_loop();
}
-
+
return buttonpressed;
}
void QuestionDlg::slotButtonPressed()
@@ -1227,7 +1234,7 @@ void QuestionDlg::slotButtonPressed()
else if ( sender() == btn2 )
buttonpressed = 2;
else
buttonpressed = 0;
-
+
qApp->exit_loop();
}