-rw-r--r-- | ChangeLog | 1 | ||||
-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 |
5 files changed, 28 insertions, 5 deletions
@@ -1,103 +1,104 @@ 2005-??-?? Opie 1.2.2 New Features ------------ * Appearance: Added configuration options to set smallIconSize, bigIconSize, useBigPixmaps (hrw, drw) * Opie-Notes: Notes application based on NoteZ (hrw) + * OPIE-PackageManager: Added two configuration options: "Force recursive", "Verbose fetch" (hrw) Fixed Bugs ---------- * #1695 - Date selector use too small fontsize on VGA screen (hrw) * #1686 - opie-console lack UI setting for switching scrollbar (hrw) * #1647 - Opie-console doesn't respect scroll-bar on left side (hrw) * #1624 - Button settngs changes are applied only after restart (hrw) * #1492 - Backup and Restore does not show list of backups to restore on start (hrw) * n.a. - remove hardcoded font size from wellenreiter (hrw) * n.a. - added patch to build QT/E 2.3.10 with gcc 4.x.x (hrw) * n.a. - make blue-pin UI resizable to looks good in any resolution (hrw) * n.a. - fix a problem with vCard send to Sony Ericsson k600i (ar) * n.a. - add a patch to build Qt/E 2.3.10 on amd64 with gcc 4.x.x (ar) 2005-09-11 Opie 1.2.1 New Features ------------ * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly) * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer) * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl) * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl) * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) * Checkbook: Added configuration option to use smaller font for checkbook transaction tab (hrw) * ZSafe: Made UI conform to Opie standards (drw) * Today Addressbook plugin: Fixed configuration to show/not show birthdays, use checkboxes for selection (hrw) * Opie-Console: Read initial fixed font configuration from qpe.conf (mickeyl) * Opie-PcmciaApplet: Configure insert/resume actions and bind unsupported cards (mickeyl) * SysInfo: Remove CPU tab and add Devices tab instead (mickeyl) * Opie-smb: Added Opie front end for Samba (ljp) * Opie-Bluetooth: Replace obex send implementation and patch libopieobex and the bluetoothapplet (Michael Haynie) * Opieplayer: rudimentary podcast support (ljp) Fixed Bugs ---------- * #1377 - Suspend Powermanagement when switched to another VT (mickeyl) - We actually suspend the complete Opie now in that case. * #1384 - Battery status updated improperly when charging (skyhusker) * #1476 - Wrong order of application entries in the O-menu (skyhusker) * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl) * #1535 - Missing line break and unnecessary location shown with Today-Calendar plugin (deller) * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw) * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker) * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker) * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) * #1635 - opie-today, datebook-plugin does not show notes (skyhusker) * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker) * #1666 - Opie-IRC does not allow to add !channels in config as autojoin ones (skyhusker) * #1667 - Opie-IRC does not show messages from !channel (skyhusker) * #1679 - Security PIN plugin is QVGA sized (hrw) * #1682 - Properly resize tab control in OTabWidget (drw) * n.a. - always show volume and wireless applet popups inside visible screen (deller) * n.a. - scale O-Menu-Applets appropriately (mickeyl) * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl) * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl) * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl) * n.a. - Today Addressbook plugin fix configuration to show/not show birthdays, use checkboxes for selection (hrw) * n.a. - remove hardcoded font size from netsystemtime (hrw) * n.a. - remove hardcoded font size from checkbook graphs (hrw) * n.a. - Dagger - fixes for Sword 1.5.8, morph tag x-refs, closing last tab crash (drw) Internal -------- * Make BluezApplet use OTaskbarApplet (mickeyl) * libopiecore: rewrite OFileNotification to use the Linux 2.6 inotify interface (mickeyl) * libopiecore: add ODirNotification - recursive directory notifications (mickeyl) * libopienet: Skip hostap control interfaces 'wifi' and improve robustness in ONetworkInterface (mickeyl) * libopieui: Remove OVersatileView and OVersatileViewItem (mickeyl) * libopienet: Miscellaneous API cleanups (mickeyl) * libopiecore: Add linux pcmcia system abstraction classes (mickeyl) * libopiecore: ODevice now knows the default gfx driver to use (mteira,mickeyl) * libopiecore: Add support for the Sharp SL-C3100 "Borzoi" (mickeyl) * libopiecore: Add support for the new Linux Inputsystem Switches type [necessary for auto rotation in 2.6.13] (mickeyl) * Remove assumptions about default gfx driver ("Transformed") all over the place (mteira,mickeyl) * Fix / Optimize number of scanned directories (ljp) * Use five point mouse calibration to make calibrated mouse drivers work on newer Zaurii (rp,mickeyl) 2005-03-25 Opie 1.2.0 Fixed Bugs ---------- * #1613 - AdvancedFM - scale toolbar icons appropriately (drw) * #1620 - OFileSelector - show the button on press and not on press on hold (alwin) * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke) * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw) * n.a. - make qpeglobal.h include qglobal.h (zecke) 2005-03-20 Opie 1.2.0-rc1 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 @@ -329,192 +329,194 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & if ( !f.open( IO_ReadOnly ) ) return NULL; QTextStream t( &f ); // Process all information in status file bool newPackage = false; QString line = t.readLine(); QString name; QString version; QString status; while ( !t.eof() ) { // Determine key/value pair int pos = line.find( ':', 0 ); QString key; if ( pos > -1 ) key = line.mid( 0, pos ); else key = QString::null; QString value = line.mid( pos+2, line.length()-pos ); // Allocate new package and insert into list if ( newPackage && !key.isEmpty() ) { // Add to list only if it has a valid name and is installed if ( !name.isNull() && status.contains( " installed" ) ) { pl->append( new OPackage( name, QString::null, version, QString::null, destName ) ); name = QString::null; version = QString::null; status = QString::null; newPackage = false; } } // Update package data if ( key == "Package" ) name = value; else if ( key == "Version" ) version = value; else if ( key == "Status" ) status = value; else if ( key.isEmpty() && value.isEmpty() ) newPackage = true; // Skip past all description lines if ( key == "Description" ) { line = t.readLine(); while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() ) line = t.readLine(); } else line = t.readLine(); } f.close(); // Make sure to add to list last entry if ( !name.isNull() && status.contains( " installed" ) ) pl->append( new OPackage( name, QString::null, version, QString::null, destName ) ); return pl; } OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) { // Find configuration item in list OConfItemListIterator configIt( *m_confInfo ); OConfItem *config = 0l; for ( ; configIt.current(); ++configIt ) { config = configIt.current(); if ( config->type() == type && config->name() == name ) break; } if ( config && config->type() == type && config->name() == name ) return config; return 0l; } bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶meters, const QString &destination, const QObject *receiver, const char *slotOutput, bool rawOutput ) { if ( command == OPackage::NotDefined ) return false; // Set ipkg run-time options/arguments m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS ); m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL ); // TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE ); m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE ); + m_ipkgArgs.force_removal_of_dependent_packages = ( m_ipkgExecOptions & FORCE_RECURSIVE ); + m_ipkgArgs.verbose_wget = ( m_ipkgExecOptions & FORCE_VERBOSE_WGET ); m_ipkgArgs.verbosity = m_ipkgExecVerbosity; if ( m_ipkgArgs.dest ) free( m_ipkgArgs.dest ); if ( !destination.isNull() ) { int len = destination.length() + 1; m_ipkgArgs.dest = (char *)malloc( len ); strncpy( m_ipkgArgs.dest, destination, destination.length() ); m_ipkgArgs.dest[ len - 1 ] = '\0'; } else m_ipkgArgs.dest = 0l; // Connect output signal to widget if ( !rawOutput ) { // TODO - connect to local slot and parse output before emitting signalIpkgMessage } switch( command ) { case OPackage::Update : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); ipkg_lists_update( &m_ipkgArgs ); disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Upgrade : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); ipkg_packages_upgrade( &m_ipkgArgs ); // Re-link non-root destinations to make sure everything is in sync OConfItemList *destList = destinations(); OConfItemListIterator it( *destList ); for ( ; it.current(); ++it ) { OConfItem *dest = it.current(); if ( dest->name() != "root" ) linkPackageDir( dest->name() ); } delete destList; disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Install : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_install( &m_ipkgArgs, (*it) ); } if ( destination != "root" ) linkPackageDir( destination ); disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Remove : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); // Get list of destinations for unlinking of packages not installed to root OConfItemList *destList = destinations(); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { unlinkPackage( (*it), destList ); ipkg_packages_remove( &m_ipkgArgs, (*it), true ); } delete destList; disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Download : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_download( &m_ipkgArgs, (*it) ); } disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Info : { connect( this, SIGNAL(signalIpkgStatus(const QString &)), receiver, slotOutput ); ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0l ); disconnect( this, SIGNAL(signalIpkgStatus(const QString &)), 0, 0 ); }; break; case OPackage::Files : { connect( this, SIGNAL(signalIpkgList(const QString &)), receiver, slotOutput ); ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0l ); disconnect( this, SIGNAL(signalIpkgList(const QString &)), 0, 0 ); }; break; default : break; }; 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,110 +1,112 @@ /* This file is part of the Opie Project Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef OIPKG_H #define OIPKG_H #include "oconfitem.h" #include "opackage.h" #include <qpe/config.h> #include <qobject.h> // Ipkg execution options (m_ipkgExecOptions) #define FORCE_DEPENDS 0x0001 #define FORCE_REMOVE 0x0002 #define FORCE_REINSTALL 0x0004 #define FORCE_OVERWRITE 0x0008 +#define FORCE_RECURSIVE 0x0010 +#define FORCE_VERBOSE_WGET 0x0020 class OConfItemList; class OIpkg : public QObject { Q_OBJECT public: OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l ); ~OIpkg(); OConfItemList *configItems(); OConfItemList *servers(); OConfItemList *destinations(); OConfItemList *options(); int ipkgExecOptions() { return m_ipkgExecOptions; } int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } void setConfigItems( OConfItemList *configList ); void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } void saveSettings(); OPackageList *availablePackages( const QString &server = QString::null ); OPackageList *installedPackages( const QString &destName = QString::null, const QString &destPath = QString::null ); OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, const QString &name = QString::null ); bool executeCommand( OPackage::Command command = OPackage::NotDefined, const QStringList ¶meters = QStringList(), const QString &destination = QString::null, const QObject *receiver = 0l, const char *slotOutput = 0l, bool rawOutput = true ); void abortCommand(); void ipkgMessage( char *msg ); void ipkgStatus( char *status ); void ipkgList( char *filelist ); private: Config *m_config; // Pointer to application configuration file OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options int m_ipkgExecVerbosity; // Ipkg execution verbosity level QString m_rootPath; // Directory path where the 'root' destination is located void loadConfiguration(); OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); const QString &rootPath(); void linkPackageDir( const QString &dest = QString::null ); void unlinkPackage( const QString &package = QString::null, OConfItemList *destList = 0l ); signals: void signalIpkgMessage( const QString &msg ); void signalIpkgStatus( const QString &status ); void signalIpkgList( const QString &filelist ); }; #endif 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 @@ -57,475 +57,491 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren { setCaption( tr( "Configuration" ) ); // Initialize configuration widgets if ( !installOptions ) { initServerWidget(); initDestinationWidget(); initProxyWidget(); } initOptionsWidget(); // Load configuration information initData(); // Setup tabs for all info m_layout.addWidget( &m_tabWidget ); if ( !m_installOptions ) { m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); m_tabWidget.setCurrentTab( tr( "Servers" ) ); } else { m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); } } void OIpkgConfigDlg::accept() { // Save server, destination and proxy configuration if ( !m_installOptions ) { // Update proxy information before saving settings OConfItem *confItem = m_ipkg->findConfItem( OConfItem::Option, "http_proxy" ); if ( confItem ) { confItem->setValue( m_proxyHttpServer->text() ); confItem->setActive( m_proxyHttpActive->isChecked() ); } else m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", m_proxyHttpServer->text(), QString::null, m_proxyHttpActive->isChecked() ) ); confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); if ( confItem ) { confItem->setValue( m_proxyFtpServer->text() ); confItem->setActive( m_proxyFtpActive->isChecked() ); } else m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", m_proxyFtpServer->text(), QString::null, m_proxyFtpActive->isChecked() ) ); confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); if ( confItem ) confItem->setValue( m_proxyUsername->text() ); else m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", m_proxyUsername->text() ) ); confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); if ( confItem ) confItem->setValue( m_proxyPassword->text() ); else m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", m_proxyPassword->text() ) ); QString listsDir = m_optSourceLists->text(); if ( listsDir == QString::null || listsDir == "" ) listsDir = "/usr/lib/ipkg/lists"; // TODO - use proper libipkg define confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" ); if ( confItem ) confItem->setValue( listsDir ); else m_configs->append( new OConfItem( OConfItem::Other, "lists_dir", listsDir, "name" ) ); m_ipkg->setConfigItems( m_configs ); } // Save options configuration int options = 0; if ( m_optForceDepends->isChecked() ) options |= FORCE_DEPENDS; if ( m_optForceReinstall->isChecked() ) options |= FORCE_REINSTALL; if ( m_optForceRemove->isChecked() ) options |= FORCE_REMOVE; if ( m_optForceOverwrite->isChecked() ) options |= FORCE_OVERWRITE; + if ( m_optForceRecursive->isChecked() ) + options |= FORCE_RECURSIVE; + if ( m_optVerboseWget->isChecked() ) + options |= FORCE_VERBOSE_WGET; m_ipkg->setIpkgExecOptions( options ); m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); QDialog::accept(); } void OIpkgConfigDlg::reject() { if ( m_configs ) delete m_configs; } void OIpkgConfigDlg::initServerWidget() { m_serverWidget = new QWidget( this ); // Initialize UI QVBoxLayout *vb = new QVBoxLayout( m_serverWidget ); QScrollView *sv = new QScrollView( m_serverWidget ); vb->addWidget( sv, 0, 0 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); m_serverList = new QListBox( container ); 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." ) ); m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), tr( "New" ), container ); btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); layout->addWidget( btn, 1, 0 ); m_serverEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), tr( "Edit" ), container ); m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); m_serverEditBtn->setEnabled( false ); QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); layout->addWidget( m_serverEditBtn, 1, 1 ); m_serverDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), tr( "Delete" ), container ); m_serverDeleteBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); m_serverDeleteBtn->setEnabled( false ); QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); layout->addWidget( m_serverDeleteBtn, 1, 2 ); } void OIpkgConfigDlg::initDestinationWidget() { m_destWidget = new QWidget( this ); // Initialize UI QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); QScrollView *sv = new QScrollView( m_destWidget ); vb->addWidget( sv, 0, 0 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); m_destList = new QListBox( container ); QWhatsThis::add( m_destList, tr( "This is a list of all destinations configured for this device. Select one here to edit or delete, or add a new one below." ) ); m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) ); layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 ); QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), tr( "New" ), container ); btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); layout->addWidget( btn, 1, 0 ); m_destEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), tr( "Edit" ), container ); m_destEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); m_destEditBtn->setEnabled( false ); QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); layout->addWidget( m_destEditBtn, 1, 1 ); m_destDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), tr( "Delete" ), container ); m_destDeleteBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); m_destDeleteBtn->setEnabled( false ); QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); layout->addWidget( m_destDeleteBtn, 1, 2 ); } void OIpkgConfigDlg::initProxyWidget() { m_proxyWidget = new QWidget( this ); // Initialize UI QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); QScrollView *sv = new QScrollView( m_proxyWidget ); vb->addWidget( sv, 0, 0 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 ); // HTTP proxy server configuration QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); grpbox->layout()->setSpacing( 2 ); grpbox->layout()->setMargin( 4 ); layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); m_proxyHttpServer = new QLineEdit( grpbox ); QWhatsThis::add( m_proxyHttpServer, tr( "Enter the URL address of the HTTP proxy server here." ) ); grplayout->addWidget( m_proxyHttpServer ); m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox ); QWhatsThis::add( m_proxyHttpActive, tr( "Tap here to enable or disable the HTTP proxy server." ) ); grplayout->addWidget( m_proxyHttpActive ); // FTP proxy server configuration grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); grpbox->layout()->setSpacing( 2 ); grpbox->layout()->setMargin( 4 ); layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); grplayout = new QVBoxLayout( grpbox->layout() ); m_proxyFtpServer = new QLineEdit( grpbox ); QWhatsThis::add( m_proxyFtpServer, tr( "Enter the URL address of the FTP proxy server here." ) ); grplayout->addWidget( m_proxyFtpServer ); m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox ); QWhatsThis::add( m_proxyFtpActive, tr( "Tap here to enable or disable the FTP proxy server." ) ); grplayout->addWidget( m_proxyFtpActive ); // Proxy server username and password configuration QLabel *label = new QLabel( tr( "Username:" ), container ); QWhatsThis::add( label, tr( "Enter the username for the proxy servers here." ) ); layout->addWidget( label, 2, 0 ); m_proxyUsername = new QLineEdit( container ); QWhatsThis::add( m_proxyUsername, tr( "Enter the username for the proxy servers here." ) ); layout->addWidget( m_proxyUsername, 2, 1 ); label = new QLabel( tr( "Password:" ), container ); QWhatsThis::add( label, tr( "Enter the password for the proxy servers here." ) ); layout->addWidget( label, 3, 0 ); m_proxyPassword = new QLineEdit( container ); QWhatsThis::add( m_proxyPassword, tr( "Enter the password for the proxy servers here." ) ); layout->addWidget( m_proxyPassword, 3, 1 ); } void OIpkgConfigDlg::initOptionsWidget() { m_optionsWidget = new QWidget( this ); // Initialize UI QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); QScrollView *sv = new QScrollView( m_optionsWidget ); vb->addWidget( sv, 0, 0 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 ); m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 ); m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 ); m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 ); m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 ); + m_optForceRecursive = new QCheckBox( tr( "Force Recursive" ), container ); + QWhatsThis::add( m_optForceRecursive, tr( "Tap here to enable or disable the '-recursive' option for Ipkg." ) ); + layout->addMultiCellWidget( m_optForceRecursive, 4, 4, 0, 1 ); + + m_optVerboseWget = new QCheckBox( tr( "Verbose fetch" ), container ); + QWhatsThis::add( m_optVerboseWget, tr( "Tap here to enable or disable the '-verbose_wget' option for Ipkg." ) ); + layout->addMultiCellWidget( m_optVerboseWget, 5, 5, 0, 1 ); + QLabel *l = new QLabel( tr( "Information level:" ), container ); QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); - layout->addMultiCellWidget( l, 4, 4, 0, 1 ); + layout->addMultiCellWidget( l, 6, 6, 0, 1 ); m_optVerboseIpkg = new QComboBox( container ); QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); - layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 ); + layout->addMultiCellWidget( m_optVerboseIpkg, 7, 7, 0, 1 ); l = new QLabel( tr( "Package source lists directory:" ), container ); QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) ); - layout->addMultiCellWidget( l, 6, 6, 0, 1 ); + layout->addMultiCellWidget( l, 8, 8, 0, 1 ); m_optSourceLists = new QLineEdit( container ); QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); - layout->addWidget( m_optSourceLists, 7, 0 ); + layout->addWidget( m_optSourceLists, 9, 0 ); QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ), QString::null, container ); btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); btn->setMaximumWidth( btn->height() ); QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); - layout->addWidget( btn, 7, 1 ); + layout->addWidget( btn, 9, 1 ); layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); } void OIpkgConfigDlg::initData() { // Read ipkg configuration (server/destination/proxy) information if ( m_ipkg && !m_installOptions ) { m_configs = m_ipkg->configItems(); if ( m_configs ) { for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) { OConfItem *config = configIt.current(); // Add configuration item to the appropriate dialog controls if ( config ) { switch ( config->type() ) { case OConfItem::Source : m_serverList->insertItem( config->name() ); break; case OConfItem::Destination : m_destList->insertItem( config->name() ); break; case OConfItem::Option : { if ( config->name() == "http_proxy" ) { m_proxyHttpServer->setText( config->value() ); m_proxyHttpActive->setChecked( config->active() ); } else if ( config->name() == "ftp_proxy" ) { m_proxyFtpServer->setText( config->value() ); m_proxyFtpActive->setChecked( config->active() ); } else if ( config->name() == "proxy_username" ) { m_proxyUsername->setText( config->value() ); } else if ( config->name() == "proxy_password" ) { m_proxyPassword->setText( config->value() ); } } break; case OConfItem::Other : { if ( config->name() == "lists_dir" ) m_optSourceLists->setText( config->value() ); else // TODO - use proper libipkg define m_optSourceLists->setText( "/usr/lib/ipkg/lists" ); } break; default : break; }; } } } } // Get Ipkg execution options int options = m_ipkg->ipkgExecOptions(); if ( options & FORCE_DEPENDS ) m_optForceDepends->setChecked( true ); if ( options & FORCE_REINSTALL ) m_optForceReinstall->setChecked( true ); if ( options & FORCE_REMOVE ) m_optForceRemove->setChecked( true ); if ( options & FORCE_OVERWRITE ) m_optForceOverwrite->setChecked( true ); + if ( options & FORCE_RECURSIVE ) + m_optForceRecursive->setChecked( true ); + if ( options & FORCE_VERBOSE_WGET ) + m_optVerboseWget->setChecked( true ); m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); } void OIpkgConfigDlg::slotServerSelected( int index ) { m_serverCurrent = index; // Enable Edit and Delete buttons m_serverEditBtn->setEnabled( true ); m_serverDeleteBtn->setEnabled( true ); } void OIpkgConfigDlg::slotServerNew() { OConfItem *server = new OConfItem( OConfItem::Source ); OIpkgServerDlg dlg( server, this ); if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { // Add to configuration option list m_configs->append( server ); m_configs->sort(); // Add to server list m_serverList->insertItem( server->name() ); m_serverList->setCurrentItem( m_serverList->count() ); } else delete server; } void OIpkgConfigDlg::slotServerEdit() { // Find selected server in list OConfItem *server = m_ipkg->findConfItem( OConfItem::Source, m_serverList->currentText() ); // Edit server if ( server ) { QString origName = server->name(); OIpkgServerDlg dlg( server, this ); if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { // Check to see if name has changed, if so update the server list if ( server->name() != origName ) m_serverList->changeItem( server->name(), m_serverCurrent ); } } } void OIpkgConfigDlg::slotServerDelete() { // Find selected server in list OConfItem *server = m_ipkg->findConfItem( OConfItem::Source, m_serverList->currentText() ); // Delete server if ( server ) { m_configs->removeRef( server ); m_serverList->removeItem( m_serverCurrent ); } } void OIpkgConfigDlg::slotDestSelected( int index ) { m_destCurrent = index; // Enable Edit and Delete buttons m_destEditBtn->setEnabled( true ); m_destDeleteBtn->setEnabled( true ); } void OIpkgConfigDlg::slotDestNew() { OConfItem *dest = new OConfItem( OConfItem::Destination ); OIpkgDestDlg dlg( dest, this ); if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { // Add to configuration option list m_configs->append( dest ); m_configs->sort(); // Add to destination list m_destList->insertItem( dest->name() ); m_destList->setCurrentItem( m_destList->count() ); } else delete dest; } void OIpkgConfigDlg::slotDestEdit() { // Find selected destination in list OConfItem *dest = m_ipkg->findConfItem( OConfItem::Destination, m_destList->currentText() ); 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 @@ -3,163 +3,165 @@ Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef OIPKGCONFIGDLG_H #define OIPKGCONFIGDLG_H #include <opie2/otabwidget.h> #include <qdialog.h> #include <qlayout.h> #include "oipkg.h" class QCheckBox; class QComboBox; class QLineEdit; class QListBox; class QPushButton; class OIpkgConfigDlg : public QDialog { Q_OBJECT public: OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); protected slots: void accept(); void reject(); private: OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options OConfItemList *m_configs; // Local list of configuration items bool m_installOptions; // If true, will only display the Options tab // Server/Destination cached information int m_serverCurrent; // Index of currently selected server in m_serverList int m_destCurrent; // Index of currently selected destination in m_destList // UI controls QVBoxLayout m_layout; // Main dialog layout control Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control QWidget *m_serverWidget; // Widget containing server configuration controls QWidget *m_destWidget; // Widget containing destination configuration controls QWidget *m_proxyWidget; // Widget containing proxy configuration controls QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls // Server configuration UI controls QListBox *m_serverList; // Server list selection QPushButton *m_serverEditBtn; // Server edit button QPushButton *m_serverDeleteBtn; // Server edit button // Destination configuration UI controls QListBox *m_destList; // Destination list selection QPushButton *m_destEditBtn; // Destination edit button QPushButton *m_destDeleteBtn; // Destination edit button // Proxy server configuration UI controls QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box QLineEdit *m_proxyFtpServer; // FTP proxy server edit box QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box QLineEdit *m_proxyUsername; // Proxy server username edit box QLineEdit *m_proxyPassword; // Proxy server password edit box // Options configuration UI controls QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox + QCheckBox *m_optForceRecursive; // Force recursive ipkg option checkbox + QCheckBox *m_optVerboseWget; // Force verbose_wget ipkg option checkbox QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection QLineEdit *m_optSourceLists; // Ipkg source lists destination directory void initServerWidget(); void initDestinationWidget(); void initProxyWidget(); void initOptionsWidget(); void initData(); private slots: void slotServerSelected( int index ); void slotServerNew(); void slotServerEdit(); void slotServerDelete(); void slotDestSelected( int index ); void slotDestNew(); void slotDestEdit(); void slotDestDelete(); void slotOptSelectSourceListsPath(); }; class OIpkgServerDlg : public QDialog { Q_OBJECT public: OIpkgServerDlg( OConfItem *server = 0l, QWidget *parent = 0l ); protected slots: void accept(); private: OConfItem *m_server; // UI controls QLineEdit *m_name; // Server name edit box QLineEdit *m_location; // Server location URL edit box QCheckBox *m_compressed; // Indicates whether the server is a 'src/gz' feed QCheckBox *m_active; // Indicates whether the server is activated }; class OIpkgDestDlg : public QDialog { Q_OBJECT public: OIpkgDestDlg( OConfItem *dest = 0l, QWidget *parent = 0l ); protected slots: void accept(); private: OConfItem *m_dest; // UI controls QLineEdit *m_name; // Destination name edit box QLineEdit *m_location; // Destination location URL edit box QCheckBox *m_active; // Indicates whether the destination is activated private slots: void slotSelectPath(); }; #endif |