summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog9
-rw-r--r--noncore/settings/packagemanager/README2
-rw-r--r--noncore/settings/packagemanager/TODO9
-rw-r--r--noncore/settings/packagemanager/entrydlg.cpp4
-rw-r--r--noncore/settings/packagemanager/filterdlg.h4
-rw-r--r--noncore/settings/packagemanager/global.h37
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp15
-rw-r--r--noncore/settings/packagemanager/main.cpp3
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp22
-rw-r--r--noncore/settings/packagemanager/mainwindow.h8
-rw-r--r--noncore/settings/packagemanager/oconfitem.cpp5
-rw-r--r--noncore/settings/packagemanager/oconfitem.h35
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp7
-rw-r--r--noncore/settings/packagemanager/oipkg.h14
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp17
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.h16
-rw-r--r--noncore/settings/packagemanager/opackagemanager.cpp6
-rw-r--r--noncore/settings/packagemanager/opackagemanager.h8
-rw-r--r--noncore/settings/packagemanager/opie-packagemanager.control2
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp13
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.h4
-rw-r--r--noncore/settings/packagemanager/promptdlg.cpp4
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,24 +1,33 @@
12004-04-21 Dan Williams <drw@handhelds.org>
2
3 * Released version 0.4.0
4 * Added saving of ipkg configuration information
5 * Re-initialize ipkg when configuration information changes
6 * Added QWhatsThis for all UI controls
7 * Remove Location from OConfItem as it is not used/needed
8 * Re-ordered includes to follow Opie standards
9
12004-02-13 Dan Williams <drw@handhelds.org> 102004-02-13 Dan Williams <drw@handhelds.org>
2 11
3 * Released version 0.3.0 12 * Released version 0.3.0
4 * Fix handling of filtering options in View menu 13 * Fix handling of filtering options in View menu
5 * Do proper version string comparison 14 * Do proper version string comparison
6 * Fix string alignment code in PromptDlg to eliminate QT warning messages 15 * Fix string alignment code in PromptDlg to eliminate QT warning messages
7 16
82004-02-12 Dan Williams <drw@handhelds.org> 172004-02-12 Dan Williams <drw@handhelds.org>
9 18
10 * Package information dialog implemented 19 * Package information dialog implemented
11 * What's This app icon enabled 20 * What's This app icon enabled
12 * Changed all QDialog::exec() occurences to QPEApplication::execDialog() 21 * Changed all QDialog::exec() occurences to QPEApplication::execDialog()
13 22
142004-01-23 Dan Williams <drw@handhelds.org> 232004-01-23 Dan Williams <drw@handhelds.org>
15 24
16 * Added package download functionality 25 * Added package download functionality
17 * Have Opie update links after install/removal so that apps 26 * Have Opie update links after install/removal so that apps
18 will display properly in Launcher 27 will display properly in Launcher
19 28
202004-01-20 Dan Williams <drw@handhelds.org> 292004-01-20 Dan Williams <drw@handhelds.org>
21 30
22 * Released version 0.2.0 31 * Released version 0.2.0
23 * Converted to use libipkg in place of spawning ipkg process 32 * Converted to use libipkg in place of spawning ipkg process
24 33
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
@@ -1,29 +1,29 @@
1/************************************************************************ 1/************************************************************************
2/* 2/*
3/* Opie - Package Manager 3/* Opie - Package Manager
4/* ======================== 4/* ========================
5/* Version 0.3.0 5/* Version 0.4.0
6/* 6/*
7/* A package management client for Opie 7/* A package management client for Opie
8/* 8/*
9/************************************************************************ 9/************************************************************************
10 10
11------------------------------------------------------- 11-------------------------------------------------------
12 Release Notes for Opie-PackageManager - January, 2004 12 Release Notes for Opie-PackageManager - January, 2004
13------------------------------------------------------- 13-------------------------------------------------------
14 14
15====================== 15======================
16= To-do = 16= To-do =
17====================== 17======================
18 18
19- See $OPIEDIR/noncore/settings/packagemanager/TODO for more info. 19- See $OPIEDIR/noncore/settings/packagemanager/TODO for more info.
20 20
21====================== 21======================
22= Build = 22= Build =
23====================== 23======================
24 24
25In order to build opie-packagemanager, libipkg needs to be present on 25In order to build opie-packagemanager, libipkg needs to be present on
26the build system along with the appropriate headers. 26the build system along with the appropriate headers.
27 27
28- libipkg source (best to use version 109 or greater): 28- libipkg source (best to use version 109 or greater):
29 - Familiar CVS directory: familiar/dist/ipkg/C (e.g. 'cvs co familiar/dist/ipkg/C') 29 - Familiar CVS directory: familiar/dist/ipkg/C (e.g. 'cvs co familiar/dist/ipkg/C')
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
@@ -1,28 +1,27 @@
1/************************************************************************ 1/************************************************************************
2/* 2/*
3/* Opie - Package Manager 3/* Opie - Package Manager
4/* ======================== 4/* ========================
5/* Version 0.3.0 5/* Version 0.4.0
6/* 6/*
7/* A package management client for Opie 7/* A package management client for Opie
8/* 8/*
9/************************************************************************ 9/************************************************************************
10 10
11--------------------------------------------- 11---------------------------------------------
12 To-do for Opie-PackageManager - April, 2004 12 To-do for Opie-PackageManager - April, 2004
13--------------------------------------------- 13---------------------------------------------
14 14
15====================== 15======================
16= Current release = 16= Current release =
17====================== 17======================
18 18
191. Save configuration information (i.e. /etc/ipkg.conf) 191. Link non-root destination apps
202. Link non-root destination apps 202. Implement QCOP interface for installing, removing, etc.
213. Implement QCOP interface for installing, removing, etc. 213. Redesign configuration dialog
224. Redesign configuration dialog
23 22
24====================== 23======================
25= Future releases = 24= Future releases =
26====================== 25======================
27 26
281. ??? \ No newline at end of file 271. ??? \ No newline at end of file
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
@@ -8,55 +8,55 @@
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "entrydlg.h" 30#include "entrydlg.h"
31 31
32#include <qpe/qpeapplication.h>
33
32#include <qlabel.h> 34#include <qlabel.h>
33#include <qlayout.h> 35#include <qlayout.h>
34#include <qlineedit.h> 36#include <qlineedit.h>
35#include <qpushbutton.h> 37#include <qpushbutton.h>
36 38
37#include <qpe/qpeapplication.h>
38
39EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) 39EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal )
40 : QDialog( parent, name, modal ) 40 : QDialog( parent, name, modal )
41{ 41{
42 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); 42 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 );
43 43
44 QLabel *l = new QLabel( label, this ); 44 QLabel *l = new QLabel( label, this );
45 l->setAlignment( AlignLeft | AlignTop | WordBreak ); 45 l->setAlignment( AlignLeft | AlignTop | WordBreak );
46 vbox->addWidget( l ); 46 vbox->addWidget( l );
47 47
48 m_entry = new QLineEdit( this ); 48 m_entry = new QLineEdit( this );
49 vbox->addWidget( m_entry ); 49 vbox->addWidget( m_entry );
50 50
51 connect( m_entry, SIGNAL(returnPressed()), this, SLOT(tryAccept()) ); 51 connect( m_entry, SIGNAL(returnPressed()), this, SLOT(tryAccept()) );
52} 52}
53 53
54void EntryDlg::setText( const QString &text ) 54void EntryDlg::setText( const QString &text )
55{ 55{
56 m_entry->setText( text ); 56 m_entry->setText( text );
57 m_entry->selectAll(); 57 m_entry->selectAll();
58} 58}
59 59
60QString EntryDlg::getText() 60QString EntryDlg::getText()
61{ 61{
62 return m_entry->text(); 62 return m_entry->text();
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
@@ -9,57 +9,57 @@
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#ifndef FILTERDLG_H 30#ifndef FILTERDLG_H
31#define FILTERDLG_H 31#define FILTERDLG_H
32 32
33#include "opackagemanager.h"
34
33#include <qcheckbox.h> 35#include <qcheckbox.h>
34#include <qdialog.h> 36#include <qdialog.h>
35#include <qcombobox.h> 37#include <qcombobox.h>
36#include <qlayout.h> 38#include <qlayout.h>
37#include <qlineedit.h> 39#include <qlineedit.h>
38#include <qscrollview.h> 40#include <qscrollview.h>
39 41
40#include "opackagemanager.h"
41
42class FilterDlg : public QDialog 42class FilterDlg : public QDialog
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 45
46public: 46public:
47 FilterDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &name = 0x0, 47 FilterDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &name = 0x0,
48 const QString &server = 0x0, const QString &destination = 0x0, 48 const QString &server = 0x0, const QString &destination = 0x0,
49 OPackageManager::Status status = OPackageManager::All, 49 OPackageManager::Status status = OPackageManager::All,
50 const QString &category = 0x0 ); 50 const QString &category = 0x0 );
51 51
52 QString name() 52 QString name()
53 { return m_nameCB->isChecked() ? m_name->text() : QString::null; }; 53 { return m_nameCB->isChecked() ? m_name->text() : QString::null; };
54 QString server() 54 QString server()
55 { return m_serverCB->isChecked() ? m_server->currentText() : QString::null; }; 55 { return m_serverCB->isChecked() ? m_server->currentText() : QString::null; };
56 QString destination() 56 QString destination()
57 { return m_destCB->isChecked() ? m_destination->currentText() : QString::null; }; 57 { return m_destCB->isChecked() ? m_destination->currentText() : QString::null; };
58 OPackageManager::Status status() 58 OPackageManager::Status status()
59 { 59 {
60 if ( m_statusCB->isChecked() ) 60 if ( m_statusCB->isChecked() )
61 { 61 {
62 if ( m_status->currentText() == tr( "All" ) ) 62 if ( m_status->currentText() == tr( "All" ) )
63 return OPackageManager::All; 63 return OPackageManager::All;
64 else if ( m_status->currentText() == tr( "Installed" ) ) 64 else if ( m_status->currentText() == tr( "Installed" ) )
65 return OPackageManager::Installed; 65 return OPackageManager::Installed;
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 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2003 Dan Williams <drw@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29
30*/
31
32#ifndef GLOBAL_H
33#define GLOBAL_H
34
35#define VERSION "0.0.0"
36
37#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
@@ -8,69 +8,68 @@
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "installdlg.h" 30#include "installdlg.h"
31 31
32#include <sys/vfs.h> 32#include <opie2/ofiledialog.h>
33
34#include <qpe/fileselector.h>
35#include <qpe/resource.h>
36#include <qpe/storage.h>
33 37
34#include <qapplication.h> 38#include <qapplication.h>
35#include <qcombobox.h> 39#include <qcombobox.h>
36#include <qfileinfo.h> 40#include <qfileinfo.h>
37#include <qgroupbox.h> 41#include <qgroupbox.h>
38#include <qlabel.h> 42#include <qlabel.h>
39#include <qlayout.h> 43#include <qlayout.h>
40#include <qmap.h> 44#include <qmap.h>
41#include <qmultilineedit.h> 45#include <qmultilineedit.h>
42#include <qpushbutton.h> 46#include <qpushbutton.h>
43 47
44#include <qpe/fileselector.h> 48#include <sys/vfs.h>
45#include <qpe/resource.h>
46#include <qpe/storage.h>
47
48#include <opie2/ofiledialog.h>
49 49
50#include "opackagemanager.h" 50#include "opackagemanager.h"
51 51
52using namespace Opie::Ui;
53InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, 52InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo,
54 OPackage::Command command1, QStringList *packages1, 53 OPackage::Command command1, QStringList *packages1,
55 OPackage::Command command2, QStringList *packages2, 54 OPackage::Command command2, QStringList *packages2,
56 OPackage::Command command3, QStringList *packages3 ) 55 OPackage::Command command3, QStringList *packages3 )
57 : QWidget( 0x0 ) 56 : QWidget( 0x0 )
58 , m_packman( pm ) 57 , m_packman( pm )
59 , m_numCommands( 0 ) 58 , m_numCommands( 0 )
60 , m_currCommand( 0 ) 59 , m_currCommand( 0 )
61{ 60{
62 // Save command/package list information 61 // Save command/package list information
63 if ( command1 != OPackage::NotDefined ) 62 if ( command1 != OPackage::NotDefined )
64 { 63 {
65 m_command[ m_numCommands ] = command1; 64 m_command[ m_numCommands ] = command1;
66 m_packages[ m_numCommands ] = packages1; 65 m_packages[ m_numCommands ] = packages1;
67 ++m_numCommands; 66 ++m_numCommands;
68 } 67 }
69 if ( command2 != OPackage::NotDefined ) 68 if ( command2 != OPackage::NotDefined )
70 { 69 {
71 m_command[ m_numCommands ] = command2; 70 m_command[ m_numCommands ] = command2;
72 m_packages[ m_numCommands ] = packages2; 71 m_packages[ m_numCommands ] = packages2;
73 ++m_numCommands; 72 ++m_numCommands;
74 } 73 }
75 if ( command3 != OPackage::NotDefined ) 74 if ( command3 != OPackage::NotDefined )
76 { 75 {
@@ -255,48 +254,48 @@ void InstallDlg::slotBtnStart()
255 m_btnOptions->setEnabled( true ); 254 m_btnOptions->setEnabled( true );
256 m_btnOptions->setText( tr( "Save output" ) ); 255 m_btnOptions->setText( tr( "Save output" ) );
257 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); 256 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
258} 257}
259 258
260void InstallDlg::slotBtnOptions() 259void InstallDlg::slotBtnOptions()
261{ 260{
262 QString btnText = m_btnOptions->text(); 261 QString btnText = m_btnOptions->text();
263 if ( btnText == tr( "Options" ) ) 262 if ( btnText == tr( "Options" ) )
264 { 263 {
265 // Display configuration dialog (only options tab is enabled) 264 // Display configuration dialog (only options tab is enabled)
266 m_packman->configureDlg( true ); 265 m_packman->configureDlg( true );
267 return; 266 return;
268 } 267 }
269 268
270 // Save output was clicked 269 // Save output was clicked
271 QMap<QString, QStringList> map; 270 QMap<QString, QStringList> map;
272 map.insert( tr( "All" ), QStringList() ); 271 map.insert( tr( "All" ), QStringList() );
273 QStringList text; 272 QStringList text;
274 text << "text/*"; 273 text << "text/*";
275 map.insert(tr( "Text" ), text ); 274 map.insert(tr( "Text" ), text );
276 text << "*"; 275 text << "*";
277 map.insert( tr( "All" ), text ); 276 map.insert( tr( "All" ), text );
278 277
279 QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); 278 QString filename = Opie::Ui::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
280 if( !filename.isEmpty() ) 279 if( !filename.isEmpty() )
281 { 280 {
282 QString currentFileName = QFileInfo( filename ).fileName(); 281 QString currentFileName = QFileInfo( filename ).fileName();
283 DocLnk doc; 282 DocLnk doc;
284 doc.setType( "text/plain" ); 283 doc.setType( "text/plain" );
285 doc.setFile( filename ); 284 doc.setFile( filename );
286 doc.setName( currentFileName ); 285 doc.setName( currentFileName );
287 FileManager fm; 286 FileManager fm;
288 fm.saveFile( doc, m_output->text() ); 287 fm.saveFile( doc, m_output->text() );
289 } 288 }
290} 289}
291 290
292void InstallDlg::slotOutput( char *msg ) 291void InstallDlg::slotOutput( char *msg )
293{ 292{
294 // Allow processing of other events 293 // Allow processing of other events
295 qApp->processEvents(); 294 qApp->processEvents();
296 295
297 QString lineStr = msg; 296 QString lineStr = msg;
298 if ( lineStr[lineStr.length()-1] == '\n' ) 297 if ( lineStr[lineStr.length()-1] == '\n' )
299 lineStr.truncate( lineStr.length() - 1 ); 298 lineStr.truncate( lineStr.length() - 1 );
300 m_output->append( lineStr ); 299 m_output->append( lineStr );
301 m_output->setCursorPosition( m_output->numLines(), 0 ); 300 m_output->setCursorPosition( m_output->numLines(), 0 );
302} 301}
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
@@ -10,26 +10,25 @@
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "mainwindow.h" 30#include "mainwindow.h"
31 31
32#include <opie2/oapplicationfactory.h> 32#include <opie2/oapplicationfactory.h>
33 33
34using namespace Opie::Core; 34OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> )
35OPIE_EXPORT_APP( 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
@@ -6,70 +6,70 @@
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "mainwindow.h"
31#include "installdlg.h"
32#include "filterdlg.h"
33#include "promptdlg.h"
34#include "entrydlg.h"
35#include "packageinfodlg.h"
36
37#include <qpe/qcopenvelope_qws.h>
38#include <qpe/qpeapplication.h>
39#include <qpe/resource.h>
40
30#include <qaction.h> 41#include <qaction.h>
31#include <qdir.h> 42#include <qdir.h>
32#include <qlayout.h> 43#include <qlayout.h>
33#include <qlineedit.h> 44#include <qlineedit.h>
34#include <qmenubar.h> 45#include <qmenubar.h>
35#include <qmessagebox.h> 46#include <qmessagebox.h>
36#include <qpopupmenu.h> 47#include <qpopupmenu.h>
37#include <qtimer.h> 48#include <qtimer.h>
38#include <qtoolbar.h> 49#include <qtoolbar.h>
39#include <qwhatsthis.h> 50#include <qwhatsthis.h>
40 51
41#include <qpe/qcopenvelope_qws.h>
42#include <qpe/qpeapplication.h>
43#include <qpe/resource.h>
44
45#include "mainwindow.h"
46#include "installdlg.h"
47#include "filterdlg.h"
48#include "promptdlg.h"
49#include "entrydlg.h"
50#include "packageinfodlg.h"
51
52MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) 52MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
53 : QMainWindow( parent, name, WStyle_ContextHelp ) 53 : QMainWindow( parent, name, WStyle_ContextHelp )
54 , m_config( "packman" ) 54 , m_config( "packman" )
55 , m_packman( &m_config, this ) 55 , m_packman( &m_config, this )
56 , m_menuBar( this ) 56 , m_menuBar( this )
57 , m_toolBar( this ) 57 , m_toolBar( this )
58 , m_findBar( this ) 58 , m_findBar( this )
59 , m_widgetStack( this ) 59 , m_widgetStack( this )
60 , m_packageList( this ) 60 , m_packageList( this )
61 , m_statusWidget( this ) 61 , m_statusWidget( this )
62 , m_statusText( &m_statusWidget ) 62 , m_statusText( &m_statusWidget )
63 , m_statusBar( &m_statusWidget ) 63 , m_statusBar( &m_statusWidget )
64 , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) ) 64 , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) )
65 , m_iconInstalled( Resource::loadPixmap( "installed" ) ) 65 , m_iconInstalled( Resource::loadPixmap( "installed" ) )
66 , m_iconNull( m_iconUpdated.size() ) 66 , m_iconNull( m_iconUpdated.size() )
67 , m_filterName( QString::null ) 67 , m_filterName( QString::null )
68 , m_filterServer( QString::null ) 68 , m_filterServer( QString::null )
69 , m_filterDest( QString::null ) 69 , m_filterDest( QString::null )
70 , m_filterStatus( OPackageManager::NotDefined ) 70 , m_filterStatus( OPackageManager::NotDefined )
71 , m_filterCategory( QString::null ) 71 , m_filterCategory( QString::null )
72 72
73{ 73{
74// setCaption( tr( "Package Manager" ) ); 74// setCaption( tr( "Package Manager" ) );
75 75
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
@@ -9,60 +9,60 @@
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#ifndef MAINWINDOW_H 30#ifndef MAINWINDOW_H
31#define MAINWINDOW_H 31#define MAINWINDOW_H
32 32
33#include "opackagemanager.h"
34
35#include <qpe/config.h>
36
33#include <qlabel.h> 37#include <qlabel.h>
34#include <qlistview.h> 38#include <qlistview.h>
35#include <qmainwindow.h> 39#include <qmainwindow.h>
36#include <qpixmap.h> 40#include <qpixmap.h>
37#include <qprogressbar.h> 41#include <qprogressbar.h>
38#include <qtoolbar.h> 42#include <qtoolbar.h>
39#include <qwidgetstack.h> 43#include <qwidgetstack.h>
40 44
41#include <qpe/config.h>
42
43#include "opackagemanager.h"
44
45class QAction; 45class QAction;
46class QLineEdit; 46class QLineEdit;
47 47
48class MainWindow :public QMainWindow 48class MainWindow :public QMainWindow
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52public: 52public:
53 MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); 53 MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 );
54 static QString appName() { return QString::fromLatin1( "packagemanager" ); }; 54 static QString appName() { return QString::fromLatin1( "packagemanager" ); };
55 55
56protected: 56protected:
57 void closeEvent( QCloseEvent *event ); 57 void closeEvent( QCloseEvent *event );
58 58
59private: 59private:
60 Config m_config; // Configuration file 60 Config m_config; // Configuration file
61 61
62 OPackageManager m_packman; // Package manager 62 OPackageManager m_packman; // Package manager
63 63
64 // Toolbars 64 // Toolbars
65 QToolBar m_menuBar; // Main toolbar containing menu 65 QToolBar m_menuBar; // Main toolbar containing menu
66 QToolBar m_toolBar; // Main toolbar 66 QToolBar m_toolBar; // Main toolbar
67 QToolBar m_findBar; // Find toolbar 67 QToolBar m_findBar; // Find toolbar
68 68
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
@@ -10,33 +10,32 @@
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include "oconfitem.h" 32#include "oconfitem.h"
33 33
34OConfItem::OConfItem( const QString &location, Type type, const QString &name, 34OConfItem::OConfItem( Type type, const QString &name,
35 const QString &value, bool active ) 35 const QString &value, bool active )
36 : m_location( location ) 36 : m_type( type )
37 , m_type( type )
38 , m_name( name ) 37 , m_name( name )
39 , m_value( value ) 38 , m_value( value )
40 , m_active( active ) 39 , m_active( active )
41{ 40{
42} 41}
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
@@ -19,77 +19,74 @@
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef OCONFITEM_H 32#ifndef OCONFITEM_H
33#define OCONFITEM_H 33#define OCONFITEM_H
34 34
35#include <qlist.h> 35#include <qlist.h>
36#include <qstring.h> 36#include <qstring.h>
37 37
38class OConfItem 38class OConfItem
39{ 39{
40public: 40public:
41 enum Type { Source, Destination, Option, Arch, NotDefined }; 41 enum Type { Source, Destination, Option, Arch, NotDefined };
42 42
43 OConfItem( const QString &location = 0x0, Type type = NotDefined, const QString &name = 0x0, 43 OConfItem( Type type = NotDefined, const QString &name = 0x0, const QString &value = 0x0,
44 const QString &value = 0x0, bool active = true ); 44 bool active = true );
45 45
46 const QString &location() { return m_location; }
47 Type type() { return m_type; } 46 Type type() { return m_type; }
48 const QString &name() { return m_name; } 47 const QString &name() { return m_name; }
49 const QString &value() { return m_value; } 48 const QString &value() { return m_value; }
50 bool active() { return m_active; } 49 bool active() { return m_active; }
51 50
52 void setLocation( const QString &location ) { m_location = location; } 51 void setType( Type type ) { m_type = type; }
53 void setType( Type type ) { m_type = type; } 52 void setName( const QString &name ) { m_name = name; }
54 void setName( const QString &name ) { m_name = name; } 53 void setValue( const QString &value ) { m_value = value; }
55 void setValue( const QString &value ) { m_value = value; } 54 void setActive( bool active ) { m_active = active; }
56 void setActive( bool active ) { m_active = active; }
57 55
58private: 56private:
59 QString m_location; // Configuration file where item is located
60 Type m_type; // Type of configuration item 57 Type m_type; // Type of configuration item
61 QString m_name; // Name of item 58 QString m_name; // Name of item
62 QString m_value; // Value of item 59 QString m_value; // Value of item
63 bool m_active; // Indicates whether item is currently active 60 bool m_active; // Indicates whether item is currently active
64}; 61};
65 62
66class OConfItemList : public QList<OConfItem> 63class OConfItemList : public QList<OConfItem>
67{ 64{
68private: 65private:
69 66
70 int compareItems( QCollection::Item item1, QCollection::Item item2 ) 67 int compareItems( QCollection::Item item1, QCollection::Item item2 )
71 { 68 {
72 // Sort by OConfItem location then by type 69 // Sort by OConfItem location then by type
73 QString loc1 = reinterpret_cast<OConfItem*>(item1)->location(); 70 OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type();
74 QString loc2 = reinterpret_cast<OConfItem*>(item2)->location(); 71 OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type();
75 if ( loc1 < loc2 ) 72 if ( type1 < type2 )
76 return -1; 73 return -1;
77 else if ( loc1 == loc2 ) 74 else if ( type1 == type2 )
78 { 75 {
79 OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); 76 QString name1 = reinterpret_cast<OConfItem*>(item1)->name();
80 OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); 77 QString name2 = reinterpret_cast<OConfItem*>(item2)->name();
81 if ( type1 < type2 ) 78 if ( name1 < name2 )
82 return -1; 79 return -1;
83 else if ( type1 == type2 ) 80 else if ( name1 == name2 )
84 return 0; 81 return 0;
85 else /*if ( type1 > type2 )*/ 82 else /*if ( name1 > name2 )*/
86 return 1; 83 return 1;
87 } 84 }
88 else /*if ( loc1 > loc2 )*/ 85 else /*if ( type1 > type2 )*/
89 return 1; 86 return 1;
90 } 87 }
91}; 88};
92 89
93typedef QListIterator<OConfItem> OConfItemListIterator; 90typedef QListIterator<OConfItem> OConfItemListIterator;
94 91
95#endif 92#endif
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
@@ -10,55 +10,54 @@
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include "oipkg.h" 32#include "oipkg.h"
33 33
34#include <stdlib.h>
35#include <string.h>
36
37#include <qdir.h> 34#include <qdir.h>
38#include <qfile.h> 35#include <qfile.h>
39#include <qtextstream.h> 36#include <qtextstream.h>
40 37
38#include <stdlib.h>
39
41const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file 40const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file
42const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files 41const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files
43const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists 42const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists
44const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location 43const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location
45 44
46OIpkg *oipkg; 45OIpkg *oipkg;
47 46
48// Ipkg callback functions 47// Ipkg callback functions
49 48
50int fsignalIpkgMessage( ipkg_conf_t */*conf*/, message_level_t /*level*/, char *msg ) 49int fsignalIpkgMessage( ipkg_conf_t */*conf*/, message_level_t /*level*/, char *msg )
51{ 50{
52 oipkg->ipkgMessage( msg ); 51 oipkg->ipkgMessage( msg );
53 return 0; 52 return 0;
54} 53}
55 54
56char *fIpkgResponse( char */*question*/ ) 55char *fIpkgResponse( char */*question*/ )
57{ 56{
58 return 0x0; 57 return 0x0;
59} 58}
60 59
61int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ ) 60int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ )
62{ 61{
63 oipkg->ipkgStatus( desc ); 62 oipkg->ipkgStatus( desc );
64 return 0; 63 return 0;
@@ -508,49 +507,49 @@ void OIpkg::loadConfiguration()
508 type = OConfItem::Source; 507 type = OConfItem::Source;
509 else if ( typeStr == "dest" || typeStr == "#dest" ) 508 else if ( typeStr == "dest" || typeStr == "#dest" )
510 type = OConfItem::Destination; 509 type = OConfItem::Destination;
511 else if ( typeStr == "option" || typeStr == "#option" ) 510 else if ( typeStr == "option" || typeStr == "#option" )
512 type = OConfItem::Option; 511 type = OConfItem::Option;
513 else if ( typeStr == "arch" || typeStr == "#arch" ) 512 else if ( typeStr == "arch" || typeStr == "#arch" )
514 type = OConfItem::Arch; 513 type = OConfItem::Arch;
515 else 514 else
516 type = OConfItem::NotDefined; 515 type = OConfItem::NotDefined;
517 ++pos; 516 ++pos;
518 int endpos = line.find( ' ', pos ); 517 int endpos = line.find( ' ', pos );
519 518
520 // Name 519 // Name
521 QString name = line.mid( pos, endpos - pos ); 520 QString name = line.mid( pos, endpos - pos );
522 521
523 // Value 522 // Value
524 QString value = ""; 523 QString value = "";
525 if ( endpos > -1 ) 524 if ( endpos > -1 )
526 value = line.right( line.length() - endpos - 1 ); 525 value = line.right( line.length() - endpos - 1 );
527 526
528 // Active 527 // Active
529 bool active = !line.startsWith( "#" ); 528 bool active = !line.startsWith( "#" );
530 529
531 // Add to list 530 // Add to list
532 m_confInfo->append( new OConfItem( absFile, type, name, value, active ) ); 531 m_confInfo->append( new OConfItem( type, name, value, active ) );
533 } 532 }
534 } 533 }
535 } 534 }
536 535
537 f.close(); 536 f.close();
538 } 537 }
539 } 538 }
540 } 539 }
541 540
542 // Load Ipkg execution options from application configuration file 541 // Load Ipkg execution options from application configuration file
543 if ( m_config ) 542 if ( m_config )
544 { 543 {
545 m_config->setGroup( "Ipkg" ); 544 m_config->setGroup( "Ipkg" );
546 m_ipkgExecOptions = m_config->readNumEntry( "ExecOptions", m_ipkgExecOptions ); 545 m_ipkgExecOptions = m_config->readNumEntry( "ExecOptions", m_ipkgExecOptions );
547 m_ipkgExecVerbosity = m_config->readNumEntry( "Verbosity", m_ipkgExecVerbosity ); 546 m_ipkgExecVerbosity = m_config->readNumEntry( "Verbosity", m_ipkgExecVerbosity );
548 } 547 }
549} 548}
550 549
551OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter ) 550OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter )
552{ 551{
553 // Load Ipkg configuration info if not already cached 552 // Load Ipkg configuration info if not already cached
554 if ( !m_confInfo ) 553 if ( !m_confInfo )
555 loadConfiguration(); 554 loadConfiguration();
556 555
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
@@ -11,58 +11,58 @@
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef OIPKG_H 32#ifndef OIPKG_H
33#define OIPKG_H 33#define OIPKG_H
34 34
35extern "C" { 35#include "oconfitem.h"
36#include <libipkg.h> 36#include "opackage.h"
37};
38
39#include <qobject.h>
40 37
41#include <qpe/config.h> 38#include <qpe/config.h>
42 39
43#include "oconfitem.h" 40#include <qobject.h>
44#include "opackage.h" 41
42extern "C" {
43#include <libipkg.h>
44};
45 45
46// Ipkg execution options (m_ipkgExecOptions) 46// Ipkg execution options (m_ipkgExecOptions)
47#define FORCE_DEPENDS 0x0001 47#define FORCE_DEPENDS 0x0001
48#define FORCE_REMOVE 0x0002 48#define FORCE_REMOVE 0x0002
49#define FORCE_REINSTALL 0x0004 49#define FORCE_REINSTALL 0x0004
50#define FORCE_OVERWRITE 0x0008 50#define FORCE_OVERWRITE 0x0008
51 51
52class OConfItemList; 52class OConfItemList;
53 53
54class OIpkg : public QObject 54class OIpkg : public QObject
55{ 55{
56 Q_OBJECT 56 Q_OBJECT
57 57
58public: 58public:
59 OIpkg( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); 59 OIpkg( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 );
60 ~OIpkg(); 60 ~OIpkg();
61 61
62 OConfItemList *configItems(); 62 OConfItemList *configItems();
63 OConfItemList *servers(); 63 OConfItemList *servers();
64 OConfItemList *destinations(); 64 OConfItemList *destinations();
65 OConfItemList *options(); 65 OConfItemList *options();
66 66
67 int ipkgExecOptions() { return m_ipkgExecOptions; } 67 int ipkgExecOptions() { return m_ipkgExecOptions; }
68 int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } 68 int ipkgExecVerbosity() { return m_ipkgExecVerbosity; }
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
@@ -10,61 +10,60 @@
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include "oipkgconfigdlg.h" 32#include "oipkgconfigdlg.h"
33 33
34#include <qpe/resource.h>
35
34#include <qcheckbox.h> 36#include <qcheckbox.h>
35#include <qcombobox.h> 37#include <qcombobox.h>
36#include <qgroupbox.h> 38#include <qgroupbox.h>
37#include <qlabel.h> 39#include <qlabel.h>
38#include <qlineedit.h> 40#include <qlineedit.h>
39#include <qlistbox.h> 41#include <qlistbox.h>
40#include <qpushbutton.h> 42#include <qpushbutton.h>
41#include <qscrollview.h> 43#include <qscrollview.h>
42#include <qwhatsthis.h> 44#include <qwhatsthis.h>
43 45
44#include <qpe/resource.h>
45
46using namespace Opie::Ui;
47OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) 46OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent )
48 : QDialog( parent, QString::null, true, WStyle_ContextHelp ) 47 : QDialog( parent, QString::null, true, WStyle_ContextHelp )
49 , m_ipkg( ipkg ) 48 , m_ipkg( ipkg )
50 , m_configs( 0x0 ) 49 , m_configs( 0x0 )
51 , m_installOptions( installOptions ) 50 , m_installOptions( installOptions )
52 , m_serverNew( false ) 51 , m_serverNew( false )
53 , m_serverCurrent( -1 ) 52 , m_serverCurrent( -1 )
54 , m_destNew( false ) 53 , m_destNew( false )
55 , m_destCurrent( -1 ) 54 , m_destCurrent( -1 )
56 , m_layout( this, 2, 4 ) 55 , m_layout( this, 2, 4 )
57 , m_tabWidget( this ) 56 , m_tabWidget( this )
58{ 57{
59 setCaption( tr( "Configuration" ) ); 58 setCaption( tr( "Configuration" ) );
60 59
61 // Initialize configuration widgets 60 // Initialize configuration widgets
62 if ( !installOptions ) 61 if ( !installOptions )
63 { 62 {
64 initServerWidget(); 63 initServerWidget();
65 initDestinationWidget(); 64 initDestinationWidget();
66 initProxyWidget(); 65 initProxyWidget();
67 } 66 }
68 initOptionsWidget(); 67 initOptionsWidget();
69 68
70 // Load configuration information 69 // Load configuration information
@@ -80,73 +79,73 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren
80 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); 79 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) );
81 m_tabWidget.setCurrentTab( tr( "Servers" ) ); 80 m_tabWidget.setCurrentTab( tr( "Servers" ) );
82 } 81 }
83 else 82 else
84 { 83 {
85 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); 84 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) );
86 } 85 }
87 86
88 //showMaximized(); 87 //showMaximized();
89} 88}
90 89
91void OIpkgConfigDlg::accept() 90void OIpkgConfigDlg::accept()
92{ 91{
93 // Save server, destination and proxy configuration 92 // Save server, destination and proxy configuration
94 if ( !m_installOptions ) 93 if ( !m_installOptions )
95 { 94 {
96 // Update proxy information before saving settings 95 // Update proxy information before saving settings
97 OConfItem *confItem = findConfItem( OConfItem::Option, "http_proxy" ); 96 OConfItem *confItem = findConfItem( OConfItem::Option, "http_proxy" );
98 if ( confItem ) 97 if ( confItem )
99 { 98 {
100 confItem->setValue( m_proxyHttpServer->text() ); 99 confItem->setValue( m_proxyHttpServer->text() );
101 confItem->setActive( m_proxyHttpActive->isChecked() ); 100 confItem->setActive( m_proxyHttpActive->isChecked() );
102 } 101 }
103 else 102 else
104 m_configs->append( new OConfItem( QString::null, OConfItem::Option, "http_proxy", 103 m_configs->append( new OConfItem( OConfItem::Option, "http_proxy",
105 m_proxyHttpServer->text(), m_proxyHttpActive->isChecked() ) ); 104 m_proxyHttpServer->text(), m_proxyHttpActive->isChecked() ) );
106 105
107 confItem = findConfItem( OConfItem::Option, "ftp_proxy" ); 106 confItem = findConfItem( OConfItem::Option, "ftp_proxy" );
108 if ( confItem ) 107 if ( confItem )
109 { 108 {
110 confItem->setValue( m_proxyFtpServer->text() ); 109 confItem->setValue( m_proxyFtpServer->text() );
111 confItem->setActive( m_proxyFtpActive->isChecked() ); 110 confItem->setActive( m_proxyFtpActive->isChecked() );
112 } 111 }
113 else 112 else
114 m_configs->append( new OConfItem( QString::null, OConfItem::Option, "ftp_proxy", 113 m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy",
115 m_proxyFtpServer->text(), m_proxyFtpActive->isChecked() ) ); 114 m_proxyFtpServer->text(), m_proxyFtpActive->isChecked() ) );
116 115
117 confItem = findConfItem( OConfItem::Option, "proxy_username" ); 116 confItem = findConfItem( OConfItem::Option, "proxy_username" );
118 if ( confItem ) 117 if ( confItem )
119 confItem->setValue( m_proxyUsername->text() ); 118 confItem->setValue( m_proxyUsername->text() );
120 else 119 else
121 m_configs->append( new OConfItem( QString::null, OConfItem::Option, "proxy_username", 120 m_configs->append( new OConfItem( OConfItem::Option, "proxy_username",
122 m_proxyUsername->text() ) ); 121 m_proxyUsername->text() ) );
123 122
124 confItem = findConfItem( OConfItem::Option, "proxy_password" ); 123 confItem = findConfItem( OConfItem::Option, "proxy_password" );
125 if ( confItem ) 124 if ( confItem )
126 confItem->setValue( m_proxyPassword->text() ); 125 confItem->setValue( m_proxyPassword->text() );
127 else 126 else
128 m_configs->append( new OConfItem( QString::null, OConfItem::Option, "proxy_password", 127 m_configs->append( new OConfItem( OConfItem::Option, "proxy_password",
129 m_proxyPassword->text() ) ); 128 m_proxyPassword->text() ) );
130 129
131 m_ipkg->setConfigItems( m_configs ); 130 m_ipkg->setConfigItems( m_configs );
132 } 131 }
133 132
134 // Save options configuration 133 // Save options configuration
135 int options = 0; 134 int options = 0;
136 if ( m_optForceDepends->isChecked() ) 135 if ( m_optForceDepends->isChecked() )
137 options |= FORCE_DEPENDS; 136 options |= FORCE_DEPENDS;
138 if ( m_optForceReinstall->isChecked() ) 137 if ( m_optForceReinstall->isChecked() )
139 options |= FORCE_REINSTALL; 138 options |= FORCE_REINSTALL;
140 if ( m_optForceRemove->isChecked() ) 139 if ( m_optForceRemove->isChecked() )
141 options |= FORCE_REMOVE; 140 options |= FORCE_REMOVE;
142 if ( m_optForceOverwrite->isChecked() ) 141 if ( m_optForceOverwrite->isChecked() )
143 options |= FORCE_OVERWRITE; 142 options |= FORCE_OVERWRITE;
144 m_ipkg->setIpkgExecOptions( options ); 143 m_ipkg->setIpkgExecOptions( options );
145 m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); 144 m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() );
146 145
147 QDialog::accept(); 146 QDialog::accept();
148} 147}
149 148
150void OIpkgConfigDlg::reject() 149void OIpkgConfigDlg::reject()
151{ 150{
152 if ( m_configs ) 151 if ( m_configs )
@@ -511,49 +510,49 @@ void OIpkgConfigDlg::slotServerUpdate()
511 // Find selected server in list 510 // Find selected server in list
512 OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName ); 511 OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName );
513 512
514 // Delete server 513 // Delete server
515 if ( server ) 514 if ( server )
516 { 515 {
517 // Update url 516 // Update url
518 server->setValue( m_serverLocation->text() ); 517 server->setValue( m_serverLocation->text() );
519 server->setActive( m_serverActive->isChecked() ); 518 server->setActive( m_serverActive->isChecked() );
520 519
521 // Check if server name has changed, if it has then we need to replace the key in the map 520 // Check if server name has changed, if it has then we need to replace the key in the map
522 if ( m_serverCurrName != newName ) 521 if ( m_serverCurrName != newName )
523 { 522 {
524 // Update server name 523 // Update server name
525 server->setName( newName ); 524 server->setName( newName );
526 525
527 // Update list box 526 // Update list box
528 m_serverList->changeItem( newName, m_serverCurrent ); 527 m_serverList->changeItem( newName, m_serverCurrent );
529 } 528 }
530 } 529 }
531 } 530 }
532 else 531 else
533 { 532 {
534 // Add new destination to configuration list 533 // Add new destination to configuration list
535 m_configs->append( new OConfItem( QString::null, OConfItem::Source, newName, 534 m_configs->append( new OConfItem( OConfItem::Source, newName,
536 m_serverLocation->text(), m_serverActive->isChecked() ) ); 535 m_serverLocation->text(), m_serverActive->isChecked() ) );
537 m_configs->sort(); 536 m_configs->sort();
538 537
539 m_serverList->insertItem( newName ); 538 m_serverList->insertItem( newName );
540 m_serverList->setCurrentItem( m_serverList->count() ); 539 m_serverList->setCurrentItem( m_serverList->count() );
541 m_serverNew = false; 540 m_serverNew = false;
542 m_serverList->insertItem( newName ); 541 m_serverList->insertItem( newName );
543 } 542 }
544} 543}
545 544
546void OIpkgConfigDlg::slotDestEdit( int index ) 545void OIpkgConfigDlg::slotDestEdit( int index )
547{ 546{
548 m_destNew = false; 547 m_destNew = false;
549 m_destCurrent = index; 548 m_destCurrent = index;
550 549
551 // Find selected destination in list 550 // Find selected destination in list
552 OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); 551 OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() );
553 552
554 // Display destination details 553 // Display destination details
555 if ( destination ) 554 if ( destination )
556 { 555 {
557 m_destCurrName = destination->name(); 556 m_destCurrName = destination->name();
558 m_destName->setText( destination->name() ); 557 m_destName->setText( destination->name() );
559 m_destLocation->setText( destination->value() ); 558 m_destLocation->setText( destination->value() );
@@ -597,33 +596,33 @@ void OIpkgConfigDlg::slotDestUpdate()
597 // Find selected destination in list 596 // Find selected destination in list
598 OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName ); 597 OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName );
599 598
600 // Display destination details 599 // Display destination details
601 if ( destination ) 600 if ( destination )
602 { 601 {
603 // Update url 602 // Update url
604 destination->setValue( m_destLocation->text() ); 603 destination->setValue( m_destLocation->text() );
605 destination->setActive( m_destActive->isChecked() ); 604 destination->setActive( m_destActive->isChecked() );
606 605
607 // Check if destination name has changed, if it has then we need to replace the key in the map 606 // Check if destination name has changed, if it has then we need to replace the key in the map
608 if ( m_destCurrName != newName ) 607 if ( m_destCurrName != newName )
609 { 608 {
610 // Update destination name 609 // Update destination name
611 destination->setName( newName ); 610 destination->setName( newName );
612 611
613 // Update list box 612 // Update list box
614 m_destList->changeItem( newName, m_destCurrent ); 613 m_destList->changeItem( newName, m_destCurrent );
615 } 614 }
616 } 615 }
617 } 616 }
618 else 617 else
619 { 618 {
620 // Add new destination to configuration list 619 // Add new destination to configuration list
621 m_configs->append( new OConfItem( QString::null, OConfItem::Destination, newName, 620 m_configs->append( new OConfItem( OConfItem::Destination, newName,
622 m_destLocation->text(), m_destActive->isChecked() ) ); 621 m_destLocation->text(), m_destActive->isChecked() ) );
623 m_configs->sort(); 622 m_configs->sort();
624 623
625 m_destList->insertItem( newName ); 624 m_destList->insertItem( newName );
626 m_destList->setCurrentItem( m_destList->count() ); 625 m_destList->setCurrentItem( m_destList->count() );
627 m_destNew = false; 626 m_destNew = false;
628 } 627 }
629} 628}
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
@@ -12,94 +12,94 @@
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32 32
33#ifndef OIPKGCONFIGDLG_H 33#ifndef OIPKGCONFIGDLG_H
34#define OIPKGCONFIGDLG_H 34#define OIPKGCONFIGDLG_H
35 35
36#include <opie2/otabwidget.h>
37
36#include <qdialog.h> 38#include <qdialog.h>
37#include <qlayout.h> 39#include <qlayout.h>
38 40
39#include <opie2/otabwidget.h>
40
41#include "oipkg.h" 41#include "oipkg.h"
42 42
43class QCheckBox; 43class QCheckBox;
44class QComboBox; 44class QComboBox;
45class QLineEdit; 45class QLineEdit;
46class QListBox; 46class QListBox;
47 47
48class OIpkgConfigDlg : public QDialog 48class OIpkgConfigDlg : public QDialog
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52public: 52public:
53 OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 ); 53 OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 );
54 54
55protected slots: 55protected slots:
56 void accept(); 56 void accept();
57 void reject(); 57 void reject();
58 58
59private: 59private:
60 OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options 60 OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options
61 OConfItemList *m_configs; // Local list of configuration items 61 OConfItemList *m_configs; // Local list of configuration items
62 62
63 bool m_installOptions; // If true, will only display the Options tab 63 bool m_installOptions; // If true, will only display the Options tab
64 64
65 // Server cached information 65 // Server cached information
66 bool m_serverNew; // Indicates if server information is for a new server 66 bool m_serverNew; // Indicates if server information is for a new server
67 int m_serverCurrent; // Index of currently selected server in m_serverList 67 int m_serverCurrent; // Index of currently selected server in m_serverList
68 QString m_serverCurrName; // Name of currently selected server in m_serverList 68 QString m_serverCurrName; // Name of currently selected server in m_serverList
69 69
70 // Destination cached information 70 // Destination cached information
71 bool m_destNew; // Indicates if destination information is for a new destination 71 bool m_destNew; // Indicates if destination information is for a new destination
72 int m_destCurrent; // Index of currently selected destination in m_destList 72 int m_destCurrent; // Index of currently selected destination in m_destList
73 QString m_destCurrName; // Name of currently selected destination in m_destList 73 QString m_destCurrName; // Name of currently selected destination in m_destList
74 74
75 // UI controls 75 // UI controls
76 QVBoxLayout m_layout; // Main dialog layout control 76 QVBoxLayout m_layout; // Main dialog layout control
77 Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control 77 Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control
78 QWidget *m_serverWidget; // Widget containing server configuration controls 78 QWidget *m_serverWidget; // Widget containing server configuration controls
79 QWidget *m_destWidget; // Widget containing destination configuration controls 79 QWidget *m_destWidget; // Widget containing destination configuration controls
80 QWidget *m_proxyWidget; // Widget containing proxy configuration controls 80 QWidget *m_proxyWidget; // Widget containing proxy configuration controls
81 QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls 81 QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls
82 82
83 // Server configuration UI controls 83 // Server configuration UI controls
84 QListBox *m_serverList; // Server list selection 84 QListBox *m_serverList; // Server list selection
85 QLineEdit *m_serverName; // Server name edit box 85 QLineEdit *m_serverName; // Server name edit box
86 QLineEdit *m_serverLocation; // Server location URL edit box 86 QLineEdit *m_serverLocation; // Server location URL edit box
87 QCheckBox *m_serverActive; // Activate server check box 87 QCheckBox *m_serverActive; // Activate server check box
88 88
89 // Destination configuration UI controls 89 // Destination configuration UI controls
90 QListBox *m_destList; // Destination list selection 90 QListBox *m_destList; // Destination list selection
91 QLineEdit *m_destName; // Destination name edit box 91 QLineEdit *m_destName; // Destination name edit box
92 QLineEdit *m_destLocation; // Destination location URL edit box 92 QLineEdit *m_destLocation; // Destination location URL edit box
93 QCheckBox *m_destActive; // Activate destination check box 93 QCheckBox *m_destActive; // Activate destination check box
94 94
95 // Proxy server configuration UI controls 95 // Proxy server configuration UI controls
96 QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box 96 QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box
97 QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box 97 QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box
98 QLineEdit *m_proxyFtpServer; // FTP proxy server edit box 98 QLineEdit *m_proxyFtpServer; // FTP proxy server edit box
99 QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box 99 QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box
100 QLineEdit *m_proxyUsername; // Proxy server username edit box 100 QLineEdit *m_proxyUsername; // Proxy server username edit box
101 QLineEdit *m_proxyPassword; // Proxy server password edit box 101 QLineEdit *m_proxyPassword; // Proxy server password edit box
102 102
103 // Options configuration UI controls 103 // Options configuration UI controls
104 QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox 104 QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox
105 QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox 105 QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox
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
@@ -8,54 +8,54 @@
8 _;:,     .>    :=|. This program is free software; you can 8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include <ctype.h> 32#include "opackagemanager.h"
33#include "oipkgconfigdlg.h"
33 34
34#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
35 36
36#include "opackagemanager.h" 37#include <ctype.h>
37#include "oipkgconfigdlg.h"
38 38
39OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) 39OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name )
40 : QObject( parent, name ) 40 : QObject( parent, name )
41 , m_config( config ) 41 , m_config( config )
42 , m_ipkg( m_config, this ) 42 , m_ipkg( m_config, this )
43 , m_packages( 9973 ) 43 , m_packages( 9973 )
44 , m_categories() 44 , m_categories()
45{ 45{
46 m_packages.setAutoDelete( true ); 46 m_packages.setAutoDelete( true );
47} 47}
48 48
49void OPackageManager::loadAvailablePackages() 49void OPackageManager::loadAvailablePackages()
50{ 50{
51 m_packages.clear(); 51 m_packages.clear();
52 52
53 OConfItemList *serverList = m_ipkg.servers(); 53 OConfItemList *serverList = m_ipkg.servers();
54 54
55 if ( serverList ) 55 if ( serverList )
56 { 56 {
57 // Initialize status messaging 57 // Initialize status messaging
58 emit initStatus( serverList->count() ); 58 emit initStatus( serverList->count() );
59 int serverCount = 0; 59 int serverCount = 0;
60 60
61 bool categoryAdded = false; 61 bool categoryAdded = false;
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
@@ -11,55 +11,55 @@
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef OPACKAGEMANAGER_H 32#ifndef OPACKAGEMANAGER_H
33#define OPACKAGEMANAGER_H 33#define OPACKAGEMANAGER_H
34 34
35#include <qdict.h> 35#include "oipkg.h"
36#include <qobject.h>
37#include <qstringlist.h>
38 36
39#include <qpe/config.h> 37#include <qpe/config.h>
40 38
41#include "oipkg.h" 39#include <qdict.h>
40#include <qobject.h>
41#include <qstringlist.h>
42 42
43class OPackageManager : public QObject 43class OPackageManager : public QObject
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 46
47public: 47public:
48 OPackageManager( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); 48 OPackageManager( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 );
49 49
50 void loadAvailablePackages(); 50 void loadAvailablePackages();
51 void loadInstalledPackages(); 51 void loadInstalledPackages();
52 52
53 enum Status { All, NotInstalled, Installed, Updated, NotDefined }; 53 enum Status { All, NotInstalled, Installed, Updated, NotDefined };
54 54
55 OPackageList *packages(); 55 OPackageList *packages();
56 OPackageList *filterPackages( const QString &name = 0x0,const QString &server = 0x0, 56 OPackageList *filterPackages( const QString &name = 0x0,const QString &server = 0x0,
57 const QString &destination = 0x0, Status status = NotDefined, 57 const QString &destination = 0x0, Status status = NotDefined,
58 const QString &category = 0x0 ); 58 const QString &category = 0x0 );
59 59
60 const QStringList &categories() { return m_categories; } 60 const QStringList &categories() { return m_categories; }
61 QStringList *servers(); 61 QStringList *servers();
62 QStringList *destinations(); 62 QStringList *destinations();
63 63
64 int compareVersions( const QString &version1, const QString &version2 ); 64 int compareVersions( const QString &version1, const QString &version2 );
65 65
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
@@ -1,10 +1,10 @@
1Package: opie-packagemanager 1Package: opie-packagemanager
2Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop 2Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop
3Priority: optional 3Priority: optional
4Section: opie/settings 4Section: opie/settings
5Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg 5Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg
6Replaces: packagemanager 6Replaces: packagemanager
7Architecture: arm 7Architecture: arm
8Maintainer: Dan Williams (drw@handhelds.org) 8Maintainer: Dan Williams (drw@handhelds.org)
9Description: Opie package management client 9Description: Opie package management client
10Version: 0.3.0$EXTRAVERSION 10Version: 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
@@ -10,105 +10,108 @@
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "packageinfodlg.h" 30#include "packageinfodlg.h"
31#include "opackage.h" 31#include "opackage.h"
32#include "opackagemanager.h" 32#include "opackagemanager.h"
33 33
34#include <qlayout.h> 34#include <opie2/otabwidget.h>
35#include <qpushbutton.h>
36 35
37#include <qpe/resource.h> 36#include <qpe/resource.h>
38 37
39#include <opie2/otabwidget.h> 38#include <qlayout.h>
39#include <qpushbutton.h>
40#include <qwhatsthis.h>
40 41
41using namespace Opie::Ui;
42PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) 42PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
43 : QWidget( 0x0 ) 43 : QWidget( 0x0 )
44 , m_packman( pm ) 44 , m_packman( pm )
45 , m_information( this ) 45 , m_information( this )
46 , m_files( this ) 46 , m_files( this )
47{ 47{
48 // Initialize UI 48 // Initialize UI
49 if ( parent ) 49 if ( parent )
50 parent->setCaption( package ); 50 parent->setCaption( package );
51 51
52 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); 52 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
53 53
54 OTabWidget *tabWidget = new OTabWidget( this ); 54 Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this );
55 layout->addWidget( tabWidget ); 55 layout->addWidget( tabWidget );
56 56
57 // Information tab 57 // Information tab
58 QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) );
58 m_information.reparent( tabWidget, QPoint( 0, 0 ) ); 59 m_information.reparent( tabWidget, QPoint( 0, 0 ) );
59 m_information.setReadOnly( true ); 60 m_information.setReadOnly( true );
60 tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); 61 tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) );
61 62
62 // Retrive package information 63 // Retrive package information
63 m_package = m_packman->findPackage( package ); 64 m_package = m_packman->findPackage( package );
64 if ( !m_package ) 65 if ( !m_package )
65 { 66 {
66 m_information.setText( tr( "Unable to retrieve package information." ) ); 67 m_information.setText( tr( "Unable to retrieve package information." ) );
67 return; 68 return;
68 } 69 }
69 70
70 // Display package information 71 // Display package information
71 if ( !m_package->information().isNull() ) 72 if ( !m_package->information().isNull() )
72 m_information.setText( m_package->information() ); 73 m_information.setText( m_package->information() );
73 else 74 else
74 { 75 {
75 // Package information is not cached, retrieve it 76 // Package information is not cached, retrieve it
76 QStringList list( package ); 77 QStringList list( package );
77 m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true ); 78 m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true );
78 } 79 }
79 80
80 // Files tab (display only if package is installed) 81 // Files tab (display only if package is installed)
81 if ( !m_package->versionInstalled().isNull() ) 82 if ( !m_package->versionInstalled().isNull() )
82 { 83 {
83 QWidget *filesWidget = new QWidget( tabWidget ); 84 QWidget *filesWidget = new QWidget( tabWidget );
84 QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); 85 QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 );
86 QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) );
85 m_files.reparent( filesWidget, QPoint( 0, 0 ) ); 87 m_files.reparent( filesWidget, QPoint( 0, 0 ) );
86 m_files.setReadOnly( true ); 88 m_files.setReadOnly( true );
87 filesLayout->addWidget( &m_files ); 89 filesLayout->addWidget( &m_files );
88 90
89 QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), 91 QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ),
90 tr( "Retrieve file list" ), filesWidget ); 92 tr( "Retrieve file list" ), filesWidget );
93 QWhatsThis::add( btn, tr( "Tap here to retrieve list of files contained in this package." ) );
91 filesLayout->addWidget( btn ); 94 filesLayout->addWidget( btn );
92 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); 95 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) );
93 tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); 96 tabWidget->addTab( filesWidget, "binary", tr( "File list" ) );
94 97
95 tabWidget->setCurrentTab( tr( "Information" ) ); 98 tabWidget->setCurrentTab( tr( "Information" ) );
96 99
97 // If file list is already cached, display 100 // If file list is already cached, display
98 if ( !m_package->files().isNull() ) 101 if ( !m_package->files().isNull() )
99 m_files.setText( m_package->files() ); 102 m_files.setText( m_package->files() );
100 } 103 }
101 else 104 else
102 m_files.hide(); 105 m_files.hide();
103} 106}
104 107
105PackageInfoDlg::~PackageInfoDlg() 108PackageInfoDlg::~PackageInfoDlg()
106{ 109{
107 if ( !m_package ) 110 if ( !m_package )
108 return; 111 return;
109 112
110 // Cache package information 113 // Cache package information
111 if ( !m_information.text().isNull() ) 114 if ( !m_information.text().isNull() )
112 m_package->setInformation( m_information.text() ); 115 m_package->setInformation( m_information.text() );
113 116
114 // Cache package file list 117 // Cache package file list
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
@@ -9,53 +9,53 @@
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#ifndef PACKAGEINFODLG_H 30#ifndef PACKAGEINFODLG_H
31#define PACKAGEINFODLG_H 31#define PACKAGEINFODLG_H
32 32
33#include "opackage.h"
34
33#include <qmultilineedit.h> 35#include <qmultilineedit.h>
34#include <qwidget.h> 36#include <qwidget.h>
35 37
36#include "opackage.h"
37
38class QPushButton; 38class QPushButton;
39 39
40class OPackage; 40class OPackage;
41class OPackageManager; 41class OPackageManager;
42 42
43class PackageInfoDlg : public QWidget 43class PackageInfoDlg : public QWidget
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 46
47public: 47public:
48 PackageInfoDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &package = QString::null ); 48 PackageInfoDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &package = QString::null );
49 ~PackageInfoDlg(); 49 ~PackageInfoDlg();
50 50
51private: 51private:
52 OPackageManager *m_packman; // Pointer to application instance of package manager 52 OPackageManager *m_packman; // Pointer to application instance of package manager
53 OPackage *m_package; // Pointer to package to display information for 53 OPackage *m_package; // Pointer to package to display information for
54 54
55 // UI controls 55 // UI controls
56 QMultiLineEdit m_information; // Multi-line edit to display package information 56 QMultiLineEdit m_information; // Multi-line edit to display package information
57 QMultiLineEdit m_files; // Multi-line edit to display package file list 57 QMultiLineEdit m_files; // Multi-line edit to display package file list
58 58
59private slots: 59private slots:
60 void slotBtnFileScan(); 60 void slotBtnFileScan();
61 void slotInfo( char *info ); 61 void slotInfo( char *info );
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
@@ -8,55 +8,55 @@
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "promptdlg.h" 30#include "promptdlg.h"
31 31
32#include <qpe/qpeapplication.h>
33
32#include <qlabel.h> 34#include <qlabel.h>
33#include <qlayout.h> 35#include <qlayout.h>
34#include <qpushbutton.h> 36#include <qpushbutton.h>
35#include <qwidgetlist.h> 37#include <qwidgetlist.h>
36 38
37#include <qpe/qpeapplication.h>
38
39PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, 39PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2,
40 QWidget *parent ) 40 QWidget *parent )
41 : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog ) 41 : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog )
42 , m_btnClicked( -1 ) 42 , m_btnClicked( -1 )
43{ 43{
44 setCaption( caption ); 44 setCaption( caption );
45 45
46 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); 46 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 );
47 QLabel *label = new QLabel( text, this ); 47 QLabel *label = new QLabel( text, this );
48 label->setAlignment( AlignCenter | WordBreak ); 48 label->setAlignment( AlignCenter | WordBreak );
49 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 49 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
50 50
51 QPushButton *btn = new QPushButton( btn1, this ); 51 QPushButton *btn = new QPushButton( btn1, this );
52 layout->addWidget( btn, 1, 0 ); 52 layout->addWidget( btn, 1, 0 );
53 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); 53 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) );
54 54
55 btn = new QPushButton( btn2, this ); 55 btn = new QPushButton( btn2, this );
56 layout->addWidget( btn, 1, 1 ); 56 layout->addWidget( btn, 1, 1 );
57 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); 57 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) );
58} 58}
59 59
60int PromptDlg::display() 60int PromptDlg::display()
61{ 61{
62 // Determine position of dialog. Derived from QT's QDialog::show() method. 62 // Determine position of dialog. Derived from QT's QDialog::show() method.