summaryrefslogtreecommitdiff
authordrw <drw>2003-03-19 02:48:27 (UTC)
committer drw <drw>2003-03-19 02:48:27 (UTC)
commitf35989ef21fb5a27ebe6f6924ee2cc601318c1b8 (patch) (side-by-side diff)
treef169286f925c01758d1456027eb43743bb0cd162
parent06ddd131a6f33d341290617e71a14006fc9957a1 (diff)
downloadopie-f35989ef21fb5a27ebe6f6924ee2cc601318c1b8.zip
opie-f35989ef21fb5a27ebe6f6924ee2cc601318c1b8.tar.gz
opie-f35989ef21fb5a27ebe6f6924ee2cc601318c1b8.tar.bz2
Fix for bug #741
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp3
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.h0
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp29
-rw-r--r--noncore/settings/aqpkg/mainwin.h3
4 files changed, 30 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 1f0bb5f..2bb8b4d 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -180,13 +180,13 @@ void InstallDlgImpl :: init( bool displayextrainfo )
layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 );
btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this );
layout->addWidget( btnInstall, 3, 0 );
connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) );
- btnOptions = new QPushButton( Resource::loadPixmap( "aqpkg/config" ), tr( "Options" ), this );
+ btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this );
layout->addWidget( btnOptions, 3, 1 );
connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) );
}
void InstallDlgImpl :: optionsSelected()
{
@@ -227,12 +227,13 @@ void InstallDlgImpl :: installSelected()
// Disable buttons
btnOptions->setEnabled( false );
// btnInstall->setEnabled( false );
btnInstall->setText( tr( "Abort" ) );
btnInstall->setIconSet( Resource::loadPixmap( "close" ) );
+
if ( pIpkg )
{
output->setText( "" );
connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
pIpkg->runIpkg();
}
diff --git a/noncore/settings/aqpkg/installdlgimpl.h b/noncore/settings/aqpkg/installdlgimpl.h
index d7509bb..c30963e 100644
--- a/noncore/settings/aqpkg/installdlgimpl.h
+++ b/noncore/settings/aqpkg/installdlgimpl.h
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index dfe6d9c..7fa311d 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -338,12 +338,29 @@ void MainWindow :: displaySettings()
updateData();
stack->raiseWidget( networkPkgWindow );
}
delete dlg;
}
+void MainWindow :: closeEvent( QCloseEvent *e )
+{
+ // If install dialog is visible, return to main view, otherwise close app
+ QWidget *widget = stack->visibleWidget();
+
+ if ( widget != networkPkgWindow && widget != progressWindow )
+ {
+ if ( widget ) delete widget;
+ stack->raiseWidget( networkPkgWindow );
+ e->ignore();
+ }
+ else
+ {
+ e->accept();
+ }
+}
+
void MainWindow :: displayFindBar()
{
findBar->show();
findEdit->setFocus();
}
@@ -776,13 +793,14 @@ void MainWindow :: updateServer()
Ipkg *ipkg = new Ipkg;
ipkg->setOption( "update" );
InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ),
tr( "Update lists" ) );
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- dlg->showMaximized();
+ stack->addWidget( dlg, 3 );
+ stack->raiseWidget( dlg );
// delete progDlg;
}
void MainWindow :: upgradePackages()
{
@@ -805,13 +823,14 @@ void MainWindow :: upgradePackages()
Ipkg *ipkg = new Ipkg;
ipkg->setOption( "upgrade" );
InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ),
tr ( "Upgrade" ) );
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- dlg->showMaximized();
+ stack->addWidget( dlg, 3 );
+ stack->raiseWidget( dlg );
}
}
void MainWindow :: downloadPackage()
{
bool doUpdate = true;
@@ -946,13 +965,14 @@ void MainWindow :: downloadRemotePackage()
QList<InstallData> workingPackages;
workingPackages.setAutoDelete( TRUE );
workingPackages.append( item );
InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) );
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- dlg->showMaximized();
+ stack->addWidget( dlg, 3 );
+ stack->raiseWidget( dlg );
}
void MainWindow :: applyChanges()
{
stickyOption = "";
@@ -984,13 +1004,14 @@ void MainWindow :: applyChanges()
return;
}
// do the stuff
InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) );
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- dlg->showMaximized();
+ stack->addWidget( dlg, 3 );
+ stack->raiseWidget( dlg );
}
// decide what to do - either remove, upgrade or install
// Current rules:
// If not installed - install
// If installed and different version available - upgrade
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index d75e5d2..b2de871 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -40,12 +40,15 @@ class MainWindow :public QMainWindow
Q_OBJECT
public:
MainWindow();
~MainWindow();
+protected:
+ void closeEvent( QCloseEvent* e );
+
private:
DataManager *mgr;
QWidgetStack *stack;
QPEToolBar *findBar;