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.cpp29
1 files changed, 25 insertions, 4 deletions
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
@@ -335,16 +335,33 @@ void MainWindow :: displaySettings()
if ( dlg->showDlg() )
{
stack->raiseWidget( progressWindow );
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();
}
void MainWindow :: displayJumpBar()
@@ -774,17 +791,18 @@ void MainWindow :: updateServer()
mgr->writeOutIpkgConf();
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()
{
// We're gonna do an upgrade of all packages
// First warn user that this isn't recommended
@@ -803,17 +821,18 @@ void MainWindow :: upgradePackages()
// Now run upgrade
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;
if ( downloadEnabled )
{
@@ -944,17 +963,18 @@ void MainWindow :: downloadRemotePackage()
item->option = "I";
item->packageName = package;
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 = "";
// First, write out ipkg_conf file so that ipkg can use it
@@ -982,17 +1002,18 @@ void MainWindow :: applyChanges()
tr( "No packages selected" ), tr( "OK" ) );
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
// If installed and version up to date - remove
InstallData *MainWindow :: dealWithItem( QCheckListItem *item )