summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-22 18:00:55 (UTC)
committer andyq <andyq>2002-10-22 18:00:55 (UTC)
commitd7cca919f20d602bd755b7690c25e31f6e9520b1 (patch) (side-by-side diff)
treeb5ffe24d905ace7563c21be0eea06b39402430aa
parent6843a1bd8f8e679c220431f8377abcd2ffd2019b (diff)
downloadopie-d7cca919f20d602bd755b7690c25e31f6e9520b1.zip
opie-d7cca919f20d602bd755b7690c25e31f6e9520b1.tar.gz
opie-d7cca919f20d602bd755b7690c25e31f6e9520b1.tar.bz2
Changed so that refreshing server packages shows status dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp58
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.h4
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp5
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp23
4 files changed, 46 insertions, 44 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index e122064..a924daf 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -99,12 +99,9 @@ InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *d
output->setText( remove + install + upgrade );
-
- connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
}
-InstallDlgImpl::InstallDlgImpl( QWidget *parent, const char *name, bool modal, WFlags fl )
+InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl )
: InstallDlg( parent, name, modal, fl )
{
- upgradePackages = true;
- output->setText( "Upgrading installed packages" );
- connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
+ pIpkg = ipkg;
+ output->setText( initialText );
}
@@ -157,3 +154,3 @@ void InstallDlgImpl :: installSelected()
- if ( upgradePackages )
+ if ( pIpkg )
{
@@ -161,6 +158,4 @@ void InstallDlgImpl :: installSelected()
- Ipkg ipkg;
- connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
- ipkg.setOption( "upgrade" );
- ipkg.runIpkg();
+ connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
+ pIpkg->runIpkg();
}
@@ -183,10 +178,13 @@ void InstallDlgImpl :: installSelected()
+ pIpkg = new Ipkg;
+ connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
+
// First run through the remove list, then the install list then the upgrade list
vector<InstallData>::iterator it;
- ipkg.setOption( "remove" );
+ pIpkg->setOption( "remove" );
for ( it = removeList.begin() ; it != removeList.end() ; ++it )
{
- ipkg.setDestination( it->destination->getDestinationName() );
- ipkg.setDestinationDir( it->destination->getDestinationPath() );
- ipkg.setPackage( it->packageName );
+ pIpkg->setDestination( it->destination->getDestinationName() );
+ pIpkg->setDestinationDir( it->destination->getDestinationPath() );
+ pIpkg->setPackage( it->packageName );
@@ -196,14 +194,14 @@ void InstallDlgImpl :: installSelected()
- ipkg.setFlags( tmpFlags );
- ipkg.runIpkg();
+ pIpkg->setFlags( tmpFlags );
+ pIpkg->runIpkg();
}
- ipkg.setOption( "install" );
- ipkg.setDestination( dest );
- ipkg.setDestinationDir( destDir );
- ipkg.setFlags( instFlags );
+ pIpkg->setOption( "install" );
+ pIpkg->setDestination( dest );
+ pIpkg->setDestinationDir( destDir );
+ pIpkg->setFlags( instFlags );
for ( it = installList.begin() ; it != installList.end() ; ++it )
{
- ipkg.setPackage( it->packageName );
- ipkg.runIpkg();
+ pIpkg->setPackage( it->packageName );
+ pIpkg->runIpkg();
}
@@ -211,8 +209,8 @@ void InstallDlgImpl :: installSelected()
flags |= FORCE_REINSTALL;
- ipkg.setOption( "reinstall" );
+ pIpkg->setOption( "reinstall" );
for ( it = updateList.begin() ; it != updateList.end() ; ++it )
{
- ipkg.setDestination( it->destination->getDestinationName() );
- ipkg.setDestinationDir( it->destination->getDestinationPath() );
- ipkg.setPackage( it->packageName );
+ pIpkg->setDestination( it->destination->getDestinationName() );
+ pIpkg->setDestinationDir( it->destination->getDestinationPath() );
+ pIpkg->setPackage( it->packageName );
@@ -221,5 +219,7 @@ void InstallDlgImpl :: installSelected()
tmpFlags |= MAKE_LINKS;
- ipkg.setFlags( tmpFlags );
- ipkg.runIpkg();
+ pIpkg->setFlags( tmpFlags );
+ pIpkg->runIpkg();
}
+
+ delete pIpkg;
}
diff --git a/noncore/settings/aqpkg/installdlgimpl.h b/noncore/settings/aqpkg/installdlgimpl.h
index 3a5d8b8..6716ced 100644
--- a/noncore/settings/aqpkg/installdlgimpl.h
+++ b/noncore/settings/aqpkg/installdlgimpl.h
@@ -40,3 +40,3 @@ public:
InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
- InstallDlgImpl( QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
+ InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
~InstallDlgImpl();
@@ -54,3 +54,3 @@ private:
int flags;
- Ipkg ipkg;
+ Ipkg *pIpkg;
bool upgradePackages;
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 02d4258..eacef76 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -107,4 +107,5 @@ bool Ipkg :: runIpkg( )
-
- emit outputText( QString( "Dealing with package " ) + package );
+
+ if ( package != "" )
+ emit outputText( QString( "Dealing with package " ) + package );
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 52d95a8..6874ded 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -270,6 +270,6 @@ void NetworkPackageManager :: updateServer()
// Display dialog
- ProgressDlg *dlg = new ProgressDlg( this );
- QString status = "Updating package lists...";
- dlg->show();
- dlg->setText( status );
+// ProgressDlg *progDlg = new ProgressDlg( this );
+// QString status = "Updating package lists...";
+// progDlg->show();
+// progDlg->setText( status );
@@ -280,9 +280,7 @@ void NetworkPackageManager :: updateServer()
- QString option = "update";
- QString dummy = "";
Ipkg ipkg;
- connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
- ipkg.setOption( option );
+ ipkg.setOption( "update" );
- ipkg.runIpkg( );
+ InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true );
+ dlg.showDlg();
@@ -291,3 +289,3 @@ void NetworkPackageManager :: updateServer()
serverSelected(-1);
- delete dlg;
+// delete progDlg;
}
@@ -311,3 +309,6 @@ void NetworkPackageManager :: upgradePackages()
// Now run upgrade
- InstallDlgImpl dlg( this, "Upgrade", true );
+ Ipkg ipkg;
+ ipkg.setOption( "upgrade" );
+
+ InstallDlgImpl dlg( &ipkg, "Upgrading installed packages", this, "Upgrade", true );
dlg.showDlg();