author | drw <drw> | 2003-02-01 02:07:22 (UTC) |
---|---|---|
committer | drw <drw> | 2003-02-01 02:07:22 (UTC) |
commit | 766f09a89eef17808e77836f76371aab8ebc4c1c (patch) (side-by-side diff) | |
tree | 3a298c40d5b688dc409a0e6d251a514d88eada48 /noncore/settings/aqpkg/mainwin.cpp | |
parent | 266feac1ac442947651bf169dbf993c4d46d56ea (diff) | |
download | opie-766f09a89eef17808e77836f76371aab8ebc4c1c.zip opie-766f09a89eef17808e77836f76371aab8ebc4c1c.tar.gz opie-766f09a89eef17808e77836f76371aab8ebc4c1c.tar.bz2 |
Many updates to install dialog
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 86 |
1 files changed, 40 insertions, 46 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index a25f5a7..947aace 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -46,4 +46,5 @@ #include "helpwindow.h" #include "inputdlg.h" +#include "ipkg.h" #include "installdlgimpl.h" #include "letterpushbutton.h" @@ -89,7 +90,4 @@ MainWindow :: MainWindow() QGridLayout *layout = new QGridLayout( w ); - //QVBoxLayout *vbox = new QVBoxLayout( w, 0, -1 ); - //QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1 ); - //QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1 ); char text[2]; @@ -101,10 +99,4 @@ MainWindow :: MainWindow() connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); layout->addWidget( b, i / 13, i % 13); -/* - if ( i < 13 ) - hbox3->addWidget( b ); - else - hbox4->addWidget( b ); -*/ } @@ -799,11 +791,11 @@ void MainWindow :: updateServer() mgr->writeOutIpkgConf(); - Ipkg ipkg; - ipkg.setOption( "update" ); - - InstallDlgImpl dlg( &ipkg, tr( "Refreshing server package lists" ), this, tr( "Upgrade" ), true ); - dlg.showDlg(); + Ipkg *ipkg = new Ipkg; + ipkg->setOption( "update" ); - reloadData(); + InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), + tr( "Update lists" ) ); + connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); + dlg->showMaximized(); // delete progDlg; @@ -828,14 +820,15 @@ void MainWindow :: upgradePackages() // Now run upgrade - Ipkg ipkg; - ipkg.setOption( "upgrade" ); - - InstallDlgImpl dlg( &ipkg, tr( "Upgrading installed packages" ), this, tr( "Upgrade" ), true ); - dlg.showDlg(); + Ipkg *ipkg = new Ipkg; + ipkg->setOption( "upgrade" ); - reloadData(); + InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), + tr ( "Upgrade" ) ); + connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); + dlg->showMaximized(); } } - void MainWindow :: downloadPackage() + +void MainWindow :: downloadPackage() { bool doUpdate = true; @@ -899,5 +892,5 @@ void MainWindow :: upgradePackages() if ( doUpdate ) { - reloadData(); + reloadData( 0x0 ); } } @@ -971,15 +964,7 @@ void MainWindow :: downloadRemotePackage() workingPackages.push_back( item ); - InstallDlgImpl dlg2( workingPackages, mgr, this, "Install", true ); - dlg2.showDlg(); - - reloadData(); - -#ifdef QWS - // Finally let the main system update itself - QCopEnvelope e("QPE/System", "linkChanged(QString)"); - QString lf = QString::null; - e << lf; -#endif + InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); + connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); + dlg->showMaximized(); } @@ -1017,15 +1002,7 @@ void MainWindow :: applyChanges() // do the stuff - InstallDlgImpl dlg( workingPackages, mgr, this, "Install", true ); - dlg.showDlg(); - - reloadData(); - -#ifdef QWS - // Finally let the main system update itself - QCopEnvelope e("QPE/System", "linkChanged(QString)"); - QString lf = QString::null; - e << lf; -#endif + InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); + connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); + dlg->showMaximized(); } @@ -1151,9 +1128,26 @@ InstallData MainWindow :: dealWithItem( QCheckListItem *item ) } -void MainWindow :: reloadData() +void MainWindow :: reloadData( InstallDlgImpl *dlg ) { stack->raiseWidget( progressWindow ); + + if ( dlg ) + { + dlg->close(); + delete dlg; + } + mgr->reloadServerData(); serverSelected( -1, FALSE ); + +#ifdef QWS + m_status->setText( tr( "Updating Launcher..." ) ); + + // Finally let the main system update itself + QCopEnvelope e("QPE/System", "linkChanged(QString)"); + QString lf = QString::null; + e << lf; +#endif + stack->raiseWidget( networkPkgWindow ); } |