-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 58 | ||||
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.h | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.h | 5 | ||||
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/aqpkg/ipkg.h | 3 |
6 files changed, 79 insertions, 21 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index 2bb8b4d..76d0a80 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -17,7 +17,10 @@ | |||
17 | 17 | ||
18 | #include <stdio.h> | 18 | #include <stdio.h> |
19 | |||
20 | #include <opie/ofiledialog.h> | ||
19 | 21 | ||
20 | #ifdef QWS | 22 | #ifdef QWS |
21 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/fileselector.h> | ||
22 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
23 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
@@ -28,4 +31,5 @@ | |||
28 | #include <qcombobox.h> | 31 | #include <qcombobox.h> |
29 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qfileinfo.h> | ||
30 | #include <qgroupbox.h> | 34 | #include <qgroupbox.h> |
31 | #include <qmultilineedit.h> | 35 | #include <qmultilineedit.h> |
@@ -64,4 +68,5 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da | |||
64 | // Grab flags - Turn MAKE_LINKS on by default (if no flags found) | 68 | // Grab flags - Turn MAKE_LINKS on by default (if no flags found) |
65 | flags = cfg.readNumEntry( "installFlags", 0 ); | 69 | flags = cfg.readNumEntry( "installFlags", 0 ); |
70 | infoLevel = cfg.readNumEntry( "infoLevel", 1 ); | ||
66 | #else | 71 | #else |
67 | flags = 0; | 72 | flags = 0; |
@@ -191,15 +196,43 @@ void InstallDlgImpl :: init( bool displayextrainfo ) | |||
191 | void InstallDlgImpl :: optionsSelected() | 196 | void InstallDlgImpl :: optionsSelected() |
192 | { | 197 | { |
193 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 198 | if ( btnOptions->text() == tr( "Options" ) ) |
194 | opt.exec(); | 199 | { |
195 | 200 | InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true ); | |
196 | // set options selected from dialog | 201 | if ( opt.exec() == QDialog::Accepted ) |
197 | flags = opt.getFlags(); | 202 | { |
203 | // set options selected from dialog | ||
204 | flags = opt.getFlags(); | ||
205 | infoLevel = opt.getInfoLevel(); | ||
198 | 206 | ||
199 | #ifdef QWS | 207 | #ifdef QWS |
200 | Config cfg( "aqpkg" ); | 208 | Config cfg( "aqpkg" ); |
201 | cfg.setGroup( "settings" ); | 209 | cfg.setGroup( "settings" ); |
202 | cfg.writeEntry( "installFlags", flags ); | 210 | cfg.writeEntry( "installFlags", flags ); |
211 | cfg.writeEntry( "infoLevel", infoLevel ); | ||
203 | #endif | 212 | #endif |
213 | } | ||
214 | } | ||
215 | else // Save output | ||
216 | { | ||
217 | QMap<QString, QStringList> map; | ||
218 | map.insert( tr( "All" ), QStringList() ); | ||
219 | QStringList text; | ||
220 | text << "text/*"; | ||
221 | map.insert(tr( "Text" ), text ); | ||
222 | text << "*"; | ||
223 | map.insert( tr( "All" ), text ); | ||
224 | |||
225 | QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); | ||
226 | if( !filename.isEmpty() ) | ||
227 | { | ||
228 | QString currentFileName = QFileInfo( filename ).fileName(); | ||
229 | DocLnk doc; | ||
230 | doc.setType( "text/plain" ); | ||
231 | doc.setFile( filename ); | ||
232 | doc.setName( currentFileName ); | ||
233 | FileManager fm; | ||
234 | fm.saveFile( doc, output->text() ); | ||
235 | } | ||
236 | } | ||
204 | } | 237 | } |
205 | 238 | ||
@@ -273,5 +306,5 @@ void InstallDlgImpl :: installSelected() | |||
273 | tmpFlags |= MAKE_LINKS; | 306 | tmpFlags |= MAKE_LINKS; |
274 | 307 | ||
275 | pIpkg->setFlags( tmpFlags ); | 308 | pIpkg->setFlags( tmpFlags, infoLevel ); |
276 | pIpkg->runIpkg(); | 309 | pIpkg->runIpkg(); |
277 | } | 310 | } |
@@ -280,5 +313,5 @@ void InstallDlgImpl :: installSelected() | |||
280 | pIpkg->setDestination( dest ); | 313 | pIpkg->setDestination( dest ); |
281 | pIpkg->setDestinationDir( destDir ); | 314 | pIpkg->setDestinationDir( destDir ); |
282 | pIpkg->setFlags( instFlags ); | 315 | pIpkg->setFlags( instFlags, infoLevel ); |
283 | QListIterator<InstallData> it2( installList ); | 316 | QListIterator<InstallData> it2( installList ); |
284 | for ( ; it2.current(); ++it2 ) | 317 | for ( ; it2.current(); ++it2 ) |
@@ -304,5 +337,5 @@ void InstallDlgImpl :: installSelected() | |||
304 | if ( idata->destination->linkToRoot() && idata->recreateLinks ) | 337 | if ( idata->destination->linkToRoot() && idata->recreateLinks ) |
305 | tmpFlags |= MAKE_LINKS; | 338 | tmpFlags |= MAKE_LINKS; |
306 | pIpkg->setFlags( tmpFlags ); | 339 | pIpkg->setFlags( tmpFlags, infoLevel ); |
307 | pIpkg->runIpkg(); | 340 | pIpkg->runIpkg(); |
308 | } | 341 | } |
@@ -316,4 +349,7 @@ void InstallDlgImpl :: installSelected() | |||
316 | btnInstall->setText( tr( "Close" ) ); | 349 | btnInstall->setText( tr( "Close" ) ); |
317 | btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); | 350 | btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); |
351 | |||
352 | btnOptions->setText( tr( "Save output" ) ); | ||
353 | btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); | ||
318 | 354 | ||
319 | if ( destination && destination->currentText() != 0 && destination->currentText() != "" ) | 355 | if ( destination && destination->currentText() != 0 && destination->currentText() != "" ) |
diff --git a/noncore/settings/aqpkg/installdlgimpl.h b/noncore/settings/aqpkg/installdlgimpl.h index c30963e..15cf427 100644 --- a/noncore/settings/aqpkg/installdlgimpl.h +++ b/noncore/settings/aqpkg/installdlgimpl.h | |||
@@ -60,4 +60,5 @@ private: | |||
60 | QList<InstallData> updateList; | 60 | QList<InstallData> updateList; |
61 | int flags; | 61 | int flags; |
62 | int infoLevel; | ||
62 | Ipkg *pIpkg; | 63 | Ipkg *pIpkg; |
63 | bool upgradePackages; | 64 | bool upgradePackages; |
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp index 47b250d..72d794f 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.cpp +++ b/noncore/settings/aqpkg/instoptionsimpl.cpp | |||
@@ -21,5 +21,7 @@ | |||
21 | 21 | ||
22 | #include <qcheckbox.h> | 22 | #include <qcheckbox.h> |
23 | #include <qcombobox.h> | ||
23 | #include <qgroupbox.h> | 24 | #include <qgroupbox.h> |
25 | #include <qlabel.h> | ||
24 | #include <qlayout.h> | 26 | #include <qlayout.h> |
25 | 27 | ||
@@ -28,5 +30,5 @@ | |||
28 | #include "ipkg.h" | 30 | #include "ipkg.h" |
29 | 31 | ||
30 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl ) | 32 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) |
31 | : QDialog( parent, name, modal, fl ) | 33 | : QDialog( parent, name, modal, fl ) |
32 | { | 34 | { |
@@ -56,6 +58,16 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const | |||
56 | grplayout->addWidget( forceOverwrite ); | 58 | grplayout->addWidget( forceOverwrite ); |
57 | 59 | ||
58 | verboseWget = new QCheckBox( tr( "Verbose WGet" ), grpbox ); | 60 | QLabel *l = new QLabel( tr( "Information Level" ), grpbox ); |
59 | grplayout->addWidget( verboseWget ); | 61 | grplayout->addWidget( l ); |
62 | |||
63 | verboseIpkg = new QComboBox( grpbox ); | ||
64 | verboseIpkg->insertItem( tr( "Errors only" ) ); | ||
65 | verboseIpkg->insertItem( tr( "Normal messages" ) ); | ||
66 | verboseIpkg->insertItem( tr( "Informative messages" ) ); | ||
67 | verboseIpkg->insertItem( tr( "Troubleshooting output" ) ); | ||
68 | verboseIpkg->setCurrentItem( verb ); | ||
69 | grplayout->addWidget( verboseIpkg ); | ||
70 | |||
71 | grplayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | ||
60 | 72 | ||
61 | if ( flags & FORCE_DEPENDS ) | 73 | if ( flags & FORCE_DEPENDS ) |
@@ -67,6 +79,6 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const | |||
67 | if ( flags & FORCE_OVERWRITE ) | 79 | if ( flags & FORCE_OVERWRITE ) |
68 | forceOverwrite->setChecked( true ); | 80 | forceOverwrite->setChecked( true ); |
69 | if ( flags & VERBOSE_WGET ) | 81 | // if ( flags & VERBOSE_WGET ) |
70 | verboseWget->setChecked( true ); | 82 | // verboseWget->setChecked( true ); |
71 | // if ( flags & MAKE_LINKS ) | 83 | // if ( flags & MAKE_LINKS ) |
72 | // makeLinks->setChecked( true ); | 84 | // makeLinks->setChecked( true ); |
@@ -98,2 +110,7 @@ int InstallOptionsDlgImpl :: getFlags() | |||
98 | return flags; | 110 | return flags; |
99 | } | 111 | } |
112 | |||
113 | int InstallOptionsDlgImpl :: getInfoLevel() | ||
114 | { | ||
115 | return verboseIpkg->currentItem(); | ||
116 | } | ||
diff --git a/noncore/settings/aqpkg/instoptionsimpl.h b/noncore/settings/aqpkg/instoptionsimpl.h index f4724a0..1312afd 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.h +++ b/noncore/settings/aqpkg/instoptionsimpl.h | |||
@@ -21,4 +21,5 @@ | |||
21 | 21 | ||
22 | class QCheckBox; | 22 | class QCheckBox; |
23 | class QComboBox; | ||
23 | 24 | ||
24 | class InstallOptionsDlgImpl : public QDialog | 25 | class InstallOptionsDlgImpl : public QDialog |
@@ -26,7 +27,8 @@ class InstallOptionsDlgImpl : public QDialog | |||
26 | Q_OBJECT | 27 | Q_OBJECT |
27 | public: | 28 | public: |
28 | InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); | 29 | InstallOptionsDlgImpl( int, int, QWidget * = 0, const char * = 0, bool = false, WFlags = 0 ); |
29 | ~InstallOptionsDlgImpl(); | 30 | ~InstallOptionsDlgImpl(); |
30 | int getFlags(); | 31 | int getFlags(); |
32 | int getInfoLevel(); | ||
31 | 33 | ||
32 | private: | 34 | private: |
@@ -36,4 +38,5 @@ private: | |||
36 | QCheckBox* forceOverwrite; | 38 | QCheckBox* forceOverwrite; |
37 | QCheckBox* verboseWget; | 39 | QCheckBox* verboseWget; |
40 | QComboBox* verboseIpkg; | ||
38 | }; | 41 | }; |
39 | 42 | ||
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index e66c02d..7df643e 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp | |||
@@ -70,5 +70,5 @@ bool Ipkg :: runIpkg( ) | |||
70 | commands << ";"; | 70 | commands << ";"; |
71 | } | 71 | } |
72 | commands << "ipkg" << "-force-defaults"; | 72 | commands << "ipkg" << "-V" << QString::number( infoLevel ) << "-force-defaults"; |
73 | 73 | ||
74 | // only set the destination for an install operation | 74 | // only set the destination for an install operation |
@@ -87,5 +87,5 @@ bool Ipkg :: runIpkg( ) | |||
87 | if ( flags & FORCE_OVERWRITE ) | 87 | if ( flags & FORCE_OVERWRITE ) |
88 | commands << "-force-overwrite"; | 88 | commands << "-force-overwrite"; |
89 | if ( flags & VERBOSE_WGET ) | 89 | if ( infoLevel == 3 ) |
90 | commands << "-verbose_wget"; | 90 | commands << "-verbose_wget"; |
91 | 91 | ||
@@ -254,5 +254,5 @@ void Ipkg :: removeStatusEntry() | |||
254 | } | 254 | } |
255 | 255 | ||
256 | int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString option ) | 256 | int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) |
257 | { | 257 | { |
258 | // If one is already running - should never be but just to be safe | 258 | // If one is already running - should never be but just to be safe |
diff --git a/noncore/settings/aqpkg/ipkg.h b/noncore/settings/aqpkg/ipkg.h index d49bb04..531bfc0 100644 --- a/noncore/settings/aqpkg/ipkg.h +++ b/noncore/settings/aqpkg/ipkg.h | |||
@@ -50,5 +50,5 @@ public: | |||
50 | void setDestination( const char *dest ) { destination = dest; } | 50 | void setDestination( const char *dest ) { destination = dest; } |
51 | void setDestinationDir( const char *dir ) { destDir = dir; } | 51 | void setDestinationDir( const char *dir ) { destDir = dir; } |
52 | void setFlags( int fl ) { flags = fl; } | 52 | void setFlags( int fl, int il ) { flags = fl; infoLevel = il; } |
53 | void setRuntimeDirectory( const char *dir ) { runtimeDir = dir; } | 53 | void setRuntimeDirectory( const char *dir ) { runtimeDir = dir; } |
54 | 54 | ||
@@ -74,4 +74,5 @@ private: | |||
74 | OProcess *proc; | 74 | OProcess *proc; |
75 | int flags; | 75 | int flags; |
76 | int infoLevel; | ||
76 | bool finished; | 77 | bool finished; |
77 | 78 | ||