22 files changed, 105 insertions, 139 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index d53a2b3..c9e33c4 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog @@ -1,2 +1,11 @@ +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> diff --git a/noncore/settings/packagemanager/README b/noncore/settings/packagemanager/README index 9324f9c..bf93c98 100644 --- a/noncore/settings/packagemanager/README +++ b/noncore/settings/packagemanager/README @@ -3,5 +3,5 @@ /* Opie - Package Manager /* ======================== -/* Version 0.3.0 +/* Version 0.4.0 /* /* A package management client for Opie diff --git a/noncore/settings/packagemanager/TODO b/noncore/settings/packagemanager/TODO index 448ade3..633c589 100644 --- a/noncore/settings/packagemanager/TODO +++ b/noncore/settings/packagemanager/TODO @@ -3,5 +3,5 @@ /* Opie - Package Manager /* ======================== -/* Version 0.3.0 +/* Version 0.4.0 /* /* A package management client for Opie @@ -17,8 +17,7 @@ ====================== -1. Save configuration information (i.e. /etc/ipkg.conf) -2. Link non-root destination apps -3. Implement QCOP interface for installing, removing, etc. -4. Redesign configuration dialog +1. Link non-root destination apps +2. Implement QCOP interface for installing, removing, etc. +3. Redesign configuration dialog ====================== diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp index 663abd2..fd275e1 100644 --- a/noncore/settings/packagemanager/entrydlg.cpp +++ b/noncore/settings/packagemanager/entrydlg.cpp @@ -30,4 +30,6 @@ #include "entrydlg.h" +#include <qpe/qpeapplication.h> + #include <qlabel.h> #include <qlayout.h> @@ -35,6 +37,4 @@ #include <qpushbutton.h> -#include <qpe/qpeapplication.h> - EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) : QDialog( parent, name, modal ) diff --git a/noncore/settings/packagemanager/filterdlg.h b/noncore/settings/packagemanager/filterdlg.h index de9ea80..bd89b42 100644 --- a/noncore/settings/packagemanager/filterdlg.h +++ b/noncore/settings/packagemanager/filterdlg.h @@ -31,4 +31,6 @@ #define FILTERDLG_H +#include "opackagemanager.h" + #include <qcheckbox.h> #include <qdialog.h> @@ -38,6 +40,4 @@ #include <qscrollview.h> -#include "opackagemanager.h" - class FilterDlg : public QDialog { diff --git a/noncore/settings/packagemanager/global.h b/noncore/settings/packagemanager/global.h deleted file mode 100644 index 0fe5b85..0000000 --- a/noncore/settings/packagemanager/global.h +++ b/dev/null @@ -1,37 +0,0 @@ -/* - 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 GLOBAL_H -#define GLOBAL_H - -#define VERSION "0.0.0" - -#endif
\ No newline at end of file diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 4a55c10..0cb30e2 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp @@ -30,5 +30,9 @@ #include "installdlg.h" -#include <sys/vfs.h> +#include <opie2/ofiledialog.h> + +#include <qpe/fileselector.h> +#include <qpe/resource.h> +#include <qpe/storage.h> #include <qapplication.h> @@ -42,13 +46,8 @@ #include <qpushbutton.h> -#include <qpe/fileselector.h> -#include <qpe/resource.h> -#include <qpe/storage.h> - -#include <opie2/ofiledialog.h> +#include <sys/vfs.h> #include "opackagemanager.h" -using namespace Opie::Ui; InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, OPackage::Command command1, QStringList *packages1, @@ -277,5 +276,5 @@ void InstallDlg::slotBtnOptions() map.insert( tr( "All" ), text ); - QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); + QString filename = Opie::Ui::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); if( !filename.isEmpty() ) { diff --git a/noncore/settings/packagemanager/main.cpp b/noncore/settings/packagemanager/main.cpp index c050e1a..3792881 100644 --- a/noncore/settings/packagemanager/main.cpp +++ b/noncore/settings/packagemanager/main.cpp @@ -32,4 +32,3 @@ #include <opie2/oapplicationfactory.h> -using namespace Opie::Core; -OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) +OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 810046f..991cc81 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp @@ -28,4 +28,15 @@ */ +#include "mainwindow.h" +#include "installdlg.h" +#include "filterdlg.h" +#include "promptdlg.h" +#include "entrydlg.h" +#include "packageinfodlg.h" + +#include <qpe/qcopenvelope_qws.h> +#include <qpe/qpeapplication.h> +#include <qpe/resource.h> + #include <qaction.h> #include <qdir.h> @@ -39,15 +50,4 @@ #include <qwhatsthis.h> -#include <qpe/qcopenvelope_qws.h> -#include <qpe/qpeapplication.h> -#include <qpe/resource.h> - -#include "mainwindow.h" -#include "installdlg.h" -#include "filterdlg.h" -#include "promptdlg.h" -#include "entrydlg.h" -#include "packageinfodlg.h" - MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) : QMainWindow( parent, name, WStyle_ContextHelp ) diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h index fb555c5..632effb 100644 --- a/noncore/settings/packagemanager/mainwindow.h +++ b/noncore/settings/packagemanager/mainwindow.h @@ -31,4 +31,8 @@ #define MAINWINDOW_H +#include "opackagemanager.h" + +#include <qpe/config.h> + #include <qlabel.h> #include <qlistview.h> @@ -39,8 +43,4 @@ #include <qwidgetstack.h> -#include <qpe/config.h> - -#include "opackagemanager.h" - class QAction; class QLineEdit; diff --git a/noncore/settings/packagemanager/oconfitem.cpp b/noncore/settings/packagemanager/oconfitem.cpp index 940a6de..a90730c 100644 --- a/noncore/settings/packagemanager/oconfitem.cpp +++ b/noncore/settings/packagemanager/oconfitem.cpp @@ -32,8 +32,7 @@ #include "oconfitem.h" -OConfItem::OConfItem( const QString &location, Type type, const QString &name, +OConfItem::OConfItem( Type type, const QString &name, const QString &value, bool active ) - : m_location( location ) - , m_type( type ) + : m_type( type ) , m_name( name ) , m_value( value ) diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index aeee511..db77980 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h @@ -41,8 +41,7 @@ public: enum Type { Source, Destination, Option, Arch, NotDefined }; - OConfItem( const QString &location = 0x0, Type type = NotDefined, const QString &name = 0x0, - const QString &value = 0x0, bool active = true ); + OConfItem( Type type = NotDefined, const QString &name = 0x0, const QString &value = 0x0, + bool active = true ); - const QString &location() { return m_location; } Type type() { return m_type; } const QString &name() { return m_name; } @@ -50,12 +49,10 @@ public: bool active() { return m_active; } - void setLocation( const QString &location ) { m_location = location; } - void setType( Type type ) { m_type = type; } - void setName( const QString &name ) { m_name = name; } - void setValue( const QString &value ) { m_value = value; } - void setActive( bool active ) { m_active = 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 setActive( bool active ) { m_active = active; } private: - QString m_location; // Configuration file where item is located Type m_type; // Type of configuration item QString m_name; // Name of item @@ -71,20 +68,20 @@ private: { // Sort by OConfItem location then by type - QString loc1 = reinterpret_cast<OConfItem*>(item1)->location(); - QString loc2 = reinterpret_cast<OConfItem*>(item2)->location(); - if ( loc1 < loc2 ) + OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); + OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); + if ( type1 < type2 ) return -1; - else if ( loc1 == loc2 ) + else if ( type1 == type2 ) { - OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); - OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); - if ( type1 < type2 ) + QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); + QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); + if ( name1 < name2 ) return -1; - else if ( type1 == type2 ) + else if ( name1 == name2 ) return 0; - else /*if ( type1 > type2 )*/ + else /*if ( name1 > name2 )*/ return 1; } - else /*if ( loc1 > loc2 )*/ + else /*if ( type1 > type2 )*/ return 1; } diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index 696a64a..87a30bb 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp @@ -32,11 +32,10 @@ #include "oipkg.h" -#include <stdlib.h> -#include <string.h> - #include <qdir.h> #include <qfile.h> #include <qtextstream.h> +#include <stdlib.h> + const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files @@ -530,5 +529,5 @@ void OIpkg::loadConfiguration() // Add to list - m_confInfo->append( new OConfItem( absFile, type, name, value, active ) ); + m_confInfo->append( new OConfItem( type, name, value, active ) ); } } diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h index ea126cf..b8a859a 100644 --- a/noncore/settings/packagemanager/oipkg.h +++ b/noncore/settings/packagemanager/oipkg.h @@ -33,14 +33,14 @@ #define OIPKG_H -extern "C" { -#include <libipkg.h> -}; - -#include <qobject.h> +#include "oconfitem.h" +#include "opackage.h" #include <qpe/config.h> -#include "oconfitem.h" -#include "opackage.h" +#include <qobject.h> + +extern "C" { +#include <libipkg.h> +}; // Ipkg execution options (m_ipkgExecOptions) diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index d134651..7941ab8 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp @@ -32,4 +32,6 @@ #include "oipkgconfigdlg.h" +#include <qpe/resource.h> + #include <qcheckbox.h> #include <qcombobox.h> @@ -42,7 +44,4 @@ #include <qwhatsthis.h> -#include <qpe/resource.h> - -using namespace Opie::Ui; OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) : QDialog( parent, QString::null, true, WStyle_ContextHelp ) @@ -102,5 +101,5 @@ void OIpkgConfigDlg::accept() } else - m_configs->append( new OConfItem( QString::null, OConfItem::Option, "http_proxy", + m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", m_proxyHttpServer->text(), m_proxyHttpActive->isChecked() ) ); @@ -112,5 +111,5 @@ void OIpkgConfigDlg::accept() } else - m_configs->append( new OConfItem( QString::null, OConfItem::Option, "ftp_proxy", + m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", m_proxyFtpServer->text(), m_proxyFtpActive->isChecked() ) ); @@ -119,5 +118,5 @@ void OIpkgConfigDlg::accept() confItem->setValue( m_proxyUsername->text() ); else - m_configs->append( new OConfItem( QString::null, OConfItem::Option, "proxy_username", + m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", m_proxyUsername->text() ) ); @@ -126,5 +125,5 @@ void OIpkgConfigDlg::accept() confItem->setValue( m_proxyPassword->text() ); else - m_configs->append( new OConfItem( QString::null, OConfItem::Option, "proxy_password", + m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", m_proxyPassword->text() ) ); @@ -533,5 +532,5 @@ void OIpkgConfigDlg::slotServerUpdate() { // Add new destination to configuration list - m_configs->append( new OConfItem( QString::null, OConfItem::Source, newName, + m_configs->append( new OConfItem( OConfItem::Source, newName, m_serverLocation->text(), m_serverActive->isChecked() ) ); m_configs->sort(); @@ -619,5 +618,5 @@ void OIpkgConfigDlg::slotDestUpdate() { // Add new destination to configuration list - m_configs->append( new OConfItem( QString::null, OConfItem::Destination, newName, + m_configs->append( new OConfItem( OConfItem::Destination, newName, m_destLocation->text(), m_destActive->isChecked() ) ); m_configs->sort(); diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index 0aba898..800d94a 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h @@ -34,9 +34,9 @@ #define OIPKGCONFIGDLG_H +#include <opie2/otabwidget.h> + #include <qdialog.h> #include <qlayout.h> -#include <opie2/otabwidget.h> - #include "oipkg.h" @@ -74,10 +74,10 @@ private: // 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 + 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 diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index 3633e05..f75d3b3 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp @@ -30,10 +30,10 @@ */ -#include <ctype.h> +#include "opackagemanager.h" +#include "oipkgconfigdlg.h" #include <qpe/qpeapplication.h> -#include "opackagemanager.h" -#include "oipkgconfigdlg.h" +#include <ctype.h> OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) diff --git a/noncore/settings/packagemanager/opackagemanager.h b/noncore/settings/packagemanager/opackagemanager.h index b710a51..58e597b 100644 --- a/noncore/settings/packagemanager/opackagemanager.h +++ b/noncore/settings/packagemanager/opackagemanager.h @@ -33,11 +33,11 @@ #define OPACKAGEMANAGER_H -#include <qdict.h> -#include <qobject.h> -#include <qstringlist.h> +#include "oipkg.h" #include <qpe/config.h> -#include "oipkg.h" +#include <qdict.h> +#include <qobject.h> +#include <qstringlist.h> class OPackageManager : public QObject diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control index aff8866..09bb18b 100644 --- a/noncore/settings/packagemanager/opie-packagemanager.control +++ b/noncore/settings/packagemanager/opie-packagemanager.control @@ -8,3 +8,3 @@ Architecture: arm Maintainer: Dan Williams (drw@handhelds.org) Description: Opie package management client -Version: 0.3.0$EXTRAVERSION +Version: 0.4.0$EXTRAVERSION diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index 73d3de7..d27eacb 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp @@ -32,12 +32,12 @@ #include "opackagemanager.h" -#include <qlayout.h> -#include <qpushbutton.h> +#include <opie2/otabwidget.h> #include <qpe/resource.h> -#include <opie2/otabwidget.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qwhatsthis.h> -using namespace Opie::Ui; PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) : QWidget( 0x0 ) @@ -52,8 +52,9 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); - OTabWidget *tabWidget = new OTabWidget( this ); + Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this ); layout->addWidget( tabWidget ); // Information tab + QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) ); m_information.reparent( tabWidget, QPoint( 0, 0 ) ); m_information.setReadOnly( true ); @@ -83,4 +84,5 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr QWidget *filesWidget = new QWidget( tabWidget ); QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); + QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); m_files.reparent( filesWidget, QPoint( 0, 0 ) ); m_files.setReadOnly( true ); @@ -89,4 +91,5 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Retrieve file list" ), filesWidget ); + QWhatsThis::add( btn, tr( "Tap here to retrieve list of files contained in this package." ) ); filesLayout->addWidget( btn ); connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h index 7ed9f0a..ec031e1 100644 --- a/noncore/settings/packagemanager/packageinfodlg.h +++ b/noncore/settings/packagemanager/packageinfodlg.h @@ -31,9 +31,9 @@ #define PACKAGEINFODLG_H +#include "opackage.h" + #include <qmultilineedit.h> #include <qwidget.h> -#include "opackage.h" - class QPushButton; diff --git a/noncore/settings/packagemanager/promptdlg.cpp b/noncore/settings/packagemanager/promptdlg.cpp index 4e82ba9..841b98e 100644 --- a/noncore/settings/packagemanager/promptdlg.cpp +++ b/noncore/settings/packagemanager/promptdlg.cpp @@ -30,4 +30,6 @@ #include "promptdlg.h" +#include <qpe/qpeapplication.h> + #include <qlabel.h> #include <qlayout.h> @@ -35,6 +37,4 @@ #include <qwidgetlist.h> -#include <qpe/qpeapplication.h> - PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, QWidget *parent ) |