From 34ca473739286557b3d0c73525740f0b8b01fd4b Mon Sep 17 00:00:00 2001 From: andyq Date: Fri, 22 Nov 2002 16:11:49 +0000 Subject: Added verbose_wget flags (doesn't yet work properly though coz ipkg is sending crap) --- diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index db9a259..485fe3d 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp @@ -17,6 +17,7 @@ #ifdef QWS #include +#include #endif #include @@ -91,15 +92,15 @@ InstallDlgImpl::InstallDlgImpl( vector &packageList, DataManager *d } else if ( item.option == "U" || item.option == "R" ) { - updateList.push_back( item ); + updateList.push_back( item ); QString type = " (Upgrade)"; if ( item.option == "R" ) type = " (ReInstall)"; - upgrade += " " + item.packageName + type + "\n"; - } - } + upgrade += " " + item.packageName + type + "\n"; + } + } - output->setText( remove + install + upgrade ); + output->setText( remove + install + upgrade ); } InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) @@ -116,27 +117,19 @@ InstallDlgImpl::~InstallDlgImpl() bool InstallDlgImpl :: showDlg() { - showMaximized(); - bool ret = exec(); + showMaximized(); + bool ret = exec(); - return ret; + return ret; } void InstallDlgImpl :: optionsSelected() { - InstallOptionsDlgImpl opt( flags, this, "Option", true ); - opt.exec(); - - // set options selected from dialog - flags = 0; - if ( opt.forceDepends->isChecked() ) - flags |= FORCE_DEPENDS; - if ( opt.forceReinstall->isChecked() ) - flags |= FORCE_REINSTALL; - if ( opt.forceRemove->isChecked() ) - flags |= FORCE_REMOVE; - if ( opt.forceOverwrite->isChecked() ) - flags |= FORCE_OVERWRITE; + InstallOptionsDlgImpl opt( flags, this, "Option", true ); + opt.exec(); + + // set options selected from dialog + flags = opt.getFlags(); #ifdef QWS Config cfg( "aqpkg" ); @@ -147,13 +140,16 @@ void InstallDlgImpl :: optionsSelected() void InstallDlgImpl :: installSelected() { - if ( btnInstall->text() == "Close" ) - { - done( 1 ); - return; - } + + if ( btnInstall->text() == "Close" ) + { + done( 1 ); + return; + } - btnInstall->setEnabled( false ); + // Disable buttons + btnOptions->setEnabled( false ); + btnInstall->setEnabled( false ); if ( pIpkg ) { @@ -183,7 +179,7 @@ void InstallDlgImpl :: installSelected() 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::iterator it; + vector::iterator it; pIpkg->setOption( "remove" ); for ( it = removeList.begin() ; it != removeList.end() ; ++it ) { @@ -230,7 +226,8 @@ void InstallDlgImpl :: installSelected() delete pIpkg; } - btnInstall->setEnabled( true ); + btnOptions->setEnabled( true ); + btnInstall->setEnabled( true ); btnInstall->setText( tr( "Close" ) ); } diff --git a/noncore/settings/aqpkg/instoptions.ui b/noncore/settings/aqpkg/instoptions.ui index 52897dd..00eab1e 100644 --- a/noncore/settings/aqpkg/instoptions.ui +++ b/noncore/settings/aqpkg/instoptions.ui @@ -11,8 +11,8 @@ 0 0 - 154 - 205 + 283 + 274 @@ -23,126 +23,138 @@ sizeGripEnabled false - - QGroupBox + - name - GroupBox1 + margin + 11 - geometry - - 11 - 11 - 136 - 120 - - - - title - Options + spacing + 6 - QCheckBox + QGroupBox name - forceDepends + GroupBox1 - geometry - - 11 - 19 - 114 - 19 - - - - text - Force Depends + title + Options + + QCheckBox + + name + forceDepends + + + geometry + + 12 + 20 + 110 + 19 + + + + text + Force Depends + + + + QCheckBox + + name + forceReinstall + + + geometry + + 12 + 45 + 107 + 19 + + + + text + Force Reinstall + + + + QCheckBox + + name + forceRemove + + + geometry + + 12 + 70 + 105 + 19 + + + + text + Force Remove + + + + QCheckBox + + name + forceOverwrite + + + geometry + + 12 + 95 + 114 + 19 + + + + text + Force Overwrite + + + + QCheckBox + + name + verboseWget + + + geometry + + 12 + 120 + 104 + 19 + + + + text + Verbose WGet + + - QCheckBox + QPushButton name - forceReinstall - - - geometry - - 11 - 44 - 114 - 19 - - - - text - Force Reinstall - - - - QCheckBox - - name - forceOverwrite - - - geometry - - 11 - 94 - 114 - 19 - + btnOK text - Force Overwrite + OK - - QCheckBox - - name - forceRemove - - - geometry - - 11 - 69 - 114 - 19 - - - - text - Force Remove - - - - - QPushButton - - name - btnOK - - - geometry - - 11 - 166 - 136 - 28 - - - - text - OK - - + diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp index dd996e0..3a37eec 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.cpp +++ b/noncore/settings/aqpkg/instoptionsimpl.cpp @@ -37,6 +37,8 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const forceRemove->setChecked( true ); if ( flags & FORCE_OVERWRITE ) forceOverwrite->setChecked( true ); + if ( flags & VERBOSE_WGET ) + verboseWget->setChecked( true ); // if ( flags & MAKE_LINKS ) // makeLinks->setChecked( true ); @@ -47,3 +49,22 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const InstallOptionsDlgImpl::~InstallOptionsDlgImpl() { } + + +int InstallOptionsDlgImpl :: getFlags() +{ + int flags = 0; + + if ( forceDepends->isChecked() ) + flags |= FORCE_DEPENDS; + if ( forceReinstall->isChecked() ) + flags |= FORCE_REINSTALL; + if ( forceRemove->isChecked() ) + flags |= FORCE_REMOVE; + if ( forceOverwrite->isChecked() ) + flags |= FORCE_OVERWRITE; + if ( verboseWget->isChecked() ) + flags |= VERBOSE_WGET; + + return flags; +} \ No newline at end of file diff --git a/noncore/settings/aqpkg/instoptionsimpl.h b/noncore/settings/aqpkg/instoptionsimpl.h index 08ec616..893f9bb 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.h +++ b/noncore/settings/aqpkg/instoptionsimpl.h @@ -24,6 +24,7 @@ class InstallOptionsDlgImpl : public InstallOptionsDlg public: InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); ~InstallOptionsDlgImpl(); + int getFlags(); protected: -- cgit v0.9.0.2