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 @@ -42,12 +42,13 @@ #include "categoryfilterimpl.h" #include "datamgr.h" #include "global.h" #include "helpwindow.h" #include "inputdlg.h" +#include "ipkg.h" #include "installdlgimpl.h" #include "letterpushbutton.h" #include "mainwin.h" #include "settingsimpl.h" #include "utils.h" @@ -85,30 +86,21 @@ MainWindow :: MainWindow() addToolBar( jumpBar, QMainWindow::Top, true ); jumpBar->setHorizontalStretchable( true ); QWidget *w = new QWidget( jumpBar ); jumpBar->setStretchableWidget( w ); 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]; text[1] = '\0'; for ( int i = 0 ; i < 26 ; ++i ) { text[0] = 'A' + i; LetterPushButton *b = new LetterPushButton( text, w ); 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 ); -*/ } QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); a->addTo( jumpBar ); @@ -795,19 +787,19 @@ void MainWindow :: updateServer() // Disable buttons to stop silly people clicking lots on them :) // First, write out ipkg_conf file so that ipkg can use it 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; } void MainWindow :: upgradePackages() { @@ -824,22 +816,23 @@ void MainWindow :: upgradePackages() if ( warn.exec() == QMessageBox::Yes ) { // First, write out ipkg_conf file so that ipkg can use it mgr->writeOutIpkgConf(); // 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; if ( downloadEnabled ) { // See if any packages are selected bool found = false; @@ -895,13 +888,13 @@ void MainWindow :: upgradePackages() } } } if ( doUpdate ) { - reloadData(); + reloadData( 0x0 ); } } void MainWindow :: downloadSelectedPackages() { // First, write out ipkg_conf file so that ipkg can use it @@ -967,23 +960,15 @@ void MainWindow :: downloadRemotePackage() InstallData item; item.option = "I"; item.packageName = package; vector<InstallData> workingPackages; 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(); } void MainWindow :: applyChanges() { stickyOption = ""; @@ -1013,23 +998,15 @@ void MainWindow :: applyChanges() tr( "No packages selected" ), tr( "OK" ) ); return; } // 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(); } // decide what to do - either remove, upgrade or install // Current rules: // If not installed - install // If installed and different version available - upgrade @@ -1147,17 +1124,34 @@ InstallData MainWindow :: dealWithItem( QCheckListItem *item ) // User hit cancel (on dlg - assume remove) return 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 ); } void MainWindow :: letterPushed( QString t ) { QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); |