summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog7
-rw-r--r--noncore/settings/packagemanager/README6
-rw-r--r--noncore/settings/packagemanager/TODO6
-rw-r--r--noncore/settings/packagemanager/oconfitem.h2
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp81
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp68
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.h3
-rw-r--r--noncore/settings/packagemanager/opie-packagemanager.control2
8 files changed, 122 insertions, 53 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog
index 38756b1..92b542c 100644
--- a/noncore/settings/packagemanager/ChangeLog
+++ b/noncore/settings/packagemanager/ChangeLog
@@ -1,48 +1,55 @@
+2005-02-22 Dan Williams <drw@handhelds.org>
+
+ * Released version 0.6.2
+ * Added support for ipkg configuration option, 'lists_dir'
+ * Make app depend on libipkg-0.99.143, or greater
+ * Optimize ipkg configuration file read routine
+
2005-02-16 Dan Williams <drw@handhelds.org>
* Fixed stupid bug where last package in status file was not shown as installed when it should be
* Removed printf's
2005-01-02 Dan Williams <drw@handhelds.org>
* Released version 0.6.1
* Implemented native package linking code to remove need for ipkg-link
* Implement package in OIpkg (removed from InstallDlg) as this is ipkg specific
* Many small code tweaks
2004-12-21 Dan Williams <drw@handhelds.org>
* Released version 0.6.0
* Added support for Ipkg 'src/gz' feeds
* Improve server and destination tabs UI's in configuration dialog
* Fix app linking to link all dependent packages as well as selected packages
* Hide 'Retrive File List' button once list is retrieved in Package Info dialog
2004-11-18 Dan Williams <drw@handhelds.org>
* Released version 0.5.0
* All v1.0 functionality implemented
* Implemented installation of local packages
* Implemented linking of non-root apps (using ipkg-link)
* Many UI tweaks for installation and filter dialogs
2004-04-21 Dan Williams <drw@handhelds.org>
* Released version 0.4.0
* Added saving of ipkg configuration information
* Re-initialize ipkg when configuration information changes
* Added QWhatsThis for all UI controls
* Remove Location from OConfItem as it is not used/needed
* Re-ordered includes to follow Opie standards
2004-02-13 Dan Williams <drw@handhelds.org>
* Released version 0.3.0
* Fix handling of filtering options in View menu
* Do proper version string comparison
* Fix string alignment code in PromptDlg to eliminate QT warning messages
2004-02-12 Dan Williams <drw@handhelds.org>
* Package information dialog implemented
* What's This app icon enabled
diff --git a/noncore/settings/packagemanager/README b/noncore/settings/packagemanager/README
index ff6d113..9720cb4 100644
--- a/noncore/settings/packagemanager/README
+++ b/noncore/settings/packagemanager/README
@@ -1,55 +1,55 @@
/************************************************************************
/*
/* Opie - Package Manager
/* ========================
-/* Version 0.6.0
+/* Version 0.6.2
/*
/* A package management client for Opie
/*
/************************************************************************
-------------------------------------------------------
- Release Notes for Opie-PackageManager - January, 2004
+ Release Notes for Opie-PackageManager - February, 2004
-------------------------------------------------------
======================
= To-do =
======================
- See $OPIEDIR/noncore/settings/packagemanager/TODO for more info.
======================
= Build =
======================
In order to build opie-packagemanager, libipkg needs to be present on
the build system along with the appropriate headers.
- libipkg source (best to use version 109 or greater):
- Familiar CVS directory: familiar/dist/ipkg/C (e.g. 'cvs co familiar/dist/ipkg/C')
- FTP: ftp://handhelds.org/linux/packages/ipkg
- before building opie-packagemanager, define the environmental variable
IPKGDIR to point to the directory containing the ipkg source code
- e.g. 'export IPKGDIR=$HOME/familiar/dist/ipkg/C'
======================
= Run =
======================
- In order to use opie-packagemanager, libipkg must be installed
on the system.
======================
= Credits =
======================
-- Opie-PackageManager is (C) 2003-2004 Dan Williams
+- Opie-PackageManager is (C) 2003-2005 Dan Williams
======================
= Links =
======================
- Opie Project: http://opie.handhelds.org
- OpenZaurus Project: http://openzaurus.org
- Familiar Project: http://familiar.handhelds.org
diff --git a/noncore/settings/packagemanager/TODO b/noncore/settings/packagemanager/TODO
index 2512624..dd70b11 100644
--- a/noncore/settings/packagemanager/TODO
+++ b/noncore/settings/packagemanager/TODO
@@ -1,15 +1,13 @@
/************************************************************************
/*
/* Opie - Package Manager
/* ========================
-/* Version 0.6.1
+/* Version 0.6.2
/*
/* A package management client for Opie
/*
/************************************************************************
-----------------------------------------------
- To-do for Opie-PackageManager - January, 2005
+ To-do for Opie-PackageManager - February, 2005
-----------------------------------------------
-
-1. Re-work package download dialog
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h
index 9972c00..b306e93 100644
--- a/noncore/settings/packagemanager/oconfitem.h
+++ b/noncore/settings/packagemanager/oconfitem.h
@@ -1,89 +1,89 @@
/*
This file is part of the Opie Project
Copyright (c) 2003 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 OCONFITEM_H
#define OCONFITEM_H
#include <qlist.h>
#include <qstring.h>
class OConfItem
{
public:
- enum Type { Source, Destination, Option, Arch, NotDefined };
+ enum Type { Source, Destination, Option, Arch, Other, NotDefined };
OConfItem( Type type = NotDefined, const QString &name = QString::null,
const QString &value = QString::null, const QString &features = QString::null,
bool active = true );
Type type() { return m_type; }
const QString &name() { return m_name; }
const QString &value() { return m_value; }
const QString &features() { return m_features; }
bool active() { return m_active; }
void setType( Type type ) { m_type = type; }
void setName( const QString &name ) { m_name = name; }
void setValue( const QString &value ) { m_value = value; }
void setFeatures( const QString &features ) { m_features = features; }
void setActive( bool active ) { m_active = active; }
private:
Type m_type; // Type of configuration item
QString m_name; // Name of item
QString m_value; // Value of item
QString m_features; // Comma-deliminated list of features this item supports
bool m_active; // Indicates whether item is currently active
};
class OConfItemList : public QList<OConfItem>
{
private:
int compareItems( QCollection::Item item1, QCollection::Item item2 )
{
// Sort by OConfItem location then by type
OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type();
OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type();
if ( type1 < type2 )
return -1;
else if ( type1 == type2 )
{
QString name1 = reinterpret_cast<OConfItem*>(item1)->name();
QString name2 = reinterpret_cast<OConfItem*>(item2)->name();
if ( name1 < name2 )
return -1;
else if ( name1 == name2 )
return 0;
else /*if ( name1 > name2 )*/
return 1;
}
else /*if ( type1 > type2 )*/
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index e7e292e..3d2c621 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -107,116 +107,127 @@ OIpkg::~OIpkg()
OConfItemList *OIpkg::configItems()
{
// Retrieve all configuration items
return filterConfItems();
}
OConfItemList *OIpkg::servers()
{
// Retrieve only servers
return filterConfItems( OConfItem::Source );
}
OConfItemList *OIpkg::destinations()
{
// Retrieve only destinations
return filterConfItems( OConfItem::Destination );
}
OConfItemList *OIpkg::options()
{
// Retrieve only destinations
return filterConfItems( OConfItem::Option );
}
void OIpkg::setConfigItems( OConfItemList *configList )
{
if ( m_confInfo )
delete m_confInfo;
m_confInfo = configList;
// Write out new /etc/ipkg.conf
QFile confFile( IPKG_CONF );
if ( confFile.open( IO_WriteOnly ) )
{
QTextStream confStream( &confFile );
confStream << "# Generated by Opie Package Manager\n\n";
OConfItemListIterator it( *m_confInfo );
for ( ; it.current(); ++it )
{
OConfItem *item = it.current();
// Only write out valid conf items
if ( item->type() != OConfItem::NotDefined )
{
QString confLine;
+ QString name = item->name();
if ( !item->active() )
confLine = "#";
switch ( item->type() )
{
case OConfItem::Source :
{
if ( item->features().contains( "Compressed" ) )
confLine.append( "src/gz " );
else
confLine.append( "src " );
}
break;
case OConfItem::Destination : confLine.append( "dest " ); break;
case OConfItem::Option : confLine.append( "option " ); break;
case OConfItem::Arch : confLine.append( "arch " ); break;
+ case OConfItem::Other :
+ {
+ // For options w/type = Other, the mapping is as follows:
+ // name = typeStr (e.g. "lists_dir")
+ // value = value
+ // features = name (from configuration file)
+ confLine.append( item->name() );
+ name = item->features();
+ }
+ break;
default : break;
};
- confStream << confLine << " " << item->name() << " " << item->value() << "\n";
+ confStream << confLine << " " << name << " " << item->value() << "\n";
}
}
confFile.close();
}
else
{
// Problem writing to /etc/ipkg.conf, exit before removing other conf files
return;
}
// Delete /etc/ipkg/*.conf files (/etc/ipkg.conf should now have all settings
QStringList confFiles;
QDir confDir( IPKG_CONF_DIR );
if ( confDir.exists() )
{
confDir.setNameFilter( "*.conf" );
confDir.setFilter( QDir::Files );
confFiles = confDir.entryList( "*.conf", QDir::Files );
QStringList::Iterator lastFile = confFiles.end();
for ( QStringList::Iterator it = confFiles.begin(); it != lastFile; ++it )
{
// Create absolute file path if necessary
QString absFile = (*it);
if ( !absFile.startsWith( "/" ) )
absFile.prepend( QString( IPKG_CONF_DIR ) + "/" );
// Delete file
QFile::remove( absFile );
}
}
// Reinitialize libipkg to pick up new configuration
ipkg_deinit( &m_ipkgArgs );
ipkg_init( &fsignalIpkgMessage, &fIpkgResponse, &m_ipkgArgs );
m_ipkgArgs.noaction = false;
m_ipkgArgs.force_defaults = true;
}
void OIpkg::saveSettings()
{
// Save Ipkg execution options to application configuration file
if ( m_config )
{
m_config->setGroup( "Ipkg" );
m_config->writeEntry( "ExecOptions", m_ipkgExecOptions );
m_config->writeEntry( "Verbosity", m_ipkgExecVerbosity );
@@ -500,142 +511,156 @@ void OIpkg::ipkgStatus( char *status )
{
emit signalIpkgStatus( status );
}
void OIpkg::ipkgList( char *filelist )
{
emit signalIpkgList( filelist );
}
void OIpkg::loadConfiguration()
{
if ( m_confInfo )
delete m_confInfo;
// Load configuration item list
m_confInfo = new OConfItemList();
QStringList confFiles;
QDir confDir( IPKG_CONF_DIR );
if ( confDir.exists() )
{
confDir.setNameFilter( "*.conf" );
confDir.setFilter( QDir::Files );
confFiles = confDir.entryList( "*.conf", QDir::Files );
}
confFiles << IPKG_CONF;
QStringList::Iterator lastFile = confFiles.end();
for ( QStringList::Iterator it = confFiles.begin(); it != lastFile; ++it )
{
// Create absolute file path if necessary
QString absFile = (*it);
if ( !absFile.startsWith( "/" ) )
absFile.prepend( QString( IPKG_CONF_DIR ) + "/" );
// Read in file
QFile f( absFile );
if ( f.open( IO_ReadOnly ) )
{
QTextStream s( &f );
while ( !s.eof() )
{
QString line = s.readLine().simplifyWhiteSpace();
// Parse line and save info to the conf options list
if ( !line.isEmpty() )
{
- if ( !line.startsWith( "#" ) ||
- line.startsWith( "#src" ) ||
- line.startsWith( "#dest" ) ||
- line.startsWith( "#arch" ) ||
- line.startsWith( "#option" ) )
+ // Strip leading comment marker if exists
+ bool comment = false;
+ if ( line.startsWith( "#" ) )
{
- int pos = line.find( ' ', 1 );
+ line.remove( 0, 1 );
+ line = line.simplifyWhiteSpace();
+ comment = true;
+ }
+
+ bool recognizedOption = true;
+ int pos = line.find( ' ', 1 ) + 1;
+ int endpos = line.find( ' ', pos );
+
+ // Name
+ QString name = line.mid( pos, endpos - pos );
+
+ // Value
+ QString value = "";
+ if ( endpos > -1 )
+ value = line.right( line.length() - endpos - 1 );
+
+ // Active
+ bool active = !comment;
// Type
- QString typeStr = line.left( pos );
+ // For options w/type = Other, the mapping is as follows:
+ // name = typeStr (e.g. "lists_dir")
+ // value = value
+ // features = name (from configuration file)
+
+ QString typeStr = line.left( pos - 1 );
OConfItem::Type type;
QString features;
- if ( typeStr == "src" || typeStr == "#src" )
+ if ( typeStr == "src" )
type = OConfItem::Source;
- else if ( typeStr == "src/gz" || typeStr == "#src/gz" )
+ else if ( typeStr == "src/gz" )
{
type = OConfItem::Source;
features = "Compressed";
}
- else if ( typeStr == "dest" || typeStr == "#dest" )
+ else if ( typeStr == "dest" )
type = OConfItem::Destination;
- else if ( typeStr == "option" || typeStr == "#option" )
+ else if ( typeStr == "option" )
type = OConfItem::Option;
- else if ( typeStr == "arch" || typeStr == "#arch" )
+ else if ( typeStr == "arch" )
type = OConfItem::Arch;
+ else if ( typeStr == "lists_dir" )
+ {
+ type = OConfItem::Other;
+ features = name;
+ name = typeStr;
+ }
else
- type = OConfItem::NotDefined;
- ++pos;
- int endpos = line.find( ' ', pos );
-
- // Name
- QString name = line.mid( pos, endpos - pos );
-
- // Value
- QString value = "";
- if ( endpos > -1 )
- value = line.right( line.length() - endpos - 1 );
-
- // Active
- bool active = !line.startsWith( "#" );
+ recognizedOption = false;
// Add to list
+ if ( recognizedOption )
m_confInfo->append( new OConfItem( type, name, value, features, active ) );
}
}
- }
f.close();
}
}
// Load Ipkg execution options from application configuration file
if ( m_config )
{
m_config->setGroup( "Ipkg" );
m_ipkgExecOptions = m_config->readNumEntry( "ExecOptions", m_ipkgExecOptions );
m_ipkgExecVerbosity = m_config->readNumEntry( "Verbosity", m_ipkgExecVerbosity );
}
}
OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter )
{
// Load Ipkg configuration info if not already cached
if ( !m_confInfo )
loadConfiguration();
// Build new server list (caller is responsible for deleting)
OConfItemList *sl = new OConfItemList;
// If typefilter is empty, retrieve all items
bool retrieveAll = ( typefilter == OConfItem::NotDefined );
// Parse configuration info for servers
OConfItemListIterator it( *m_confInfo );
for ( ; it.current(); ++it )
{
OConfItem *item = it.current();
if ( retrieveAll || item->type() == typefilter )
{
sl->append( item );
}
}
return sl;
}
const QString &OIpkg::rootPath()
{
if ( m_rootPath.isEmpty() )
{
OConfItem *rootDest = findConfItem( OConfItem::Destination, "root" );
rootDest ? m_rootPath = rootDest->value()
: m_rootPath = '/';
if ( m_rootPath.right( 1 ) == '/' )
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index e6d6a81..7ee2d74 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -83,96 +83,103 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren
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() ) );
+ confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" );
+ if ( confItem )
+ confItem->setValue( m_optSourceLists->text() );
+ else
+ m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
+ m_optSourceLists->text(), "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;
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( Resource::loadPixmap( "new" ), tr( "New" ), container );
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()) );
@@ -252,173 +259,193 @@ void OIpkgConfigDlg::initProxyWidget()
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 );
- QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 );
+ 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->addWidget( m_optForceDepends );
+ 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->addWidget( m_optForceReinstall );
+ 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->addWidget( m_optForceRemove );
+ 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->addWidget( m_optForceOverwrite );
+ layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 );
- QLabel *l = new QLabel( tr( "Information Level" ), container );
+ QLabel *l = new QLabel( tr( "Information level:" ), container );
QWhatsThis::add( l, tr( "Select information level for Ipkg." ) );
- layout->addWidget( l );
+ layout->addMultiCellWidget( l, 4, 4, 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->addWidget( m_optVerboseIpkg );
+ layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 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 );
+
+ 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 );
+ QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container );
+ 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->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 )
{
- if ( config->type() == OConfItem::Source )
- {
- m_serverList->insertItem( config->name() );
- }
- else if ( config->type() == OConfItem::Destination )
+ switch ( config->type() )
{
- m_destList->insertItem( config->name() );
- }
- else if ( config->type() == OConfItem::Option )
+ 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 );
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()
@@ -468,96 +495,105 @@ void OIpkgConfigDlg::slotDestNew()
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() );
// Edit destination
if ( dest )
{
QString origName = dest->name();
OIpkgDestDlg dlg( dest, this );
if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted )
{
// Check to see if name has changed, if so update the dest list
if ( dest->name() != origName )
m_destList->changeItem( dest->name(), m_destCurrent );
}
}
}
void OIpkgConfigDlg::slotDestDelete()
{
// Find selected destination in list
OConfItem *destination = m_ipkg->findConfItem( OConfItem::Destination, m_destList->currentText() );
// Delete destination
if ( destination )
{
m_configs->removeRef( destination );
m_destList->removeItem( m_destCurrent );
}
}
+void OIpkgConfigDlg::slotOptSelectSourceListsPath()
+{
+ QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_optSourceLists->text() );
+ if ( path.at( path.length() - 1 ) == '/' )
+ path.truncate( path.length() - 1 );
+ if ( !path.isNull() )
+ m_optSourceLists->setText( path );
+}
+
OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent )
: QDialog( parent, QString::null, true, WStyle_ContextHelp )
, m_server( server )
{
setCaption( tr( "Edit Server" ) );
// Initialize UI
QVBoxLayout *layout = new QVBoxLayout( this, 2, 4 );
m_active = new QCheckBox( tr( "Active" ), this );
QWhatsThis::add( m_active, tr( "Tap here to indicate whether this entry is active or not." ) );
layout->addWidget( m_active );
layout->addStretch();
QLabel *label = new QLabel( tr( "Name:" ), this );
QWhatsThis::add( label, tr( "Enter the name of this entry here." ) );
layout->addWidget( label );
m_name = new QLineEdit( this );
QWhatsThis::add( m_name, tr( "Enter the name of this entry here." ) );
layout->addWidget( m_name );
layout->addStretch();
label = new QLabel( tr( "Address:" ), this );
QWhatsThis::add( label, tr( "Enter the URL address of this entry here." ) );
layout->addWidget( label );
m_location = new QLineEdit( this );
QWhatsThis::add( m_location, tr( "Enter the URL address of this entry here." ) );
layout->addWidget( m_location );
layout->addStretch();
m_compressed = new QCheckBox( tr( "Compressed server feed" ), this );
QWhatsThis::add( m_compressed, tr( "Tap here to indicate whether the server support compressed archives or not." ) );
layout->addWidget( m_compressed );
// Populate initial information
if ( m_server )
{
m_name->setText( m_server->name() );
m_location->setText( m_server->value() );
m_compressed->setChecked( m_server->features().contains( "Compressed" ) );
m_active->setChecked( m_server->active() );
}
}
void OIpkgServerDlg::accept()
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h
index 0fb2e16..9e23b62 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.h
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.h
@@ -54,111 +54,114 @@ 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
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
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control
index 5da7a84..94348dd 100644
--- a/noncore/settings/packagemanager/opie-packagemanager.control
+++ b/noncore/settings/packagemanager/opie-packagemanager.control
@@ -1,10 +1,10 @@
Package: opie-packagemanager
Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop
Priority: optional
Section: opie/settings
Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.143)
Replaces: packagemanager
Architecture: arm
Maintainer: Dan Williams (drw@handhelds.org)
Description: Opie package management client
-Version: 0.6.1$EXTRAVERSION
+Version: 0.6.2$EXTRAVERSION