summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager
authorzecke <zecke>2004-03-14 16:01:52 (UTC)
committer zecke <zecke>2004-03-14 16:01:52 (UTC)
commitf12af18557c8f376f0c6c30e80a85737ff6c592e (patch) (side-by-side diff)
treed60806f34f4ff6af82491579e80c9ef72cd4071e /noncore/settings/packagemanager
parent13aeeabab5f2a6262b33de83cc9559a49365e325 (diff)
downloadopie-f12af18557c8f376f0c6c30e80a85737ff6c592e.zip
opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.gz
opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.bz2
Make use of ODP
Diffstat (limited to 'noncore/settings/packagemanager') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp3
-rw-r--r--noncore/settings/packagemanager/main.cpp1
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp1
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.h2
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp1
5 files changed, 6 insertions, 2 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index aedd972..4a55c10 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -4,96 +4,97 @@
=. Copyright (c) 2003 Dan Williams <drw@handhelds.org>
             .=l.
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU 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 file 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 General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "installdlg.h"
#include <sys/vfs.h>
#include <qapplication.h>
#include <qcombobox.h>
#include <qfileinfo.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qmap.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <qpe/fileselector.h>
#include <qpe/resource.h>
#include <qpe/storage.h>
#include <opie2/ofiledialog.h>
#include "opackagemanager.h"
+using namespace Opie::Ui;
InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo,
OPackage::Command command1, QStringList *packages1,
OPackage::Command command2, QStringList *packages2,
OPackage::Command command3, QStringList *packages3 )
: QWidget( 0x0 )
, m_packman( pm )
, m_numCommands( 0 )
, m_currCommand( 0 )
{
// Save command/package list information
if ( command1 != OPackage::NotDefined )
{
m_command[ m_numCommands ] = command1;
m_packages[ m_numCommands ] = packages1;
++m_numCommands;
}
if ( command2 != OPackage::NotDefined )
{
m_command[ m_numCommands ] = command2;
m_packages[ m_numCommands ] = packages2;
++m_numCommands;
}
if ( command3 != OPackage::NotDefined )
{
m_command[ m_numCommands ] = command3;
m_packages[ m_numCommands ] = packages3;
++m_numCommands;
}
// Initialize UI
if ( parent )
parent->setCaption( caption );
QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 );
if ( showDestInfo )
{
QLabel *label = new QLabel( tr( "Destination" ), this );
layout->addWidget( label, 0, 0 );
m_destination = new QComboBox( this );
m_destination->insertStringList( *(m_packman->destinations()) );
layout->addWidget( m_destination, 0, 1 );
connect( m_destination, SIGNAL(highlighted(const QString&)),
this, SLOT(slotDisplayAvailSpace(const QString&)) );
label = new QLabel( tr( "Space Avail" ), this );
layout->addWidget( label, 1, 0 );
m_availSpace = new QLabel( this );
@@ -230,72 +231,72 @@ void InstallDlg::slotBtnStart()
m_btnStart->setText( tr( "Abort" ) );
m_btnStart->setIconSet( Resource::loadPixmap( "close" ) );
}
else
{
m_btnStart->setEnabled( false );
}
QString dest;
if ( m_destination )
dest = m_destination->currentText();
for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ )
{
// Execute next command
m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest,
this, SLOT(slotOutput(char*)), true );
}
// All commands executed, allow user to close dialog
m_btnStart->setEnabled( true );
m_btnStart->setText( tr( "Close" ) );
m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) );
m_btnOptions->setEnabled( true );
m_btnOptions->setText( tr( "Save output" ) );
m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
}
void InstallDlg::slotBtnOptions()
{
QString btnText = m_btnOptions->text();
if ( btnText == tr( "Options" ) )
{
// Display configuration dialog (only options tab is enabled)
m_packman->configureDlg( true );
return;
}
// Save output was clicked
QMap<QString, QStringList> map;
map.insert( tr( "All" ), QStringList() );
QStringList text;
text << "text/*";
map.insert(tr( "Text" ), text );
text << "*";
map.insert( tr( "All" ), text );
- QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
+ QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
if( !filename.isEmpty() )
{
QString currentFileName = QFileInfo( filename ).fileName();
DocLnk doc;
doc.setType( "text/plain" );
doc.setFile( filename );
doc.setName( currentFileName );
FileManager fm;
fm.saveFile( doc, m_output->text() );
}
}
void InstallDlg::slotOutput( char *msg )
{
// Allow processing of other events
qApp->processEvents();
QString lineStr = msg;
if ( lineStr[lineStr.length()-1] == '\n' )
lineStr.truncate( lineStr.length() - 1 );
m_output->append( lineStr );
m_output->setCursorPosition( m_output->numLines(), 0 );
}
diff --git a/noncore/settings/packagemanager/main.cpp b/noncore/settings/packagemanager/main.cpp
index 18ed644..c050e1a 100644
--- a/noncore/settings/packagemanager/main.cpp
+++ b/noncore/settings/packagemanager/main.cpp
@@ -1,34 +1,35 @@
/*
                This file is part of the OPIE Project
=. Copyright (c) 2003 Dan Williams <drw@handhelds.org>
             .=l.
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU 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 file 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 General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "mainwindow.h"
#include <opie2/oapplicationfactory.h>
+using namespace Opie::Core;
OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 84c6de4..592de3e 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -1,92 +1,93 @@
/*
                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.
*/
#include "oipkgconfigdlg.h"
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qpushbutton.h>
#include <qscrollview.h>
#include <qpe/resource.h>
+using namespace Opie::Ui;
OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent )
: QDialog( parent, QString::null, true )
, m_ipkg( ipkg )
, m_configs( 0x0 )
, m_installOptions( installOptions )
, m_serverNew( false )
, m_serverCurrent( -1 )
, m_destNew( false )
, m_destCurrent( -1 )
, m_layout( this, 2, 4 )
, m_tabWidget( this )
{
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" ) );
}
//showMaximized();
}
void OIpkgConfigDlg::accept()
{
// Save server, destination and proxy configuration
if ( !m_installOptions )
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h
index 88e020a..0aba898 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.h
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.h
@@ -29,97 +29,97 @@
*/
#ifndef OIPKGCONFIGDLG_H
#define OIPKGCONFIGDLG_H
#include <qdialog.h>
#include <qlayout.h>
#include <opie2/otabwidget.h>
#include "oipkg.h"
class QCheckBox;
class QComboBox;
class QLineEdit;
class QListBox;
class OIpkgConfigDlg : public QDialog
{
Q_OBJECT
public:
OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 );
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 cached information
bool m_serverNew; // Indicates if server information is for a new server
int m_serverCurrent; // Index of currently selected server in m_serverList
QString m_serverCurrName; // Name of currently selected server in m_serverList
// Destination cached information
bool m_destNew; // Indicates if destination information is for a new destination
int m_destCurrent; // Index of currently selected destination in m_destList
QString m_destCurrName; // Name of currently selected destination in m_destList
// UI controls
QVBoxLayout m_layout; // Main dialog layout control
- OTabWidget m_tabWidget; // Main tab widget 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
QLineEdit *m_serverName; // Server name edit box
QLineEdit *m_serverLocation; // Server location URL edit box
QCheckBox *m_serverActive; // Activate server check box
// Destination configuration UI controls
QListBox *m_destList; // Destination list selection
QLineEdit *m_destName; // Destination name edit box
QLineEdit *m_destLocation; // Destination location URL edit box
QCheckBox *m_destActive; // Activate destination check box
// 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
void initServerWidget();
void initDestinationWidget();
void initProxyWidget();
void initOptionsWidget();
void initData();
OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, const QString &name = 0x0 );
private slots:
void slotServerEdit( int index );
void slotServerNew();
void slotServerDelete();
void slotServerUpdate();
void slotDestEdit( int index );
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index 7abd17e..73d3de7 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -1,88 +1,89 @@
/*
                This file is part of the OPIE Project
=. Copyright (c) 2003 Dan Williams <drw@handhelds.org>
             .=l.
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU 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 file 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 General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "packageinfodlg.h"
#include "opackage.h"
#include "opackagemanager.h"
#include <qlayout.h>
#include <qpushbutton.h>
#include <qpe/resource.h>
#include <opie2/otabwidget.h>
+using namespace Opie::Ui;
PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
: QWidget( 0x0 )
, m_packman( pm )
, m_information( this )
, m_files( this )
{
// Initialize UI
if ( parent )
parent->setCaption( package );
QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
OTabWidget *tabWidget = new OTabWidget( this );
layout->addWidget( tabWidget );
// Information tab
m_information.reparent( tabWidget, QPoint( 0, 0 ) );
m_information.setReadOnly( true );
tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) );
// Retrive package information
m_package = m_packman->findPackage( package );
if ( !m_package )
{
m_information.setText( tr( "Unable to retrieve package information." ) );
return;
}
// Display package information
if ( !m_package->information().isNull() )
m_information.setText( m_package->information() );
else
{
// Package information is not cached, retrieve it
QStringList list( package );
m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true );
}
// Files tab (display only if package is installed)
if ( !m_package->versionInstalled().isNull() )
{
QWidget *filesWidget = new QWidget( tabWidget );
QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 );
m_files.reparent( filesWidget, QPoint( 0, 0 ) );
m_files.setReadOnly( true );
filesLayout->addWidget( &m_files );
QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ),