Diffstat (limited to 'noncore/settings/packagemanager') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.h | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 26 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.h | 2 |
4 files changed, 27 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index ffb3687..38cd824 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp | |||
@@ -377,96 +377,98 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & | |||
377 | if ( key == "Description" ) | 377 | if ( key == "Description" ) |
378 | { | 378 | { |
379 | line = t.readLine(); | 379 | line = t.readLine(); |
380 | while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() ) | 380 | while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() ) |
381 | line = t.readLine(); | 381 | line = t.readLine(); |
382 | } | 382 | } |
383 | else | 383 | else |
384 | line = t.readLine(); | 384 | line = t.readLine(); |
385 | } | 385 | } |
386 | 386 | ||
387 | f.close(); | 387 | f.close(); |
388 | 388 | ||
389 | // Make sure to add to list last entry | 389 | // Make sure to add to list last entry |
390 | if ( !name.isNull() && status.contains( " installed" ) ) | 390 | if ( !name.isNull() && status.contains( " installed" ) ) |
391 | pl->append( new OPackage( name, QString::null, version, QString::null, destName ) ); | 391 | pl->append( new OPackage( name, QString::null, version, QString::null, destName ) ); |
392 | 392 | ||
393 | return pl; | 393 | return pl; |
394 | } | 394 | } |
395 | 395 | ||
396 | OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) | 396 | OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) |
397 | { | 397 | { |
398 | // Find configuration item in list | 398 | // Find configuration item in list |
399 | OConfItemListIterator configIt( *m_confInfo ); | 399 | OConfItemListIterator configIt( *m_confInfo ); |
400 | OConfItem *config = 0l; | 400 | OConfItem *config = 0l; |
401 | for ( ; configIt.current(); ++configIt ) | 401 | for ( ; configIt.current(); ++configIt ) |
402 | { | 402 | { |
403 | config = configIt.current(); | 403 | config = configIt.current(); |
404 | if ( config->type() == type && config->name() == name ) | 404 | if ( config->type() == type && config->name() == name ) |
405 | break; | 405 | break; |
406 | } | 406 | } |
407 | 407 | ||
408 | if ( config && config->type() == type && config->name() == name ) | 408 | if ( config && config->type() == type && config->name() == name ) |
409 | return config; | 409 | return config; |
410 | 410 | ||
411 | return 0l; | 411 | return 0l; |
412 | } | 412 | } |
413 | 413 | ||
414 | bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶meters, const QString &destination, | 414 | bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶meters, const QString &destination, |
415 | const QObject *receiver, const char *slotOutput, bool rawOutput ) | 415 | const QObject *receiver, const char *slotOutput, bool rawOutput ) |
416 | { | 416 | { |
417 | if ( command == OPackage::NotDefined ) | 417 | if ( command == OPackage::NotDefined ) |
418 | return false; | 418 | return false; |
419 | 419 | ||
420 | // Set ipkg run-time options/arguments | 420 | // Set ipkg run-time options/arguments |
421 | m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS ); | 421 | m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS ); |
422 | m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL ); | 422 | m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL ); |
423 | // TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE ); | 423 | // TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE ); |
424 | m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE ); | 424 | m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE ); |
425 | m_ipkgArgs.force_removal_of_dependent_packages = ( m_ipkgExecOptions & FORCE_RECURSIVE ); | ||
426 | m_ipkgArgs.verbose_wget = ( m_ipkgExecOptions & FORCE_VERBOSE_WGET ); | ||
425 | m_ipkgArgs.verbosity = m_ipkgExecVerbosity; | 427 | m_ipkgArgs.verbosity = m_ipkgExecVerbosity; |
426 | if ( m_ipkgArgs.dest ) | 428 | if ( m_ipkgArgs.dest ) |
427 | free( m_ipkgArgs.dest ); | 429 | free( m_ipkgArgs.dest ); |
428 | if ( !destination.isNull() ) | 430 | if ( !destination.isNull() ) |
429 | { | 431 | { |
430 | int len = destination.length() + 1; | 432 | int len = destination.length() + 1; |
431 | m_ipkgArgs.dest = (char *)malloc( len ); | 433 | m_ipkgArgs.dest = (char *)malloc( len ); |
432 | strncpy( m_ipkgArgs.dest, destination, destination.length() ); | 434 | strncpy( m_ipkgArgs.dest, destination, destination.length() ); |
433 | m_ipkgArgs.dest[ len - 1 ] = '\0'; | 435 | m_ipkgArgs.dest[ len - 1 ] = '\0'; |
434 | } | 436 | } |
435 | else | 437 | else |
436 | m_ipkgArgs.dest = 0l; | 438 | m_ipkgArgs.dest = 0l; |
437 | 439 | ||
438 | // Connect output signal to widget | 440 | // Connect output signal to widget |
439 | 441 | ||
440 | if ( !rawOutput ) | 442 | if ( !rawOutput ) |
441 | { | 443 | { |
442 | // TODO - connect to local slot and parse output before emitting signalIpkgMessage | 444 | // TODO - connect to local slot and parse output before emitting signalIpkgMessage |
443 | } | 445 | } |
444 | 446 | ||
445 | switch( command ) | 447 | switch( command ) |
446 | { | 448 | { |
447 | case OPackage::Update : { | 449 | case OPackage::Update : { |
448 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 450 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
449 | ipkg_lists_update( &m_ipkgArgs ); | 451 | ipkg_lists_update( &m_ipkgArgs ); |
450 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | 452 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); |
451 | }; | 453 | }; |
452 | break; | 454 | break; |
453 | case OPackage::Upgrade : { | 455 | case OPackage::Upgrade : { |
454 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 456 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
455 | ipkg_packages_upgrade( &m_ipkgArgs ); | 457 | ipkg_packages_upgrade( &m_ipkgArgs ); |
456 | 458 | ||
457 | // Re-link non-root destinations to make sure everything is in sync | 459 | // Re-link non-root destinations to make sure everything is in sync |
458 | OConfItemList *destList = destinations(); | 460 | OConfItemList *destList = destinations(); |
459 | OConfItemListIterator it( *destList ); | 461 | OConfItemListIterator it( *destList ); |
460 | for ( ; it.current(); ++it ) | 462 | for ( ; it.current(); ++it ) |
461 | { | 463 | { |
462 | OConfItem *dest = it.current(); | 464 | OConfItem *dest = it.current(); |
463 | if ( dest->name() != "root" ) | 465 | if ( dest->name() != "root" ) |
464 | linkPackageDir( dest->name() ); | 466 | linkPackageDir( dest->name() ); |
465 | } | 467 | } |
466 | delete destList; | 468 | delete destList; |
467 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | 469 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); |
468 | }; | 470 | }; |
469 | break; | 471 | break; |
470 | case OPackage::Install : { | 472 | case OPackage::Install : { |
471 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 473 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
472 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) | 474 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) |
diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h index 9a7802c..88f0e32 100644 --- a/noncore/settings/packagemanager/oipkg.h +++ b/noncore/settings/packagemanager/oipkg.h | |||
@@ -1,93 +1,95 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> | 4 | Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OIPKG_H | 31 | #ifndef OIPKG_H |
32 | #define OIPKG_H | 32 | #define OIPKG_H |
33 | 33 | ||
34 | #include "oconfitem.h" | 34 | #include "oconfitem.h" |
35 | #include "opackage.h" | 35 | #include "opackage.h" |
36 | 36 | ||
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | 38 | ||
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | 40 | ||
41 | // Ipkg execution options (m_ipkgExecOptions) | 41 | // Ipkg execution options (m_ipkgExecOptions) |
42 | #define FORCE_DEPENDS 0x0001 | 42 | #define FORCE_DEPENDS 0x0001 |
43 | #define FORCE_REMOVE 0x0002 | 43 | #define FORCE_REMOVE 0x0002 |
44 | #define FORCE_REINSTALL 0x0004 | 44 | #define FORCE_REINSTALL 0x0004 |
45 | #define FORCE_OVERWRITE 0x0008 | 45 | #define FORCE_OVERWRITE 0x0008 |
46 | #define FORCE_RECURSIVE 0x0010 | ||
47 | #define FORCE_VERBOSE_WGET 0x0020 | ||
46 | 48 | ||
47 | class OConfItemList; | 49 | class OConfItemList; |
48 | 50 | ||
49 | class OIpkg : public QObject | 51 | class OIpkg : public QObject |
50 | { | 52 | { |
51 | Q_OBJECT | 53 | Q_OBJECT |
52 | 54 | ||
53 | public: | 55 | public: |
54 | OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l ); | 56 | OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l ); |
55 | ~OIpkg(); | 57 | ~OIpkg(); |
56 | 58 | ||
57 | OConfItemList *configItems(); | 59 | OConfItemList *configItems(); |
58 | OConfItemList *servers(); | 60 | OConfItemList *servers(); |
59 | OConfItemList *destinations(); | 61 | OConfItemList *destinations(); |
60 | OConfItemList *options(); | 62 | OConfItemList *options(); |
61 | 63 | ||
62 | int ipkgExecOptions() { return m_ipkgExecOptions; } | 64 | int ipkgExecOptions() { return m_ipkgExecOptions; } |
63 | int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } | 65 | int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } |
64 | 66 | ||
65 | void setConfigItems( OConfItemList *configList ); | 67 | void setConfigItems( OConfItemList *configList ); |
66 | void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } | 68 | void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } |
67 | void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } | 69 | void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } |
68 | 70 | ||
69 | void saveSettings(); | 71 | void saveSettings(); |
70 | 72 | ||
71 | OPackageList *availablePackages( const QString &server = QString::null ); | 73 | OPackageList *availablePackages( const QString &server = QString::null ); |
72 | OPackageList *installedPackages( const QString &destName = QString::null, | 74 | OPackageList *installedPackages( const QString &destName = QString::null, |
73 | const QString &destPath = QString::null ); | 75 | const QString &destPath = QString::null ); |
74 | 76 | ||
75 | OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, | 77 | OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, |
76 | const QString &name = QString::null ); | 78 | const QString &name = QString::null ); |
77 | 79 | ||
78 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, | 80 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, |
79 | const QStringList ¶meters = QStringList(), | 81 | const QStringList ¶meters = QStringList(), |
80 | const QString &destination = QString::null, | 82 | const QString &destination = QString::null, |
81 | const QObject *receiver = 0l, | 83 | const QObject *receiver = 0l, |
82 | const char *slotOutput = 0l, | 84 | const char *slotOutput = 0l, |
83 | bool rawOutput = true ); | 85 | bool rawOutput = true ); |
84 | void abortCommand(); | 86 | void abortCommand(); |
85 | 87 | ||
86 | void ipkgMessage( char *msg ); | 88 | void ipkgMessage( char *msg ); |
87 | void ipkgStatus( char *status ); | 89 | void ipkgStatus( char *status ); |
88 | void ipkgList( char *filelist ); | 90 | void ipkgList( char *filelist ); |
89 | 91 | ||
90 | private: | 92 | private: |
91 | Config *m_config; // Pointer to application configuration file | 93 | Config *m_config; // Pointer to application configuration file |
92 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files | 94 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files |
93 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options | 95 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options |
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 58c572b..d014378 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp | |||
@@ -105,96 +105,100 @@ void OIpkgConfigDlg::accept() | |||
105 | confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); | 105 | confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); |
106 | if ( confItem ) | 106 | if ( confItem ) |
107 | { | 107 | { |
108 | confItem->setValue( m_proxyFtpServer->text() ); | 108 | confItem->setValue( m_proxyFtpServer->text() ); |
109 | confItem->setActive( m_proxyFtpActive->isChecked() ); | 109 | confItem->setActive( m_proxyFtpActive->isChecked() ); |
110 | } | 110 | } |
111 | else | 111 | else |
112 | m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", | 112 | m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", |
113 | m_proxyFtpServer->text(), QString::null, | 113 | m_proxyFtpServer->text(), QString::null, |
114 | m_proxyFtpActive->isChecked() ) ); | 114 | m_proxyFtpActive->isChecked() ) ); |
115 | 115 | ||
116 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); | 116 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); |
117 | if ( confItem ) | 117 | if ( confItem ) |
118 | confItem->setValue( m_proxyUsername->text() ); | 118 | confItem->setValue( m_proxyUsername->text() ); |
119 | else | 119 | else |
120 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", | 120 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", |
121 | m_proxyUsername->text() ) ); | 121 | m_proxyUsername->text() ) ); |
122 | 122 | ||
123 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); | 123 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); |
124 | if ( confItem ) | 124 | if ( confItem ) |
125 | confItem->setValue( m_proxyPassword->text() ); | 125 | confItem->setValue( m_proxyPassword->text() ); |
126 | else | 126 | else |
127 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", | 127 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", |
128 | m_proxyPassword->text() ) ); | 128 | m_proxyPassword->text() ) ); |
129 | 129 | ||
130 | QString listsDir = m_optSourceLists->text(); | 130 | QString listsDir = m_optSourceLists->text(); |
131 | if ( listsDir == QString::null || listsDir == "" ) | 131 | if ( listsDir == QString::null || listsDir == "" ) |
132 | listsDir = "/usr/lib/ipkg/lists"; // TODO - use proper libipkg define | 132 | listsDir = "/usr/lib/ipkg/lists"; // TODO - use proper libipkg define |
133 | confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" ); | 133 | confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" ); |
134 | if ( confItem ) | 134 | if ( confItem ) |
135 | confItem->setValue( listsDir ); | 135 | confItem->setValue( listsDir ); |
136 | else | 136 | else |
137 | m_configs->append( new OConfItem( OConfItem::Other, "lists_dir", | 137 | m_configs->append( new OConfItem( OConfItem::Other, "lists_dir", |
138 | listsDir, "name" ) ); | 138 | listsDir, "name" ) ); |
139 | 139 | ||
140 | m_ipkg->setConfigItems( m_configs ); | 140 | m_ipkg->setConfigItems( m_configs ); |
141 | } | 141 | } |
142 | 142 | ||
143 | // Save options configuration | 143 | // Save options configuration |
144 | int options = 0; | 144 | int options = 0; |
145 | if ( m_optForceDepends->isChecked() ) | 145 | if ( m_optForceDepends->isChecked() ) |
146 | options |= FORCE_DEPENDS; | 146 | options |= FORCE_DEPENDS; |
147 | if ( m_optForceReinstall->isChecked() ) | 147 | if ( m_optForceReinstall->isChecked() ) |
148 | options |= FORCE_REINSTALL; | 148 | options |= FORCE_REINSTALL; |
149 | if ( m_optForceRemove->isChecked() ) | 149 | if ( m_optForceRemove->isChecked() ) |
150 | options |= FORCE_REMOVE; | 150 | options |= FORCE_REMOVE; |
151 | if ( m_optForceOverwrite->isChecked() ) | 151 | if ( m_optForceOverwrite->isChecked() ) |
152 | options |= FORCE_OVERWRITE; | 152 | options |= FORCE_OVERWRITE; |
153 | if ( m_optForceRecursive->isChecked() ) | ||
154 | options |= FORCE_RECURSIVE; | ||
155 | if ( m_optVerboseWget->isChecked() ) | ||
156 | options |= FORCE_VERBOSE_WGET; | ||
153 | m_ipkg->setIpkgExecOptions( options ); | 157 | m_ipkg->setIpkgExecOptions( options ); |
154 | m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); | 158 | m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); |
155 | 159 | ||
156 | QDialog::accept(); | 160 | QDialog::accept(); |
157 | } | 161 | } |
158 | 162 | ||
159 | void OIpkgConfigDlg::reject() | 163 | void OIpkgConfigDlg::reject() |
160 | { | 164 | { |
161 | if ( m_configs ) | 165 | if ( m_configs ) |
162 | delete m_configs; | 166 | delete m_configs; |
163 | } | 167 | } |
164 | 168 | ||
165 | void OIpkgConfigDlg::initServerWidget() | 169 | void OIpkgConfigDlg::initServerWidget() |
166 | { | 170 | { |
167 | m_serverWidget = new QWidget( this ); | 171 | m_serverWidget = new QWidget( this ); |
168 | 172 | ||
169 | // Initialize UI | 173 | // Initialize UI |
170 | QVBoxLayout *vb = new QVBoxLayout( m_serverWidget ); | 174 | QVBoxLayout *vb = new QVBoxLayout( m_serverWidget ); |
171 | QScrollView *sv = new QScrollView( m_serverWidget ); | 175 | QScrollView *sv = new QScrollView( m_serverWidget ); |
172 | vb->addWidget( sv, 0, 0 ); | 176 | vb->addWidget( sv, 0, 0 ); |
173 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 177 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
174 | sv->setFrameStyle( QFrame::NoFrame ); | 178 | sv->setFrameStyle( QFrame::NoFrame ); |
175 | QWidget *container = new QWidget( sv->viewport() ); | 179 | QWidget *container = new QWidget( sv->viewport() ); |
176 | sv->addChild( container ); | 180 | sv->addChild( container ); |
177 | QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); | 181 | QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); |
178 | 182 | ||
179 | m_serverList = new QListBox( container ); | 183 | m_serverList = new QListBox( container ); |
180 | QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) ); | 184 | QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) ); |
181 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 185 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
182 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); | 186 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); |
183 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); | 187 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); |
184 | 188 | ||
185 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), | 189 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
186 | tr( "New" ), container ); | 190 | tr( "New" ), container ); |
187 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); | 191 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
188 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | 192 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); |
189 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); | 193 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); |
190 | layout->addWidget( btn, 1, 0 ); | 194 | layout->addWidget( btn, 1, 0 ); |
191 | 195 | ||
192 | m_serverEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), | 196 | m_serverEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), |
193 | tr( "Edit" ), container ); | 197 | tr( "Edit" ), container ); |
194 | m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); | 198 | m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
195 | m_serverEditBtn->setEnabled( false ); | 199 | m_serverEditBtn->setEnabled( false ); |
196 | QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); | 200 | QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); |
197 | connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); | 201 | connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); |
198 | layout->addWidget( m_serverEditBtn, 1, 1 ); | 202 | layout->addWidget( m_serverEditBtn, 1, 1 ); |
199 | 203 | ||
200 | m_serverDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), | 204 | m_serverDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), |
@@ -291,193 +295,205 @@ void OIpkgConfigDlg::initProxyWidget() | |||
291 | grplayout->addWidget( m_proxyFtpActive ); | 295 | grplayout->addWidget( m_proxyFtpActive ); |
292 | 296 | ||
293 | // Proxy server username and password configuration | 297 | // Proxy server username and password configuration |
294 | QLabel *label = new QLabel( tr( "Username:" ), container ); | 298 | QLabel *label = new QLabel( tr( "Username:" ), container ); |
295 | QWhatsThis::add( label, tr( "Enter the username for the proxy servers here." ) ); | 299 | QWhatsThis::add( label, tr( "Enter the username for the proxy servers here." ) ); |
296 | layout->addWidget( label, 2, 0 ); | 300 | layout->addWidget( label, 2, 0 ); |
297 | m_proxyUsername = new QLineEdit( container ); | 301 | m_proxyUsername = new QLineEdit( container ); |
298 | QWhatsThis::add( m_proxyUsername, tr( "Enter the username for the proxy servers here." ) ); | 302 | QWhatsThis::add( m_proxyUsername, tr( "Enter the username for the proxy servers here." ) ); |
299 | layout->addWidget( m_proxyUsername, 2, 1 ); | 303 | layout->addWidget( m_proxyUsername, 2, 1 ); |
300 | 304 | ||
301 | label = new QLabel( tr( "Password:" ), container ); | 305 | label = new QLabel( tr( "Password:" ), container ); |
302 | QWhatsThis::add( label, tr( "Enter the password for the proxy servers here." ) ); | 306 | QWhatsThis::add( label, tr( "Enter the password for the proxy servers here." ) ); |
303 | layout->addWidget( label, 3, 0 ); | 307 | layout->addWidget( label, 3, 0 ); |
304 | m_proxyPassword = new QLineEdit( container ); | 308 | m_proxyPassword = new QLineEdit( container ); |
305 | QWhatsThis::add( m_proxyPassword, tr( "Enter the password for the proxy servers here." ) ); | 309 | QWhatsThis::add( m_proxyPassword, tr( "Enter the password for the proxy servers here." ) ); |
306 | layout->addWidget( m_proxyPassword, 3, 1 ); | 310 | layout->addWidget( m_proxyPassword, 3, 1 ); |
307 | } | 311 | } |
308 | 312 | ||
309 | void OIpkgConfigDlg::initOptionsWidget() | 313 | void OIpkgConfigDlg::initOptionsWidget() |
310 | { | 314 | { |
311 | m_optionsWidget = new QWidget( this ); | 315 | m_optionsWidget = new QWidget( this ); |
312 | 316 | ||
313 | // Initialize UI | 317 | // Initialize UI |
314 | QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); | 318 | QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); |
315 | QScrollView *sv = new QScrollView( m_optionsWidget ); | 319 | QScrollView *sv = new QScrollView( m_optionsWidget ); |
316 | vb->addWidget( sv, 0, 0 ); | 320 | vb->addWidget( sv, 0, 0 ); |
317 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 321 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
318 | sv->setFrameStyle( QFrame::NoFrame ); | 322 | sv->setFrameStyle( QFrame::NoFrame ); |
319 | QWidget *container = new QWidget( sv->viewport() ); | 323 | QWidget *container = new QWidget( sv->viewport() ); |
320 | sv->addChild( container ); | 324 | sv->addChild( container ); |
321 | QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 ); | 325 | QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 ); |
322 | 326 | ||
323 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); | 327 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); |
324 | QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); | 328 | QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); |
325 | layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 ); | 329 | layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 ); |
326 | 330 | ||
327 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); | 331 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); |
328 | QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); | 332 | QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); |
329 | layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 ); | 333 | layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 ); |
330 | 334 | ||
331 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); | 335 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); |
332 | QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); | 336 | QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); |
333 | layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 ); | 337 | layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 ); |
334 | 338 | ||
335 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); | 339 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); |
336 | QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); | 340 | QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); |
337 | layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 ); | 341 | layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 ); |
338 | 342 | ||
343 | m_optForceRecursive = new QCheckBox( tr( "Force Recursive" ), container ); | ||
344 | QWhatsThis::add( m_optForceRecursive, tr( "Tap here to enable or disable the '-recursive' option for Ipkg." ) ); | ||
345 | layout->addMultiCellWidget( m_optForceRecursive, 4, 4, 0, 1 ); | ||
346 | |||
347 | m_optVerboseWget = new QCheckBox( tr( "Verbose fetch" ), container ); | ||
348 | QWhatsThis::add( m_optVerboseWget, tr( "Tap here to enable or disable the '-verbose_wget' option for Ipkg." ) ); | ||
349 | layout->addMultiCellWidget( m_optVerboseWget, 5, 5, 0, 1 ); | ||
350 | |||
339 | QLabel *l = new QLabel( tr( "Information level:" ), container ); | 351 | QLabel *l = new QLabel( tr( "Information level:" ), container ); |
340 | QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); | 352 | QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); |
341 | layout->addMultiCellWidget( l, 4, 4, 0, 1 ); | 353 | layout->addMultiCellWidget( l, 6, 6, 0, 1 ); |
342 | 354 | ||
343 | m_optVerboseIpkg = new QComboBox( container ); | 355 | m_optVerboseIpkg = new QComboBox( container ); |
344 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); | 356 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); |
345 | m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); | 357 | m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); |
346 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); | 358 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); |
347 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); | 359 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); |
348 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); | 360 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); |
349 | layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 ); | 361 | layout->addMultiCellWidget( m_optVerboseIpkg, 7, 7, 0, 1 ); |
350 | 362 | ||
351 | l = new QLabel( tr( "Package source lists directory:" ), container ); | 363 | l = new QLabel( tr( "Package source lists directory:" ), container ); |
352 | QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) ); | 364 | QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) ); |
353 | layout->addMultiCellWidget( l, 6, 6, 0, 1 ); | 365 | layout->addMultiCellWidget( l, 8, 8, 0, 1 ); |
354 | 366 | ||
355 | m_optSourceLists = new QLineEdit( container ); | 367 | m_optSourceLists = new QLineEdit( container ); |
356 | QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); | 368 | QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); |
357 | layout->addWidget( m_optSourceLists, 7, 0 ); | 369 | layout->addWidget( m_optSourceLists, 9, 0 ); |
358 | 370 | ||
359 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ), | 371 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ), |
360 | QString::null, container ); | 372 | QString::null, container ); |
361 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); | 373 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
362 | btn->setMaximumWidth( btn->height() ); | 374 | btn->setMaximumWidth( btn->height() ); |
363 | QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); | 375 | QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); |
364 | connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); | 376 | connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); |
365 | layout->addWidget( btn, 7, 1 ); | 377 | layout->addWidget( btn, 9, 1 ); |
366 | 378 | ||
367 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 379 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
368 | } | 380 | } |
369 | 381 | ||
370 | void OIpkgConfigDlg::initData() | 382 | void OIpkgConfigDlg::initData() |
371 | { | 383 | { |
372 | // Read ipkg configuration (server/destination/proxy) information | 384 | // Read ipkg configuration (server/destination/proxy) information |
373 | if ( m_ipkg && !m_installOptions ) | 385 | if ( m_ipkg && !m_installOptions ) |
374 | { | 386 | { |
375 | m_configs = m_ipkg->configItems(); | 387 | m_configs = m_ipkg->configItems(); |
376 | if ( m_configs ) | 388 | if ( m_configs ) |
377 | { | 389 | { |
378 | for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) | 390 | for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) |
379 | { | 391 | { |
380 | OConfItem *config = configIt.current(); | 392 | OConfItem *config = configIt.current(); |
381 | 393 | ||
382 | // Add configuration item to the appropriate dialog controls | 394 | // Add configuration item to the appropriate dialog controls |
383 | if ( config ) | 395 | if ( config ) |
384 | { | 396 | { |
385 | switch ( config->type() ) | 397 | switch ( config->type() ) |
386 | { | 398 | { |
387 | case OConfItem::Source : m_serverList->insertItem( config->name() ); break; | 399 | case OConfItem::Source : m_serverList->insertItem( config->name() ); break; |
388 | case OConfItem::Destination : m_destList->insertItem( config->name() ); break; | 400 | case OConfItem::Destination : m_destList->insertItem( config->name() ); break; |
389 | case OConfItem::Option : | 401 | case OConfItem::Option : |
390 | { | 402 | { |
391 | if ( config->name() == "http_proxy" ) | 403 | if ( config->name() == "http_proxy" ) |
392 | { | 404 | { |
393 | m_proxyHttpServer->setText( config->value() ); | 405 | m_proxyHttpServer->setText( config->value() ); |
394 | m_proxyHttpActive->setChecked( config->active() ); | 406 | m_proxyHttpActive->setChecked( config->active() ); |
395 | } | 407 | } |
396 | else if ( config->name() == "ftp_proxy" ) | 408 | else if ( config->name() == "ftp_proxy" ) |
397 | { | 409 | { |
398 | m_proxyFtpServer->setText( config->value() ); | 410 | m_proxyFtpServer->setText( config->value() ); |
399 | m_proxyFtpActive->setChecked( config->active() ); | 411 | m_proxyFtpActive->setChecked( config->active() ); |
400 | } | 412 | } |
401 | else if ( config->name() == "proxy_username" ) | 413 | else if ( config->name() == "proxy_username" ) |
402 | { | 414 | { |
403 | m_proxyUsername->setText( config->value() ); | 415 | m_proxyUsername->setText( config->value() ); |
404 | } | 416 | } |
405 | else if ( config->name() == "proxy_password" ) | 417 | else if ( config->name() == "proxy_password" ) |
406 | { | 418 | { |
407 | m_proxyPassword->setText( config->value() ); | 419 | m_proxyPassword->setText( config->value() ); |
408 | } | 420 | } |
409 | } | 421 | } |
410 | break; | 422 | break; |
411 | case OConfItem::Other : | 423 | case OConfItem::Other : |
412 | { | 424 | { |
413 | if ( config->name() == "lists_dir" ) | 425 | if ( config->name() == "lists_dir" ) |
414 | m_optSourceLists->setText( config->value() ); | 426 | m_optSourceLists->setText( config->value() ); |
415 | else // TODO - use proper libipkg define | 427 | else // TODO - use proper libipkg define |
416 | m_optSourceLists->setText( "/usr/lib/ipkg/lists" ); | 428 | m_optSourceLists->setText( "/usr/lib/ipkg/lists" ); |
417 | } | 429 | } |
418 | break; | 430 | break; |
419 | default : break; | 431 | default : break; |
420 | }; | 432 | }; |
421 | } | 433 | } |
422 | } | 434 | } |
423 | } | 435 | } |
424 | } | 436 | } |
425 | 437 | ||
426 | // Get Ipkg execution options | 438 | // Get Ipkg execution options |
427 | int options = m_ipkg->ipkgExecOptions(); | 439 | int options = m_ipkg->ipkgExecOptions(); |
428 | if ( options & FORCE_DEPENDS ) | 440 | if ( options & FORCE_DEPENDS ) |
429 | m_optForceDepends->setChecked( true ); | 441 | m_optForceDepends->setChecked( true ); |
430 | if ( options & FORCE_REINSTALL ) | 442 | if ( options & FORCE_REINSTALL ) |
431 | m_optForceReinstall->setChecked( true ); | 443 | m_optForceReinstall->setChecked( true ); |
432 | if ( options & FORCE_REMOVE ) | 444 | if ( options & FORCE_REMOVE ) |
433 | m_optForceRemove->setChecked( true ); | 445 | m_optForceRemove->setChecked( true ); |
434 | if ( options & FORCE_OVERWRITE ) | 446 | if ( options & FORCE_OVERWRITE ) |
435 | m_optForceOverwrite->setChecked( true ); | 447 | m_optForceOverwrite->setChecked( true ); |
448 | if ( options & FORCE_RECURSIVE ) | ||
449 | m_optForceRecursive->setChecked( true ); | ||
450 | if ( options & FORCE_VERBOSE_WGET ) | ||
451 | m_optVerboseWget->setChecked( true ); | ||
436 | 452 | ||
437 | m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); | 453 | m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); |
438 | } | 454 | } |
439 | 455 | ||
440 | void OIpkgConfigDlg::slotServerSelected( int index ) | 456 | void OIpkgConfigDlg::slotServerSelected( int index ) |
441 | { | 457 | { |
442 | m_serverCurrent = index; | 458 | m_serverCurrent = index; |
443 | 459 | ||
444 | // Enable Edit and Delete buttons | 460 | // Enable Edit and Delete buttons |
445 | m_serverEditBtn->setEnabled( true ); | 461 | m_serverEditBtn->setEnabled( true ); |
446 | m_serverDeleteBtn->setEnabled( true ); | 462 | m_serverDeleteBtn->setEnabled( true ); |
447 | } | 463 | } |
448 | 464 | ||
449 | void OIpkgConfigDlg::slotServerNew() | 465 | void OIpkgConfigDlg::slotServerNew() |
450 | { | 466 | { |
451 | OConfItem *server = new OConfItem( OConfItem::Source ); | 467 | OConfItem *server = new OConfItem( OConfItem::Source ); |
452 | 468 | ||
453 | OIpkgServerDlg dlg( server, this ); | 469 | OIpkgServerDlg dlg( server, this ); |
454 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) | 470 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) |
455 | { | 471 | { |
456 | // Add to configuration option list | 472 | // Add to configuration option list |
457 | m_configs->append( server ); | 473 | m_configs->append( server ); |
458 | m_configs->sort(); | 474 | m_configs->sort(); |
459 | 475 | ||
460 | // Add to server list | 476 | // Add to server list |
461 | m_serverList->insertItem( server->name() ); | 477 | m_serverList->insertItem( server->name() ); |
462 | m_serverList->setCurrentItem( m_serverList->count() ); | 478 | m_serverList->setCurrentItem( m_serverList->count() ); |
463 | } | 479 | } |
464 | else | 480 | else |
465 | delete server; | 481 | delete server; |
466 | } | 482 | } |
467 | 483 | ||
468 | void OIpkgConfigDlg::slotServerEdit() | 484 | void OIpkgConfigDlg::slotServerEdit() |
469 | { | 485 | { |
470 | // Find selected server in list | 486 | // Find selected server in list |
471 | OConfItem *server = m_ipkg->findConfItem( OConfItem::Source, m_serverList->currentText() ); | 487 | OConfItem *server = m_ipkg->findConfItem( OConfItem::Source, m_serverList->currentText() ); |
472 | 488 | ||
473 | // Edit server | 489 | // Edit server |
474 | if ( server ) | 490 | if ( server ) |
475 | { | 491 | { |
476 | QString origName = server->name(); | 492 | QString origName = server->name(); |
477 | OIpkgServerDlg dlg( server, this ); | 493 | OIpkgServerDlg dlg( server, this ); |
478 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) | 494 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) |
479 | { | 495 | { |
480 | // Check to see if name has changed, if so update the server list | 496 | // Check to see if name has changed, if so update the server list |
481 | if ( server->name() != origName ) | 497 | if ( server->name() != origName ) |
482 | m_serverList->changeItem( server->name(), m_serverCurrent ); | 498 | m_serverList->changeItem( server->name(), m_serverCurrent ); |
483 | } | 499 | } |
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index 88381ab..36ab9a0 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h | |||
@@ -51,96 +51,98 @@ class OIpkgConfigDlg : public QDialog | |||
51 | public: | 51 | public: |
52 | OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); | 52 | OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); |
53 | 53 | ||
54 | protected slots: | 54 | protected slots: |
55 | void accept(); | 55 | void accept(); |
56 | void reject(); | 56 | void reject(); |
57 | 57 | ||
58 | private: | 58 | private: |
59 | OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options | 59 | OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options |
60 | OConfItemList *m_configs; // Local list of configuration items | 60 | OConfItemList *m_configs; // Local list of configuration items |
61 | 61 | ||
62 | bool m_installOptions; // If true, will only display the Options tab | 62 | bool m_installOptions; // If true, will only display the Options tab |
63 | 63 | ||
64 | // Server/Destination cached information | 64 | // Server/Destination cached information |
65 | int m_serverCurrent; // Index of currently selected server in m_serverList | 65 | int m_serverCurrent; // Index of currently selected server in m_serverList |
66 | int m_destCurrent; // Index of currently selected destination in m_destList | 66 | int m_destCurrent; // Index of currently selected destination in m_destList |
67 | 67 | ||
68 | // UI controls | 68 | // UI controls |
69 | QVBoxLayout m_layout; // Main dialog layout control | 69 | QVBoxLayout m_layout; // Main dialog layout control |
70 | Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control | 70 | Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control |
71 | QWidget *m_serverWidget; // Widget containing server configuration controls | 71 | QWidget *m_serverWidget; // Widget containing server configuration controls |
72 | QWidget *m_destWidget; // Widget containing destination configuration controls | 72 | QWidget *m_destWidget; // Widget containing destination configuration controls |
73 | QWidget *m_proxyWidget; // Widget containing proxy configuration controls | 73 | QWidget *m_proxyWidget; // Widget containing proxy configuration controls |
74 | QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls | 74 | QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls |
75 | 75 | ||
76 | // Server configuration UI controls | 76 | // Server configuration UI controls |
77 | QListBox *m_serverList; // Server list selection | 77 | QListBox *m_serverList; // Server list selection |
78 | QPushButton *m_serverEditBtn; // Server edit button | 78 | QPushButton *m_serverEditBtn; // Server edit button |
79 | QPushButton *m_serverDeleteBtn; // Server edit button | 79 | QPushButton *m_serverDeleteBtn; // Server edit button |
80 | 80 | ||
81 | // Destination configuration UI controls | 81 | // Destination configuration UI controls |
82 | QListBox *m_destList; // Destination list selection | 82 | QListBox *m_destList; // Destination list selection |
83 | QPushButton *m_destEditBtn; // Destination edit button | 83 | QPushButton *m_destEditBtn; // Destination edit button |
84 | QPushButton *m_destDeleteBtn; // Destination edit button | 84 | QPushButton *m_destDeleteBtn; // Destination edit button |
85 | 85 | ||
86 | // Proxy server configuration UI controls | 86 | // Proxy server configuration UI controls |
87 | QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box | 87 | QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box |
88 | QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box | 88 | QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box |
89 | QLineEdit *m_proxyFtpServer; // FTP proxy server edit box | 89 | QLineEdit *m_proxyFtpServer; // FTP proxy server edit box |
90 | QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box | 90 | QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box |
91 | QLineEdit *m_proxyUsername; // Proxy server username edit box | 91 | QLineEdit *m_proxyUsername; // Proxy server username edit box |
92 | QLineEdit *m_proxyPassword; // Proxy server password edit box | 92 | QLineEdit *m_proxyPassword; // Proxy server password edit box |
93 | 93 | ||
94 | // Options configuration UI controls | 94 | // Options configuration UI controls |
95 | QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox | 95 | QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox |
96 | QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox | 96 | QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox |
97 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox | 97 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox |
98 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox | 98 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox |
99 | QCheckBox *m_optForceRecursive; // Force recursive ipkg option checkbox | ||
100 | QCheckBox *m_optVerboseWget; // Force verbose_wget ipkg option checkbox | ||
99 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection | 101 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection |
100 | QLineEdit *m_optSourceLists; // Ipkg source lists destination directory | 102 | QLineEdit *m_optSourceLists; // Ipkg source lists destination directory |
101 | 103 | ||
102 | void initServerWidget(); | 104 | void initServerWidget(); |
103 | void initDestinationWidget(); | 105 | void initDestinationWidget(); |
104 | void initProxyWidget(); | 106 | void initProxyWidget(); |
105 | void initOptionsWidget(); | 107 | void initOptionsWidget(); |
106 | 108 | ||
107 | void initData(); | 109 | void initData(); |
108 | 110 | ||
109 | private slots: | 111 | private slots: |
110 | void slotServerSelected( int index ); | 112 | void slotServerSelected( int index ); |
111 | void slotServerNew(); | 113 | void slotServerNew(); |
112 | void slotServerEdit(); | 114 | void slotServerEdit(); |
113 | void slotServerDelete(); | 115 | void slotServerDelete(); |
114 | 116 | ||
115 | void slotDestSelected( int index ); | 117 | void slotDestSelected( int index ); |
116 | void slotDestNew(); | 118 | void slotDestNew(); |
117 | void slotDestEdit(); | 119 | void slotDestEdit(); |
118 | void slotDestDelete(); | 120 | void slotDestDelete(); |
119 | 121 | ||
120 | void slotOptSelectSourceListsPath(); | 122 | void slotOptSelectSourceListsPath(); |
121 | }; | 123 | }; |
122 | 124 | ||
123 | class OIpkgServerDlg : public QDialog | 125 | class OIpkgServerDlg : public QDialog |
124 | { | 126 | { |
125 | Q_OBJECT | 127 | Q_OBJECT |
126 | 128 | ||
127 | public: | 129 | public: |
128 | OIpkgServerDlg( OConfItem *server = 0l, QWidget *parent = 0l ); | 130 | OIpkgServerDlg( OConfItem *server = 0l, QWidget *parent = 0l ); |
129 | 131 | ||
130 | protected slots: | 132 | protected slots: |
131 | void accept(); | 133 | void accept(); |
132 | 134 | ||
133 | private: | 135 | private: |
134 | OConfItem *m_server; | 136 | OConfItem *m_server; |
135 | 137 | ||
136 | // UI controls | 138 | // UI controls |
137 | QLineEdit *m_name; // Server name edit box | 139 | QLineEdit *m_name; // Server name edit box |
138 | QLineEdit *m_location; // Server location URL edit box | 140 | QLineEdit *m_location; // Server location URL edit box |
139 | QCheckBox *m_compressed; // Indicates whether the server is a 'src/gz' feed | 141 | QCheckBox *m_compressed; // Indicates whether the server is a 'src/gz' feed |
140 | QCheckBox *m_active; // Indicates whether the server is activated | 142 | QCheckBox *m_active; // Indicates whether the server is activated |
141 | }; | 143 | }; |
142 | 144 | ||
143 | class OIpkgDestDlg : public QDialog | 145 | class OIpkgDestDlg : public QDialog |
144 | { | 146 | { |
145 | Q_OBJECT | 147 | Q_OBJECT |
146 | 148 | ||