author | drw <drw> | 2003-03-19 02:48:27 (UTC) |
---|---|---|
committer | drw <drw> | 2003-03-19 02:48:27 (UTC) |
commit | f35989ef21fb5a27ebe6f6924ee2cc601318c1b8 (patch) (unidiff) | |
tree | f169286f925c01758d1456027eb43743bb0cd162 | |
parent | 06ddd131a6f33d341290617e71a14006fc9957a1 (diff) | |
download | opie-f35989ef21fb5a27ebe6f6924ee2cc601318c1b8.zip opie-f35989ef21fb5a27ebe6f6924ee2cc601318c1b8.tar.gz opie-f35989ef21fb5a27ebe6f6924ee2cc601318c1b8.tar.bz2 |
Fix for bug #741
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 3 | ||||
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.h | 0 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 29 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 3 |
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 | |||
@@ -178,17 +178,17 @@ void InstallDlgImpl :: init( bool displayextrainfo ) | |||
178 | output = new QMultiLineEdit( GroupBox2 ); | 178 | output = new QMultiLineEdit( GroupBox2 ); |
179 | GroupBox2Layout->addWidget( output ); | 179 | GroupBox2Layout->addWidget( output ); |
180 | layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 ); | 180 | layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 ); |
181 | 181 | ||
182 | btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this ); | 182 | btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this ); |
183 | layout->addWidget( btnInstall, 3, 0 ); | 183 | layout->addWidget( btnInstall, 3, 0 ); |
184 | connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); | 184 | connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); |
185 | 185 | ||
186 | btnOptions = new QPushButton( Resource::loadPixmap( "aqpkg/config" ), tr( "Options" ), this ); | 186 | btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); |
187 | layout->addWidget( btnOptions, 3, 1 ); | 187 | layout->addWidget( btnOptions, 3, 1 ); |
188 | connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) ); | 188 | connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) ); |
189 | } | 189 | } |
190 | 190 | ||
191 | void InstallDlgImpl :: optionsSelected() | 191 | void InstallDlgImpl :: optionsSelected() |
192 | { | 192 | { |
193 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 193 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); |
194 | opt.exec(); | 194 | opt.exec(); |
@@ -225,16 +225,17 @@ void InstallDlgImpl :: installSelected() | |||
225 | } | 225 | } |
226 | 226 | ||
227 | // Disable buttons | 227 | // Disable buttons |
228 | btnOptions->setEnabled( false ); | 228 | btnOptions->setEnabled( false ); |
229 | // btnInstall->setEnabled( false ); | 229 | // btnInstall->setEnabled( false ); |
230 | 230 | ||
231 | btnInstall->setText( tr( "Abort" ) ); | 231 | btnInstall->setText( tr( "Abort" ) ); |
232 | btnInstall->setIconSet( Resource::loadPixmap( "close" ) ); | 232 | btnInstall->setIconSet( Resource::loadPixmap( "close" ) ); |
233 | |||
233 | if ( pIpkg ) | 234 | if ( pIpkg ) |
234 | { | 235 | { |
235 | output->setText( "" ); | 236 | output->setText( "" ); |
236 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); | 237 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); |
237 | pIpkg->runIpkg(); | 238 | pIpkg->runIpkg(); |
238 | } | 239 | } |
239 | else | 240 | else |
240 | { | 241 | { |
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 | |||
@@ -336,16 +336,33 @@ void MainWindow :: displaySettings() | |||
336 | { | 336 | { |
337 | stack->raiseWidget( progressWindow ); | 337 | stack->raiseWidget( progressWindow ); |
338 | updateData(); | 338 | updateData(); |
339 | stack->raiseWidget( networkPkgWindow ); | 339 | stack->raiseWidget( networkPkgWindow ); |
340 | } | 340 | } |
341 | delete dlg; | 341 | delete dlg; |
342 | } | 342 | } |
343 | 343 | ||
344 | void 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 | } | ||
360 | |||
344 | void MainWindow :: displayFindBar() | 361 | void MainWindow :: displayFindBar() |
345 | { | 362 | { |
346 | findBar->show(); | 363 | findBar->show(); |
347 | findEdit->setFocus(); | 364 | findEdit->setFocus(); |
348 | } | 365 | } |
349 | 366 | ||
350 | void MainWindow :: displayJumpBar() | 367 | void MainWindow :: displayJumpBar() |
351 | { | 368 | { |
@@ -774,17 +791,18 @@ void MainWindow :: updateServer() | |||
774 | mgr->writeOutIpkgConf(); | 791 | mgr->writeOutIpkgConf(); |
775 | 792 | ||
776 | Ipkg *ipkg = new Ipkg; | 793 | Ipkg *ipkg = new Ipkg; |
777 | ipkg->setOption( "update" ); | 794 | ipkg->setOption( "update" ); |
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 | ||
787 | void MainWindow :: upgradePackages() | 805 | void MainWindow :: upgradePackages() |
788 | { | 806 | { |
789 | // We're gonna do an upgrade of all packages | 807 | // We're gonna do an upgrade of all packages |
790 | // First warn user that this isn't recommended | 808 | // First warn user that this isn't recommended |
@@ -803,17 +821,18 @@ void MainWindow :: upgradePackages() | |||
803 | 821 | ||
804 | // Now run upgrade | 822 | // Now run upgrade |
805 | Ipkg *ipkg = new Ipkg; | 823 | Ipkg *ipkg = new Ipkg; |
806 | ipkg->setOption( "upgrade" ); | 824 | ipkg->setOption( "upgrade" ); |
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 | ||
815 | void MainWindow :: downloadPackage() | 834 | void MainWindow :: downloadPackage() |
816 | { | 835 | { |
817 | bool doUpdate = true; | 836 | bool doUpdate = true; |
818 | if ( downloadEnabled ) | 837 | if ( downloadEnabled ) |
819 | { | 838 | { |
@@ -944,17 +963,18 @@ void MainWindow :: downloadRemotePackage() | |||
944 | item->option = "I"; | 963 | item->option = "I"; |
945 | item->packageName = package; | 964 | item->packageName = package; |
946 | QList<InstallData> workingPackages; | 965 | QList<InstallData> workingPackages; |
947 | workingPackages.setAutoDelete( TRUE ); | 966 | workingPackages.setAutoDelete( TRUE ); |
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 | ||
956 | void MainWindow :: applyChanges() | 976 | void MainWindow :: applyChanges() |
957 | { | 977 | { |
958 | stickyOption = ""; | 978 | stickyOption = ""; |
959 | 979 | ||
960 | // First, write out ipkg_conf file so that ipkg can use it | 980 | // First, write out ipkg_conf file so that ipkg can use it |
@@ -982,17 +1002,18 @@ void MainWindow :: applyChanges() | |||
982 | tr( "No packages selected" ), tr( "OK" ) ); | 1002 | tr( "No packages selected" ), tr( "OK" ) ); |
983 | 1003 | ||
984 | return; | 1004 | return; |
985 | } | 1005 | } |
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: |
995 | // If not installed - install | 1016 | // If not installed - install |
996 | // If installed and different version available - upgrade | 1017 | // If installed and different version available - upgrade |
997 | // If installed and version up to date - remove | 1018 | // If installed and version up to date - remove |
998 | InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | 1019 | InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) |
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 | |||
@@ -38,16 +38,19 @@ class QWidgetStack; | |||
38 | class MainWindow :public QMainWindow | 38 | class MainWindow :public QMainWindow |
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | public: | 41 | public: |
42 | 42 | ||
43 | MainWindow(); | 43 | MainWindow(); |
44 | ~MainWindow(); | 44 | ~MainWindow(); |
45 | 45 | ||
46 | protected: | ||
47 | void closeEvent( QCloseEvent* e ); | ||
48 | |||
46 | private: | 49 | private: |
47 | DataManager *mgr; | 50 | DataManager *mgr; |
48 | 51 | ||
49 | QWidgetStack *stack; | 52 | QWidgetStack *stack; |
50 | 53 | ||
51 | QPEToolBar *findBar; | 54 | QPEToolBar *findBar; |
52 | QPEToolBar *jumpBar; | 55 | QPEToolBar *jumpBar; |
53 | QLineEdit *findEdit; | 56 | QLineEdit *findEdit; |