summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
Unidiff
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
@@ -339,8 +339,25 @@ void MainWindow :: displaySettings()
339 stack->raiseWidget( networkPkgWindow ); 339 stack->raiseWidget( networkPkgWindow );
340 } 340 }
341 delete dlg; 341 delete dlg;
342} 342}
343
344void MainWindow :: closeEvent( QCloseEvent *e )
345{
346 // If install dialog is visible, return to main view, otherwise close app
347 QWidget *widget = stack->visibleWidget();
348
349 if ( widget != networkPkgWindow && widget != progressWindow )
350 {
351 if ( widget ) delete widget;
352 stack->raiseWidget( networkPkgWindow );
353 e->ignore();
354 }
355 else
356 {
357 e->accept();
358 }
359}
343 360
344void MainWindow :: displayFindBar() 361void MainWindow :: displayFindBar()
345{ 362{
346 findBar->show(); 363 findBar->show();
@@ -778,9 +795,10 @@ void MainWindow :: updateServer()
778 795
779 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), 796 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ),
780 tr( "Update lists" ) ); 797 tr( "Update lists" ) );
781 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 798 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
782 dlg->showMaximized(); 799 stack->addWidget( dlg, 3 );
800 stack->raiseWidget( dlg );
783 801
784// delete progDlg; 802// delete progDlg;
785} 803}
786 804
@@ -807,9 +825,10 @@ void MainWindow :: upgradePackages()
807 825
808 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), 826 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ),
809 tr ( "Upgrade" ) ); 827 tr ( "Upgrade" ) );
810 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 828 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
811 dlg->showMaximized(); 829 stack->addWidget( dlg, 3 );
830 stack->raiseWidget( dlg );
812 } 831 }
813} 832}
814 833
815void MainWindow :: downloadPackage() 834void MainWindow :: downloadPackage()
@@ -948,9 +967,10 @@ void MainWindow :: downloadRemotePackage()
948 workingPackages.append( item ); 967 workingPackages.append( item );
949 968
950 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); 969 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) );
951 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 970 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
952 dlg->showMaximized(); 971 stack->addWidget( dlg, 3 );
972 stack->raiseWidget( dlg );
953} 973}
954 974
955 975
956void MainWindow :: applyChanges() 976void MainWindow :: applyChanges()
@@ -986,9 +1006,10 @@ void MainWindow :: applyChanges()
986 1006
987 // do the stuff 1007 // do the stuff
988 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); 1008 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) );
989 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 1009 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
990 dlg->showMaximized(); 1010 stack->addWidget( dlg, 3 );
1011 stack->raiseWidget( dlg );
991} 1012}
992 1013
993// decide what to do - either remove, upgrade or install 1014// decide what to do - either remove, upgrade or install
994// Current rules: 1015// Current rules: