summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/entrydlg.cpp51
-rw-r--r--noncore/settings/packagemanager/entrydlg.h51
-rw-r--r--noncore/settings/packagemanager/filterdlg.cpp51
-rw-r--r--noncore/settings/packagemanager/filterdlg.h49
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp51
-rw-r--r--noncore/settings/packagemanager/installdlg.h49
-rw-r--r--noncore/settings/packagemanager/main.cpp49
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp51
-rw-r--r--noncore/settings/packagemanager/mainwindow.h51
-rw-r--r--noncore/settings/packagemanager/oconfitem.cpp43
-rw-r--r--noncore/settings/packagemanager/oconfitem.h43
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp43
-rw-r--r--noncore/settings/packagemanager/oipkg.h43
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp43
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.h44
-rw-r--r--noncore/settings/packagemanager/opackage.cpp43
-rw-r--r--noncore/settings/packagemanager/opackage.h43
-rw-r--r--noncore/settings/packagemanager/opackagemanager.cpp43
-rw-r--r--noncore/settings/packagemanager/opackagemanager.h43
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp51
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.h49
-rw-r--r--noncore/settings/packagemanager/promptdlg.cpp51
-rw-r--r--noncore/settings/packagemanager/promptdlg.h51
23 files changed, 544 insertions, 542 deletions
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp
index 3b794b4..5d61342 100644
--- a/noncore/settings/packagemanager/entrydlg.cpp
+++ b/noncore/settings/packagemanager/entrydlg.cpp
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2004 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "entrydlg.h" 31#include "entrydlg.h"
31 32
32#include <opie2/ofiledialog.h> 33#include <opie2/ofiledialog.h>
33 34
34#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
35#include <qpe/resource.h> 36#include <qpe/resource.h>
36 37
37#include <qlabel.h> 38#include <qlabel.h>
38#include <qlayout.h> 39#include <qlayout.h>
39#include <qlineedit.h> 40#include <qlineedit.h>
40#include <qpushbutton.h> 41#include <qpushbutton.h>
41 42
42EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) 43EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal )
43 : QDialog( parent, name, modal ) 44 : QDialog( parent, name, modal )
44{ 45{
45 QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 ); 46 QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 );
46 47
47 QLabel *l = new QLabel( label, this ); 48 QLabel *l = new QLabel( label, this );
48 l->setAlignment( AlignLeft | AlignTop | WordBreak ); 49 l->setAlignment( AlignLeft | AlignTop | WordBreak );
49 layout->addMultiCellWidget( l, 0, 0, 0, 1 ); 50 layout->addMultiCellWidget( l, 0, 0, 0, 1 );
50 51
51 m_entry = new QLineEdit( this ); 52 m_entry = new QLineEdit( this );
52 layout->addWidget( m_entry, 1, 0 ); 53 layout->addWidget( m_entry, 1, 0 );
53 connect( m_entry, SIGNAL(returnPressed()), this, SLOT(slotTryAccept()) ); 54 connect( m_entry, SIGNAL(returnPressed()), this, SLOT(slotTryAccept()) );
54 55
55 QPixmap pic; 56 QPixmap pic;
56 pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 57 pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
57 QPushButton *btn = new QPushButton( pic, QString::null, this ); 58 QPushButton *btn = new QPushButton( pic, QString::null, this );
58 btn->setMaximumWidth( btn->height() ); 59 btn->setMaximumWidth( btn->height() );
59 connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); 60 connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) );
60 layout->addWidget( btn, 1, 1 ); 61 layout->addWidget( btn, 1, 1 );
61 62
62 layout->setRowStretch( 2, 10 ); 63 layout->setRowStretch( 2, 10 );
63 64
64 resize( width(), l->height() + btn->height() + 8 ); 65 resize( width(), l->height() + btn->height() + 8 );
65} 66}
66 67
67void EntryDlg::setText( const QString &text ) 68void EntryDlg::setText( const QString &text )
68{ 69{
69 m_entry->setText( text ); 70 m_entry->setText( text );
70 m_entry->selectAll(); 71 m_entry->selectAll();
71} 72}
72 73
73QString EntryDlg::getText() 74QString EntryDlg::getText()
74{ 75{
75 return m_entry->text(); 76 return m_entry->text();
diff --git a/noncore/settings/packagemanager/entrydlg.h b/noncore/settings/packagemanager/entrydlg.h
index 012589b..3f897ae 100644
--- a/noncore/settings/packagemanager/entrydlg.h
+++ b/noncore/settings/packagemanager/entrydlg.h
@@ -1,58 +1,59 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2004 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#ifndef ENTRYDLG_H 31#ifndef ENTRYDLG_H
31#define ENTRYDLG_H 32#define ENTRYDLG_H
32 33
33#include <qdialog.h> 34#include <qdialog.h>
34 35
35class QLineEdit; 36class QLineEdit;
36 37
37class EntryDlg : public QDialog 38class EntryDlg : public QDialog
38{ 39{
39 Q_OBJECT 40 Q_OBJECT
40 41
41public: 42public:
42 static QString getText( const QString &caption, const QString &label, const QString &text = QString::null, 43 static QString getText( const QString &caption, const QString &label, const QString &text = QString::null,
43 bool *ok = 0, QWidget *parent = 0, const char *name = 0 ); 44 bool *ok = 0, QWidget *parent = 0, const char *name = 0 );
44 45
45 EntryDlg( const QString &label, QWidget* parent = 0, const char* name = 0, bool modal = true ); 46 EntryDlg( const QString &label, QWidget* parent = 0, const char* name = 0, bool modal = true );
46 47
47 void setText( const QString &text ); 48 void setText( const QString &text );
48 QString getText(); 49 QString getText();
49 50
50private slots: 51private slots:
51 void slotTryAccept(); 52 void slotTryAccept();
52 void slotSelectPath(); 53 void slotSelectPath();
53 54
54private: 55private:
55 QLineEdit *m_entry; 56 QLineEdit *m_entry;
56}; 57};
57 58
58#endif // EntryDlg_H 59#endif // EntryDlg_H
diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp
index e69b6eb..4924972 100644
--- a/noncore/settings/packagemanager/filterdlg.cpp
+++ b/noncore/settings/packagemanager/filterdlg.cpp
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "filterdlg.h" 31#include "filterdlg.h"
31 32
32#include <qwhatsthis.h> 33#include <qwhatsthis.h>
33 34
34FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, 35FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name,
35 const QString &server, const QString &destination, 36 const QString &server, const QString &destination,
36 OPackageManager::Status status, const QString &category ) 37 OPackageManager::Status status, const QString &category )
37 : QDialog( parent, QString::null, true, WStyle_ContextHelp ) 38 : QDialog( parent, QString::null, true, WStyle_ContextHelp )
38{ 39{
39 setCaption( tr( "Filter packages" ) ); 40 setCaption( tr( "Filter packages" ) );
40 41
41 QVBoxLayout *layout = new QVBoxLayout( this ); 42 QVBoxLayout *layout = new QVBoxLayout( this );
42 QScrollView *sv = new QScrollView( this ); 43 QScrollView *sv = new QScrollView( this );
43 layout->addWidget( sv, 0, 0 ); 44 layout->addWidget( sv, 0, 0 );
44 sv->setResizePolicy( QScrollView::AutoOneFit ); 45 sv->setResizePolicy( QScrollView::AutoOneFit );
45 sv->setFrameStyle( QFrame::NoFrame ); 46 sv->setFrameStyle( QFrame::NoFrame );
46 QWidget *container = new QWidget( sv->viewport() ); 47 QWidget *container = new QWidget( sv->viewport() );
47 sv->addChild( container ); 48 sv->addChild( container );
48 layout = new QVBoxLayout( container, 4, 4 ); 49 layout = new QVBoxLayout( container, 4, 4 );
49 50
50 // Category 51 // Category
51 m_categoryCB = new QCheckBox( tr( "Category:" ), container ); 52 m_categoryCB = new QCheckBox( tr( "Category:" ), container );
52 QWhatsThis::add( m_categoryCB, tr( "Tap here to filter package list by application category." ) ); 53 QWhatsThis::add( m_categoryCB, tr( "Tap here to filter package list by application category." ) );
53 connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) ); 54 connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) );
54 m_category = new QComboBox( container ); 55 m_category = new QComboBox( container );
55 QWhatsThis::add( m_category, tr( "Select the application category to filter by here." ) ); 56 QWhatsThis::add( m_category, tr( "Select the application category to filter by here." ) );
56 m_category->insertStringList( pm->categories() ); 57 m_category->insertStringList( pm->categories() );
57 initItem( m_category, m_categoryCB, category ); 58 initItem( m_category, m_categoryCB, category );
58 layout->addWidget( m_categoryCB ); 59 layout->addWidget( m_categoryCB );
59 layout->addWidget( m_category ); 60 layout->addWidget( m_category );
60 61
61 // Package name 62 // Package name
62 m_nameCB = new QCheckBox( tr( "Names containing:" ), container ); 63 m_nameCB = new QCheckBox( tr( "Names containing:" ), container );
63 QWhatsThis::add( m_nameCB, tr( "Tap here to filter package list by package name." ) ); 64 QWhatsThis::add( m_nameCB, tr( "Tap here to filter package list by package name." ) );
64 connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) ); 65 connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) );
65 m_name = new QLineEdit( name, container ); 66 m_name = new QLineEdit( name, container );
66 QWhatsThis::add( m_name, tr( "Enter the package name to filter by here." ) ); 67 QWhatsThis::add( m_name, tr( "Enter the package name to filter by here." ) );
67 if ( !name.isNull() ) 68 if ( !name.isNull() )
68 m_nameCB->setChecked( true ); 69 m_nameCB->setChecked( true );
69 m_name->setEnabled( !name.isNull() ); 70 m_name->setEnabled( !name.isNull() );
70 layout->addWidget( m_nameCB ); 71 layout->addWidget( m_nameCB );
71 layout->addWidget( m_name ); 72 layout->addWidget( m_name );
72 73
73 // Status 74 // Status
74 m_statusCB = new QCheckBox( tr( "With the status:" ), container ); 75 m_statusCB = new QCheckBox( tr( "With the status:" ), container );
75 QWhatsThis::add( m_statusCB, tr( "Tap here to filter package list by the package status." ) ); 76 QWhatsThis::add( m_statusCB, tr( "Tap here to filter package list by the package status." ) );
diff --git a/noncore/settings/packagemanager/filterdlg.h b/noncore/settings/packagemanager/filterdlg.h
index bd89b42..6f39464 100644
--- a/noncore/settings/packagemanager/filterdlg.h
+++ b/noncore/settings/packagemanager/filterdlg.h
@@ -1,75 +1,76 @@
1/* 1/*
2                This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5             .=l. 5 =.
6           .>+-= 6 .=l.
7 _;:,     .>    :=|. This file is free software; you can 7           .>+-=
8.> <`_,   >  .   <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i,     .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12     ._= =}       : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13    .%`+i>       _;_. 13     ._= =}       : or (at your option) any later version.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16    : ..    .:,     . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.=       =       ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++=   -.     .`     .: 20..}^=.=       =       ; Library General Public License for more
21 :     =  ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22 -.   .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24    --        :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#ifndef FILTERDLG_H 31#ifndef FILTERDLG_H
31#define FILTERDLG_H 32#define FILTERDLG_H
32 33
33#include "opackagemanager.h" 34#include "opackagemanager.h"
34 35
35#include <qcheckbox.h> 36#include <qcheckbox.h>
36#include <qdialog.h> 37#include <qdialog.h>
37#include <qcombobox.h> 38#include <qcombobox.h>
38#include <qlayout.h> 39#include <qlayout.h>
39#include <qlineedit.h> 40#include <qlineedit.h>
40#include <qscrollview.h> 41#include <qscrollview.h>
41 42
42class FilterDlg : public QDialog 43class FilterDlg : public QDialog
43{ 44{
44 Q_OBJECT 45 Q_OBJECT
45 46
46public: 47public:
47 FilterDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &name = 0x0, 48 FilterDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &name = 0x0,
48 const QString &server = 0x0, const QString &destination = 0x0, 49 const QString &server = 0x0, const QString &destination = 0x0,
49 OPackageManager::Status status = OPackageManager::All, 50 OPackageManager::Status status = OPackageManager::All,
50 const QString &category = 0x0 ); 51 const QString &category = 0x0 );
51 52
52 QString name() 53 QString name()
53 { return m_nameCB->isChecked() ? m_name->text() : QString::null; }; 54 { return m_nameCB->isChecked() ? m_name->text() : QString::null; };
54 QString server() 55 QString server()
55 { return m_serverCB->isChecked() ? m_server->currentText() : QString::null; }; 56 { return m_serverCB->isChecked() ? m_server->currentText() : QString::null; };
56 QString destination() 57 QString destination()
57 { return m_destCB->isChecked() ? m_destination->currentText() : QString::null; }; 58 { return m_destCB->isChecked() ? m_destination->currentText() : QString::null; };
58 OPackageManager::Status status() 59 OPackageManager::Status status()
59 { 60 {
60 if ( m_statusCB->isChecked() ) 61 if ( m_statusCB->isChecked() )
61 { 62 {
62 if ( m_status->currentText() == tr( "All" ) ) 63 if ( m_status->currentText() == tr( "All" ) )
63 return OPackageManager::All; 64 return OPackageManager::All;
64 else if ( m_status->currentText() == tr( "Installed" ) ) 65 else if ( m_status->currentText() == tr( "Installed" ) )
65 return OPackageManager::Installed; 66 return OPackageManager::Installed;
66 else if ( m_status->currentText() == tr( "Not installed" ) ) 67 else if ( m_status->currentText() == tr( "Not installed" ) )
67 return OPackageManager::NotInstalled; 68 return OPackageManager::NotInstalled;
68 else if ( m_status->currentText() == tr( "Updated" ) ) 69 else if ( m_status->currentText() == tr( "Updated" ) )
69 return OPackageManager::Updated; 70 return OPackageManager::Updated;
70 } 71 }
71 72
72 return OPackageManager::NotDefined; 73 return OPackageManager::NotDefined;
73 }; 74 };
74 QString category() 75 QString category()
75 { return m_categoryCB->isChecked() ? m_category->currentText() : QString::null; }; 76 { return m_categoryCB->isChecked() ? m_category->currentText() : QString::null; };
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 8aed10d..205d7ed 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "installdlg.h" 31#include "installdlg.h"
31 32
32#include <opie2/ofiledialog.h> 33#include <opie2/ofiledialog.h>
33 34
34#include <qpe/fileselector.h> 35#include <qpe/fileselector.h>
35#include <qpe/resource.h> 36#include <qpe/resource.h>
36#include <qpe/storage.h> 37#include <qpe/storage.h>
37 38
38#include <qapplication.h> 39#include <qapplication.h>
39#include <qcombobox.h> 40#include <qcombobox.h>
40#include <qfileinfo.h> 41#include <qfileinfo.h>
41#include <qgroupbox.h> 42#include <qgroupbox.h>
42#include <qlabel.h> 43#include <qlabel.h>
43#include <qlayout.h> 44#include <qlayout.h>
44#include <qmap.h> 45#include <qmap.h>
45#include <qmultilineedit.h> 46#include <qmultilineedit.h>
46#include <qpushbutton.h> 47#include <qpushbutton.h>
47 48
48#include <sys/vfs.h> 49#include <sys/vfs.h>
49 50
50#include "opackagemanager.h" 51#include "opackagemanager.h"
51 52
52InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, 53InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption,
53 OPackage::Command command1, const QStringList &packages1, 54 OPackage::Command command1, const QStringList &packages1,
54 OPackage::Command command2, const QStringList &packages2, 55 OPackage::Command command2, const QStringList &packages2,
55 OPackage::Command command3, const QStringList &packages3 ) 56 OPackage::Command command3, const QStringList &packages3 )
56 : QWidget( 0l ) 57 : QWidget( 0l )
57 , m_packman( pm ) 58 , m_packman( pm )
58 , m_installFound( false ) 59 , m_installFound( false )
59 , m_numCommands( 0 ) 60 , m_numCommands( 0 )
60 , m_currCommand( 0 ) 61 , m_currCommand( 0 )
61 , m_destItem( 0l ) 62 , m_destItem( 0l )
62{ 63{
63 // Save command/package list information 64 // Save command/package list information
64 if ( command1 != OPackage::NotDefined ) 65 if ( command1 != OPackage::NotDefined )
65 { 66 {
66 m_command[ m_numCommands ] = command1; 67 m_command[ m_numCommands ] = command1;
67 m_packages[ m_numCommands ] = packages1; 68 m_packages[ m_numCommands ] = packages1;
68 ++m_numCommands; 69 ++m_numCommands;
69 70
70 if ( command1 == OPackage::Install ) 71 if ( command1 == OPackage::Install )
71 m_installFound = true; 72 m_installFound = true;
72 } 73 }
73 if ( command2 != OPackage::NotDefined ) 74 if ( command2 != OPackage::NotDefined )
74 { 75 {
75 m_command[ m_numCommands ] = command2; 76 m_command[ m_numCommands ] = command2;
diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h
index e633809..a41a38f 100644
--- a/noncore/settings/packagemanager/installdlg.h
+++ b/noncore/settings/packagemanager/installdlg.h
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#ifndef INSTALLDLG_H 31#ifndef INSTALLDLG_H
31#define INSTALLDLG_H 32#define INSTALLDLG_H
32 33
33#include <qwidget.h> 34#include <qwidget.h>
34 35
35#include "opackage.h" 36#include "opackage.h"
36 37
37class QComboBox; 38class QComboBox;
38class QLabel; 39class QLabel;
39class QMultiLineEdit; 40class QMultiLineEdit;
40class QPushButton; 41class QPushButton;
41 42
42class OConfItem; 43class OConfItem;
43class OPackageManager; 44class OPackageManager;
44 45
45class InstallDlg : public QWidget 46class InstallDlg : public QWidget
46{ 47{
47 Q_OBJECT 48 Q_OBJECT
48 49
49public: 50public:
50 InstallDlg( QWidget *parent = 0l, OPackageManager *pm = 0l, 51 InstallDlg( QWidget *parent = 0l, OPackageManager *pm = 0l,
51 const QString &caption = QString::null, 52 const QString &caption = QString::null,
52 OPackage::Command command1 = OPackage::NotDefined, 53 OPackage::Command command1 = OPackage::NotDefined,
53 const QStringList &packages1 = QStringList(), 54 const QStringList &packages1 = QStringList(),
54 OPackage::Command command2 = OPackage::NotDefined, 55 OPackage::Command command2 = OPackage::NotDefined,
55 const QStringList &packages2 = QStringList(), 56 const QStringList &packages2 = QStringList(),
56 OPackage::Command command3 = OPackage::NotDefined, 57 OPackage::Command command3 = OPackage::NotDefined,
57 const QStringList &packages3 = QStringList() ); 58 const QStringList &packages3 = QStringList() );
58 59
59private: 60private:
60 OPackageManager *m_packman; // Pointer to application instance of package manager 61 OPackageManager *m_packman; // Pointer to application instance of package manager
61 62
62 bool m_installFound; // Indicates if an install is being done, controls display of 63 bool m_installFound; // Indicates if an install is being done, controls display of
63 // destination selection, available space 64 // destination selection, available space
64 65
65 // UI controls 66 // UI controls
66 QComboBox *m_destination; // Destination selection list 67 QComboBox *m_destination; // Destination selection list
67 QLabel *m_availSpace; // Text label to display available space on selected destination 68 QLabel *m_availSpace; // Text label to display available space on selected destination
68 QMultiLineEdit *m_output; // Multi-line edit to display status 69 QMultiLineEdit *m_output; // Multi-line edit to display status
69 QPushButton *m_btnStart; // Start/abort/close button 70 QPushButton *m_btnStart; // Start/abort/close button
70 QPushButton *m_btnOptions; // Installation options button 71 QPushButton *m_btnOptions; // Installation options button
71 72
72 // Commands and packages to execute 73 // Commands and packages to execute
73 int m_numCommands; // Number of commands to be executed 74 int m_numCommands; // Number of commands to be executed
74 int m_currCommand; // Number of currently executing command 75 int m_currCommand; // Number of currently executing command
75 OPackage::Command m_command[3]; // List of commands to be executed 76 OPackage::Command m_command[3]; // List of commands to be executed
diff --git a/noncore/settings/packagemanager/main.cpp b/noncore/settings/packagemanager/main.cpp
index 3792881..5863662 100644
--- a/noncore/settings/packagemanager/main.cpp
+++ b/noncore/settings/packagemanager/main.cpp
@@ -1,34 +1,35 @@
1/* 1/*
2                This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5             .=l. 5 =.
6           .>+-= 6 .=l.
7 _;:,     .>    :=|. This file is free software; you can 7           .>+-=
8.> <`_,   >  .   <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i,     .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12     ._= =}       : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13    .%`+i>       _;_. 13     ._= =}       : or (at your option) any later version.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16    : ..    .:,     . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.=       =       ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++=   -.     .`     .: 20..}^=.=       =       ; Library General Public License for more
21 :     =  ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22 -.   .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24    --        :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "mainwindow.h" 31#include "mainwindow.h"
31 32
32#include <opie2/oapplicationfactory.h> 33#include <opie2/oapplicationfactory.h>
33 34
34OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) 35OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> )
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 8a5b90c..0e40c01 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "mainwindow.h" 31#include "mainwindow.h"
31#include "installdlg.h" 32#include "installdlg.h"
32#include "filterdlg.h" 33#include "filterdlg.h"
33#include "promptdlg.h" 34#include "promptdlg.h"
34#include "entrydlg.h" 35#include "entrydlg.h"
35#include "packageinfodlg.h" 36#include "packageinfodlg.h"
36 37
37#include <opie2/ofiledialog.h> 38#include <opie2/ofiledialog.h>
38 39
39#include <qpe/qcopenvelope_qws.h> 40#include <qpe/qcopenvelope_qws.h>
40#include <qpe/qpeapplication.h> 41#include <qpe/qpeapplication.h>
41#include <qpe/resource.h> 42#include <qpe/resource.h>
42 43
43#include <qaction.h> 44#include <qaction.h>
44#include <qdir.h> 45#include <qdir.h>
45#include <qlayout.h> 46#include <qlayout.h>
46#include <qlineedit.h> 47#include <qlineedit.h>
47#include <qmenubar.h> 48#include <qmenubar.h>
48#include <qmessagebox.h> 49#include <qmessagebox.h>
49#include <qpopupmenu.h> 50#include <qpopupmenu.h>
50#include <qtimer.h> 51#include <qtimer.h>
51#include <qtoolbar.h> 52#include <qtoolbar.h>
52#include <qwhatsthis.h> 53#include <qwhatsthis.h>
53 54
54MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) 55MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
55 : QMainWindow( parent, name, WStyle_ContextHelp ) 56 : QMainWindow( parent, name, WStyle_ContextHelp )
56 , m_config( "packman" ) 57 , m_config( "packman" )
57 , m_packman( &m_config, this ) 58 , m_packman( &m_config, this )
58 , m_menuBar( this ) 59 , m_menuBar( this )
59 , m_toolBar( this ) 60 , m_toolBar( this )
60 , m_findBar( this ) 61 , m_findBar( this )
61 , m_widgetStack( this ) 62 , m_widgetStack( this )
62 , m_packageList( this ) 63 , m_packageList( this )
63 , m_statusWidget( this ) 64 , m_statusWidget( this )
64 , m_statusText( &m_statusWidget ) 65 , m_statusText( &m_statusWidget )
65 , m_statusBar( &m_statusWidget ) 66 , m_statusBar( &m_statusWidget )
66 , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) ) 67 , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) )
67 , m_iconInstalled( Resource::loadPixmap( "installed" ) ) 68 , m_iconInstalled( Resource::loadPixmap( "installed" ) )
68 , m_iconNull( m_iconUpdated.size() ) 69 , m_iconNull( m_iconUpdated.size() )
69 , m_filterName( QString::null ) 70 , m_filterName( QString::null )
70 , m_filterServer( QString::null ) 71 , m_filterServer( QString::null )
71 , m_filterDest( QString::null ) 72 , m_filterDest( QString::null )
72 , m_filterStatus( OPackageManager::NotDefined ) 73 , m_filterStatus( OPackageManager::NotDefined )
73 , m_filterCategory( QString::null ) 74 , m_filterCategory( QString::null )
74 75
75{ 76{
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h
index f00e344..e7003e4 100644
--- a/noncore/settings/packagemanager/mainwindow.h
+++ b/noncore/settings/packagemanager/mainwindow.h
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#ifndef MAINWINDOW_H 31#ifndef MAINWINDOW_H
31#define MAINWINDOW_H 32#define MAINWINDOW_H
32 33
33#include "opackagemanager.h" 34#include "opackagemanager.h"
34 35
35#include <qpe/config.h> 36#include <qpe/config.h>
36 37
37#include <qlabel.h> 38#include <qlabel.h>
38#include <qlistview.h> 39#include <qlistview.h>
39#include <qmainwindow.h> 40#include <qmainwindow.h>
40#include <qpixmap.h> 41#include <qpixmap.h>
41#include <qprogressbar.h> 42#include <qprogressbar.h>
42#include <qtoolbar.h> 43#include <qtoolbar.h>
43#include <qwidgetstack.h> 44#include <qwidgetstack.h>
44 45
45class QAction; 46class QAction;
46class QLineEdit; 47class QLineEdit;
47 48
48class MainWindow :public QMainWindow 49class MainWindow :public QMainWindow
49{ 50{
50 Q_OBJECT 51 Q_OBJECT
51 52
52public: 53public:
53 MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); 54 MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 );
54 static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); }; 55 static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); };
55 56
56protected: 57protected:
57 void closeEvent( QCloseEvent *event ); 58 void closeEvent( QCloseEvent *event );
58 59
59private: 60private:
60 Config m_config; // Configuration file 61 Config m_config; // Configuration file
61 62
62 OPackageManager m_packman; // Package manager 63 OPackageManager m_packman; // Package manager
63 64
64 // Toolbars 65 // Toolbars
65 QToolBar m_menuBar; // Main toolbar containing menu 66 QToolBar m_menuBar; // Main toolbar containing menu
66 QToolBar m_toolBar; // Main toolbar 67 QToolBar m_toolBar; // Main toolbar
67 QToolBar m_findBar; // Find toolbar 68 QToolBar m_findBar; // Find toolbar
68 69
69 QWidgetStack m_widgetStack; // Main widget stack which contains m_packageList & m_statusWidget 70 QWidgetStack m_widgetStack; // Main widget stack which contains m_packageList & m_statusWidget
70 QListView m_packageList; // Main list view of all packages 71 QListView m_packageList; // Main list view of all packages
71 72
72 QLineEdit *m_findEdit; // Line edit box used for find toolbar 73 QLineEdit *m_findEdit; // Line edit box used for find toolbar
73 74
74 // Status widget controls 75 // Status widget controls
75 QWidget m_statusWidget; // Widget to display status during long operations 76 QWidget m_statusWidget; // Widget to display status during long operations
diff --git a/noncore/settings/packagemanager/oconfitem.cpp b/noncore/settings/packagemanager/oconfitem.cpp
index ffa936e..76c8c65 100644
--- a/noncore/settings/packagemanager/oconfitem.cpp
+++ b/noncore/settings/packagemanager/oconfitem.cpp
@@ -1,42 +1,41 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#include "oconfitem.h" 31#include "oconfitem.h"
33 32
34OConfItem::OConfItem( Type type, const QString &name, const QString &value, 33OConfItem::OConfItem( Type type, const QString &name, const QString &value,
35 const QString &features, bool active ) 34 const QString &features, bool active )
36 : m_type( type ) 35 : m_type( type )
37 , m_name( name ) 36 , m_name( name )
38 , m_value( value ) 37 , m_value( value )
39 , m_features( features ) 38 , m_features( features )
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 b306e93..c95039e 100644
--- a/noncore/settings/packagemanager/oconfitem.h
+++ b/noncore/settings/packagemanager/oconfitem.h
@@ -1,77 +1,76 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#ifndef OCONFITEM_H 31#ifndef OCONFITEM_H
33#define OCONFITEM_H 32#define OCONFITEM_H
34 33
35#include <qlist.h> 34#include <qlist.h>
36#include <qstring.h> 35#include <qstring.h>
37 36
38class OConfItem 37class OConfItem
39{ 38{
40public: 39public:
41 enum Type { Source, Destination, Option, Arch, Other, NotDefined }; 40 enum Type { Source, Destination, Option, Arch, Other, NotDefined };
42 41
43 OConfItem( Type type = NotDefined, const QString &name = QString::null, 42 OConfItem( Type type = NotDefined, const QString &name = QString::null,
44 const QString &value = QString::null, const QString &features = QString::null, 43 const QString &value = QString::null, const QString &features = QString::null,
45 bool active = true ); 44 bool active = true );
46 45
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 const QString &features() { return m_features; } 49 const QString &features() { return m_features; }
51 bool active() { return m_active; } 50 bool active() { return m_active; }
52 51
53 void setType( Type type ) { m_type = type; } 52 void setType( Type type ) { m_type = type; }
54 void setName( const QString &name ) { m_name = name; } 53 void setName( const QString &name ) { m_name = name; }
55 void setValue( const QString &value ) { m_value = value; } 54 void setValue( const QString &value ) { m_value = value; }
56 void setFeatures( const QString &features ) { m_features = features; } 55 void setFeatures( const QString &features ) { m_features = features; }
57 void setActive( bool active ) { m_active = active; } 56 void setActive( bool active ) { m_active = active; }
58 57
59private: 58private:
60 Type m_type; // Type of configuration item 59 Type m_type; // Type of configuration item
61 QString m_name; // Name of item 60 QString m_name; // Name of item
62 QString m_value; // Value of item 61 QString m_value; // Value of item
63 QString m_features; // Comma-deliminated list of features this item supports 62 QString m_features; // Comma-deliminated list of features this item supports
64 bool m_active; // Indicates whether item is currently active 63 bool m_active; // Indicates whether item is currently active
65}; 64};
66 65
67class OConfItemList : public QList<OConfItem> 66class OConfItemList : public QList<OConfItem>
68{ 67{
69private: 68private:
70 69
71 int compareItems( QCollection::Item item1, QCollection::Item item2 ) 70 int compareItems( QCollection::Item item1, QCollection::Item item2 )
72 { 71 {
73 // Sort by OConfItem location then by type 72 // Sort by OConfItem location then by type
74 OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); 73 OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type();
75 OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); 74 OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type();
76 if ( type1 < type2 ) 75 if ( type1 < type2 )
77 return -1; 76 return -1;
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index 7bc2040..ffb3687 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -1,77 +1,76 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#include "oipkg.h" 31#include "oipkg.h"
33 32
34#include <qdir.h> 33#include <qdir.h>
35#include <qfile.h> 34#include <qfile.h>
36#include <qtextstream.h> 35#include <qtextstream.h>
37 36
38#include <stdlib.h> 37#include <stdlib.h>
39#include <unistd.h> 38#include <unistd.h>
40 39
41extern "C" { 40extern "C" {
42#include <libipkg.h> 41#include <libipkg.h>
43}; 42};
44args_t m_ipkgArgs; // libipkg configuration arguments 43args_t m_ipkgArgs; // libipkg configuration arguments
45 44
46const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file 45const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file
47const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files 46const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files
48const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists 47const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists
49const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location 48const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location
50const QString IPKG_INFO_PATH = "usr/lib/ipkg/info"; // Package file lists location 49const QString IPKG_INFO_PATH = "usr/lib/ipkg/info"; // Package file lists location
51 50
52OIpkg *oipkg; 51OIpkg *oipkg;
53 52
54// Ipkg callback functions 53// Ipkg callback functions
55 54
56int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg ) 55int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg )
57{ 56{
58 // Display message only if it is below the message level threshold 57 // Display message only if it is below the message level threshold
59 if ( conf && ( conf->verbosity < level ) ) 58 if ( conf && ( conf->verbosity < level ) )
60 return 0; 59 return 0;
61 else 60 else
62 oipkg->ipkgMessage( msg ); 61 oipkg->ipkgMessage( msg );
63 62
64 return 0; 63 return 0;
65} 64}
66 65
67char *fIpkgResponse( char */*question*/ ) 66char *fIpkgResponse( char */*question*/ )
68{ 67{
69 return 0l; 68 return 0l;
70} 69}
71 70
72int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ ) 71int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ )
73{ 72{
74 oipkg->ipkgStatus( desc ); 73 oipkg->ipkgStatus( desc );
75 return 0; 74 return 0;
76} 75}
77 76
diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h
index 4e390fa..9a7802c 100644
--- a/noncore/settings/packagemanager/oipkg.h
+++ b/noncore/settings/packagemanager/oipkg.h
@@ -1,77 +1,76 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#ifndef OIPKG_H 31#ifndef OIPKG_H
33#define OIPKG_H 32#define OIPKG_H
34 33
35#include "oconfitem.h" 34#include "oconfitem.h"
36#include "opackage.h" 35#include "opackage.h"
37 36
38#include <qpe/config.h> 37#include <qpe/config.h>
39 38
40#include <qobject.h> 39#include <qobject.h>
41 40
42// Ipkg execution options (m_ipkgExecOptions) 41// Ipkg execution options (m_ipkgExecOptions)
43#define FORCE_DEPENDS 0x0001 42#define FORCE_DEPENDS 0x0001
44#define FORCE_REMOVE 0x0002 43#define FORCE_REMOVE 0x0002
45#define FORCE_REINSTALL 0x0004 44#define FORCE_REINSTALL 0x0004
46#define FORCE_OVERWRITE 0x0008 45#define FORCE_OVERWRITE 0x0008
47 46
48class OConfItemList; 47class OConfItemList;
49 48
50class OIpkg : public QObject 49class OIpkg : public QObject
51{ 50{
52 Q_OBJECT 51 Q_OBJECT
53 52
54public: 53public:
55 OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l ); 54 OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l );
56 ~OIpkg(); 55 ~OIpkg();
57 56
58 OConfItemList *configItems(); 57 OConfItemList *configItems();
59 OConfItemList *servers(); 58 OConfItemList *servers();
60 OConfItemList *destinations(); 59 OConfItemList *destinations();
61 OConfItemList *options(); 60 OConfItemList *options();
62 61
63 int ipkgExecOptions() { return m_ipkgExecOptions; } 62 int ipkgExecOptions() { return m_ipkgExecOptions; }
64 int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } 63 int ipkgExecVerbosity() { return m_ipkgExecVerbosity; }
65 64
66 void setConfigItems( OConfItemList *configList ); 65 void setConfigItems( OConfItemList *configList );
67 void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } 66 void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; }
68 void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } 67 void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; }
69 68
70 void saveSettings(); 69 void saveSettings();
71 70
72 OPackageList *availablePackages( const QString &server = QString::null ); 71 OPackageList *availablePackages( const QString &server = QString::null );
73 OPackageList *installedPackages( const QString &destName = QString::null, 72 OPackageList *installedPackages( const QString &destName = QString::null,
74 const QString &destPath = QString::null ); 73 const QString &destPath = QString::null );
75 74
76 OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, 75 OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined,
77 const QString &name = QString::null ); 76 const QString &name = QString::null );
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 0ad1c82..945571f 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -1,77 +1,76 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#include "oipkgconfigdlg.h" 31#include "oipkgconfigdlg.h"
33 32
34#include <opie2/ofiledialog.h> 33#include <opie2/ofiledialog.h>
35 34
36#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
37#include <qpe/resource.h> 36#include <qpe/resource.h>
38 37
39#include <qcheckbox.h> 38#include <qcheckbox.h>
40#include <qcombobox.h> 39#include <qcombobox.h>
41#include <qgroupbox.h> 40#include <qgroupbox.h>
42#include <qlabel.h> 41#include <qlabel.h>
43#include <qlineedit.h> 42#include <qlineedit.h>
44#include <qlistbox.h> 43#include <qlistbox.h>
45#include <qpushbutton.h> 44#include <qpushbutton.h>
46#include <qscrollview.h> 45#include <qscrollview.h>
47#include <qwhatsthis.h> 46#include <qwhatsthis.h>
48 47
49OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) 48OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent )
50 : QDialog( parent, QString::null, true, WStyle_ContextHelp ) 49 : QDialog( parent, QString::null, true, WStyle_ContextHelp )
51 , m_ipkg( ipkg ) 50 , m_ipkg( ipkg )
52 , m_configs( 0l ) 51 , m_configs( 0l )
53 , m_installOptions( installOptions ) 52 , m_installOptions( installOptions )
54 , m_serverCurrent( -1 ) 53 , m_serverCurrent( -1 )
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
71 initData(); 70 initData();
72 71
73 // Setup tabs for all info 72 // Setup tabs for all info
74 m_layout.addWidget( &m_tabWidget ); 73 m_layout.addWidget( &m_tabWidget );
75 if ( !m_installOptions ) 74 if ( !m_installOptions )
76 { 75 {
77 m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); 76 m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) );
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h
index 9e23b62..88381ab 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.h
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.h
@@ -1,80 +1,78 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32
33#ifndef OIPKGCONFIGDLG_H 31#ifndef OIPKGCONFIGDLG_H
34#define OIPKGCONFIGDLG_H 32#define OIPKGCONFIGDLG_H
35 33
36#include <opie2/otabwidget.h> 34#include <opie2/otabwidget.h>
37 35
38#include <qdialog.h> 36#include <qdialog.h>
39#include <qlayout.h> 37#include <qlayout.h>
40 38
41#include "oipkg.h" 39#include "oipkg.h"
42 40
43class QCheckBox; 41class QCheckBox;
44class QComboBox; 42class QComboBox;
45class QLineEdit; 43class QLineEdit;
46class QListBox; 44class QListBox;
47class QPushButton; 45class QPushButton;
48 46
49class OIpkgConfigDlg : public QDialog 47class OIpkgConfigDlg : public QDialog
50{ 48{
51 Q_OBJECT 49 Q_OBJECT
52 50
53public: 51public:
54 OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); 52 OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l );
55 53
56protected slots: 54protected slots:
57 void accept(); 55 void accept();
58 void reject(); 56 void reject();
59 57
60private: 58private:
61 OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options 59 OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options
62 OConfItemList *m_configs; // Local list of configuration items 60 OConfItemList *m_configs; // Local list of configuration items
63 61
64 bool m_installOptions; // If true, will only display the Options tab 62 bool m_installOptions; // If true, will only display the Options tab
65 63
66 // Server/Destination cached information 64 // Server/Destination cached information
67 int m_serverCurrent; // Index of currently selected server in m_serverList 65 int m_serverCurrent; // Index of currently selected server in m_serverList
68 int m_destCurrent; // Index of currently selected destination in m_destList 66 int m_destCurrent; // Index of currently selected destination in m_destList
69 67
70 // UI controls 68 // UI controls
71 QVBoxLayout m_layout; // Main dialog layout control 69 QVBoxLayout m_layout; // Main dialog layout control
72 Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control 70 Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control
73 QWidget *m_serverWidget; // Widget containing server configuration controls 71 QWidget *m_serverWidget; // Widget containing server configuration controls
74 QWidget *m_destWidget; // Widget containing destination configuration controls 72 QWidget *m_destWidget; // Widget containing destination configuration controls
75 QWidget *m_proxyWidget; // Widget containing proxy configuration controls 73 QWidget *m_proxyWidget; // Widget containing proxy configuration controls
76 QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls 74 QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls
77 75
78 // Server configuration UI controls 76 // Server configuration UI controls
79 QListBox *m_serverList; // Server list selection 77 QListBox *m_serverList; // Server list selection
80 QPushButton *m_serverEditBtn; // Server edit button 78 QPushButton *m_serverEditBtn; // Server edit button
diff --git a/noncore/settings/packagemanager/opackage.cpp b/noncore/settings/packagemanager/opackage.cpp
index 37963fa..f3c2024 100644
--- a/noncore/settings/packagemanager/opackage.cpp
+++ b/noncore/settings/packagemanager/opackage.cpp
@@ -1,46 +1,45 @@
1/* 1/*
2                This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4              Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#include "opackage.h" 31#include "opackage.h"
33 32
34OPackage::OPackage( const QString &name, const QString &version, const QString &versionInstalled, 33OPackage::OPackage( const QString &name, const QString &version, const QString &versionInstalled,
35 const QString &source, const QString &destination, const QString &category, 34 const QString &source, const QString &destination, const QString &category,
36 const QString &information, const QString &files ) 35 const QString &information, const QString &files )
37 : m_name( name ) 36 : m_name( name )
38 , m_version( version ) 37 , m_version( version )
39 , m_versionInstalled( versionInstalled ) 38 , m_versionInstalled( versionInstalled )
40 , m_source( source ) 39 , m_source( source )
41 , m_destination( destination ) 40 , m_destination( destination )
42 , m_category( category ) 41 , m_category( category )
43 , m_information( information ) 42 , m_information( information )
44 , m_files( files ) 43 , m_files( files )
45{ 44{
46} 45}
diff --git a/noncore/settings/packagemanager/opackage.h b/noncore/settings/packagemanager/opackage.h
index fbd9ec0..4da5a2b 100644
--- a/noncore/settings/packagemanager/opackage.h
+++ b/noncore/settings/packagemanager/opackage.h
@@ -1,77 +1,76 @@
1/* 1/*
2                This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4              Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#ifndef OPACKAGE_H 31#ifndef OPACKAGE_H
33#define OPACKAGE_H 32#define OPACKAGE_H
34 33
35#include <qlist.h> 34#include <qlist.h>
36#include <qstring.h> 35#include <qstring.h>
37 36
38class OPackage 37class OPackage
39{ 38{
40public: 39public:
41 enum Command { Install, Remove, Update, Upgrade, Download, Info, Files, Version, NotDefined }; 40 enum Command { Install, Remove, Update, Upgrade, Download, Info, Files, Version, NotDefined };
42 41
43 OPackage( const QString &name= QString::null, 42 OPackage( const QString &name= QString::null,
44 const QString &version= QString::null, const QString &versionInstalled= QString::null, 43 const QString &version= QString::null, const QString &versionInstalled= QString::null,
45 const QString &source= QString::null, const QString &destination= QString::null, 44 const QString &source= QString::null, const QString &destination= QString::null,
46 const QString &category = "misc", const QString &information = QString::null, 45 const QString &category = "misc", const QString &information = QString::null,
47 const QString &files = QString::null ); 46 const QString &files = QString::null );
48 47
49 const QString &name() { return m_name; } 48 const QString &name() { return m_name; }
50 const QString &version() { return m_version; } 49 const QString &version() { return m_version; }
51 const QString &versionInstalled() { return m_versionInstalled; } 50 const QString &versionInstalled() { return m_versionInstalled; }
52 const QString &source() { return m_source; } 51 const QString &source() { return m_source; }
53 const QString &destination() { return m_destination; } 52 const QString &destination() { return m_destination; }
54 const QString &category() { return m_category; } 53 const QString &category() { return m_category; }
55 const QString &information() { return m_information; } 54 const QString &information() { return m_information; }
56 const QString &files() { return m_files; } 55 const QString &files() { return m_files; }
57 56
58 void setName( const QString &name ) { m_name = name; } 57 void setName( const QString &name ) { m_name = name; }
59 void setVersion( const QString &version ) { m_version = version; } 58 void setVersion( const QString &version ) { m_version = version; }
60 void setVersionInstalled( const QString &version ) { m_versionInstalled = version; } 59 void setVersionInstalled( const QString &version ) { m_versionInstalled = version; }
61 void setSource( const QString &source ) { m_source = source; } 60 void setSource( const QString &source ) { m_source = source; }
62 void setDestination( const QString &destination ) { m_destination = destination; } 61 void setDestination( const QString &destination ) { m_destination = destination; }
63 void setCategory( const QString &category ) { m_category = category; } 62 void setCategory( const QString &category ) { m_category = category; }
64 void setInformation( const QString &information ) { m_information = information; } 63 void setInformation( const QString &information ) { m_information = information; }
65 void setFiles( const QString &files ) { m_files = files; } 64 void setFiles( const QString &files ) { m_files = files; }
66 65
67private: 66private:
68 QString m_name; // Name of item 67 QString m_name; // Name of item
69 QString m_version; // Available version number of item 68 QString m_version; // Available version number of item
70 QString m_versionInstalled; // Installed version number of item, null if not installed 69 QString m_versionInstalled; // Installed version number of item, null if not installed
71 QString m_source; // Source feed of available version 70 QString m_source; // Source feed of available version
72 QString m_destination; // Location item is installed to, null if not installed 71 QString m_destination; // Location item is installed to, null if not installed
73 QString m_category; // Item category 72 QString m_category; // Item category
74 QString m_information; // Package information 73 QString m_information; // Package information
75 QString m_files; // File list information 74 QString m_files; // File list information
76}; 75};
77 76
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp
index c9fdec1..abd8852 100644
--- a/noncore/settings/packagemanager/opackagemanager.cpp
+++ b/noncore/settings/packagemanager/opackagemanager.cpp
@@ -1,77 +1,76 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#include "opackagemanager.h" 31#include "opackagemanager.h"
33#include "oipkgconfigdlg.h" 32#include "oipkgconfigdlg.h"
34 33
35#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
36 35
37#include <ctype.h> 36#include <ctype.h>
38 37
39OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) 38OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name )
40 : QObject( parent, name ) 39 : QObject( parent, name )
41 , m_config( config ) 40 , m_config( config )
42 , m_ipkg( m_config, this ) 41 , m_ipkg( m_config, this )
43 , m_packages( 9973 ) 42 , m_packages( 9973 )
44 , m_categories() 43 , m_categories()
45{ 44{
46 m_packages.setAutoDelete( true ); 45 m_packages.setAutoDelete( true );
47} 46}
48 47
49void OPackageManager::loadAvailablePackages() 48void OPackageManager::loadAvailablePackages()
50{ 49{
51 m_packages.clear(); 50 m_packages.clear();
52 51
53 OConfItemList *serverList = m_ipkg.servers(); 52 OConfItemList *serverList = m_ipkg.servers();
54 53
55 if ( serverList ) 54 if ( serverList )
56 { 55 {
57 // Initialize status messaging 56 // Initialize status messaging
58 emit initStatus( serverList->count() ); 57 emit initStatus( serverList->count() );
59 int serverCount = 0; 58 int serverCount = 0;
60 59
61 bool categoryAdded = false; 60 bool categoryAdded = false;
62 61
63 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) 62 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
64 { 63 {
65 OConfItem *server = serverIt.current(); 64 OConfItem *server = serverIt.current();
66 65
67 // Process server only if it is active 66 // Process server only if it is active
68 if ( server->active() ) 67 if ( server->active() )
69 { 68 {
70 // Update status 69 // Update status
71 QString status = tr( "Reading available packages:\n\t" ); 70 QString status = tr( "Reading available packages:\n\t" );
72 status.append( server->name() ); 71 status.append( server->name() );
73 emit statusText( status ); 72 emit statusText( status );
74 ++serverCount; 73 ++serverCount;
75 emit statusBar( serverCount ); 74 emit statusBar( serverCount );
76 qApp->processEvents(); 75 qApp->processEvents();
77 76
diff --git a/noncore/settings/packagemanager/opackagemanager.h b/noncore/settings/packagemanager/opackagemanager.h
index bc394e8..60c1643 100644
--- a/noncore/settings/packagemanager/opackagemanager.h
+++ b/noncore/settings/packagemanager/opackagemanager.h
@@ -1,77 +1,76 @@
1/* 1/*
2 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7           .>+-=
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
30*/ 29*/
31 30
32#ifndef OPACKAGEMANAGER_H 31#ifndef OPACKAGEMANAGER_H
33#define OPACKAGEMANAGER_H 32#define OPACKAGEMANAGER_H
34 33
35#include "oipkg.h" 34#include "oipkg.h"
36 35
37#include <qpe/config.h> 36#include <qpe/config.h>
38 37
39#include <qdict.h> 38#include <qdict.h>
40#include <qobject.h> 39#include <qobject.h>
41#include <qstringlist.h> 40#include <qstringlist.h>
42 41
43class OPackageManager : public QObject 42class OPackageManager : public QObject
44{ 43{
45 Q_OBJECT 44 Q_OBJECT
46 45
47public: 46public:
48 OPackageManager( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); 47 OPackageManager( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 );
49 48
50 void loadAvailablePackages(); 49 void loadAvailablePackages();
51 void loadInstalledPackages(); 50 void loadInstalledPackages();
52 51
53 enum Status { All, NotInstalled, Installed, Updated, NotDefined }; 52 enum Status { All, NotInstalled, Installed, Updated, NotDefined };
54 53
55 OPackageList *packages(); 54 OPackageList *packages();
56 OPackageList *filterPackages( const QString &name = QString::null, 55 OPackageList *filterPackages( const QString &name = QString::null,
57 const QString &server = QString::null, 56 const QString &server = QString::null,
58 const QString &destination = QString::null, 57 const QString &destination = QString::null,
59 Status status = NotDefined, 58 Status status = NotDefined,
60 const QString &category = QString::null ); 59 const QString &category = QString::null );
61 60
62 const QStringList &categories() { return m_categories; } 61 const QStringList &categories() { return m_categories; }
63 QStringList servers(); 62 QStringList servers();
64 QStringList destinations(); 63 QStringList destinations();
65 64
66 int compareVersions( const QString &version1, const QString &version2 ); 65 int compareVersions( const QString &version1, const QString &version2 );
67 66
68 OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, 67 OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined,
69 const QString &name = QString::null ); 68 const QString &name = QString::null );
70 OPackage *findPackage( const QString &name = QString::null ); 69 OPackage *findPackage( const QString &name = QString::null );
71 70
72 bool configureDlg( bool installOptions = false ); 71 bool configureDlg( bool installOptions = false );
73 void saveSettings(); 72 void saveSettings();
74 73
75 bool executeCommand( OPackage::Command command = OPackage::NotDefined, 74 bool executeCommand( OPackage::Command command = OPackage::NotDefined,
76 const QStringList &parameters = QStringList(), 75 const QStringList &parameters = QStringList(),
77 const QString &destination = QString::null, const QObject *receiver = 0x0, 76 const QString &destination = QString::null, const QObject *receiver = 0x0,
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index 3eef939..e034f34 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -1,75 +1,76 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "packageinfodlg.h" 31#include "packageinfodlg.h"
31#include "opackage.h" 32#include "opackage.h"
32#include "opackagemanager.h" 33#include "opackagemanager.h"
33 34
34#include <opie2/otabwidget.h> 35#include <opie2/otabwidget.h>
35 36
36#include <qpe/resource.h> 37#include <qpe/resource.h>
37 38
38#include <qlayout.h> 39#include <qlayout.h>
39#include <qpushbutton.h> 40#include <qpushbutton.h>
40#include <qwhatsthis.h> 41#include <qwhatsthis.h>
41 42
42PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) 43PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
43 : QWidget( 0l ) 44 : QWidget( 0l )
44 , m_packman( pm ) 45 , m_packman( pm )
45 , m_information( this ) 46 , m_information( this )
46 , m_files( this ) 47 , m_files( this )
47 , m_retrieveFiles( 0l ) 48 , m_retrieveFiles( 0l )
48{ 49{
49 // Initialize UI 50 // Initialize UI
50 if ( parent ) 51 if ( parent )
51 parent->setCaption( package ); 52 parent->setCaption( package );
52 53
53 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); 54 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
54 55
55 Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this ); 56 Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this );
56 layout->addWidget( tabWidget ); 57 layout->addWidget( tabWidget );
57 58
58 // Information tab 59 // Information tab
59 QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) ); 60 QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) );
60 m_information.reparent( tabWidget, QPoint( 0, 0 ) ); 61 m_information.reparent( tabWidget, QPoint( 0, 0 ) );
61 m_information.setReadOnly( true ); 62 m_information.setReadOnly( true );
62 tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); 63 tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) );
63 64
64 // Retrive package information 65 // Retrive package information
65 m_package = m_packman->findPackage( package ); 66 m_package = m_packman->findPackage( package );
66 if ( !m_package ) 67 if ( !m_package )
67 { 68 {
68 m_information.setText( tr( "Unable to retrieve package information." ) ); 69 m_information.setText( tr( "Unable to retrieve package information." ) );
69 return; 70 return;
70 } 71 }
71 72
72 // Display package information 73 // Display package information
73 if ( !m_package->information().isNull() ) 74 if ( !m_package->information().isNull() )
74 m_information.setText( m_package->information() ); 75 m_information.setText( m_package->information() );
75 else 76 else
diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h
index 2962f9a..e4c6bba 100644
--- a/noncore/settings/packagemanager/packageinfodlg.h
+++ b/noncore/settings/packagemanager/packageinfodlg.h
@@ -1,66 +1,67 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#ifndef PACKAGEINFODLG_H 31#ifndef PACKAGEINFODLG_H
31#define PACKAGEINFODLG_H 32#define PACKAGEINFODLG_H
32 33
33#include "opackage.h" 34#include "opackage.h"
34 35
35#include <qmultilineedit.h> 36#include <qmultilineedit.h>
36#include <qwidget.h> 37#include <qwidget.h>
37 38
38class QPushButton; 39class QPushButton;
39 40
40class OPackage; 41class OPackage;
41class OPackageManager; 42class OPackageManager;
42 43
43class PackageInfoDlg : public QWidget 44class PackageInfoDlg : public QWidget
44{ 45{
45 Q_OBJECT 46 Q_OBJECT
46 47
47public: 48public:
48 PackageInfoDlg( QWidget *parent = 0l, OPackageManager *pm = 0l, const QString &package = QString::null ); 49 PackageInfoDlg( QWidget *parent = 0l, OPackageManager *pm = 0l, const QString &package = QString::null );
49 ~PackageInfoDlg(); 50 ~PackageInfoDlg();
50 51
51private: 52private:
52 OPackageManager *m_packman; // Pointer to application instance of package manager 53 OPackageManager *m_packman; // Pointer to application instance of package manager
53 OPackage *m_package; // Pointer to package to display information for 54 OPackage *m_package; // Pointer to package to display information for
54 55
55 // UI controls 56 // UI controls
56 QMultiLineEdit m_information; // Multi-line edit to display package information 57 QMultiLineEdit m_information; // Multi-line edit to display package information
57 QMultiLineEdit m_files; // Multi-line edit to display package file list 58 QMultiLineEdit m_files; // Multi-line edit to display package file list
58 QPushButton *m_retrieveFiles; // Push button to retrieve file list 59 QPushButton *m_retrieveFiles; // Push button to retrieve file list
59 60
60private slots: 61private slots:
61 void slotBtnFileScan(); 62 void slotBtnFileScan();
62 void slotInfo( const QString &info ); 63 void slotInfo( const QString &info );
63 void slotFiles( const QString &filelist ); 64 void slotFiles( const QString &filelist );
64}; 65};
65 66
66#endif 67#endif
diff --git a/noncore/settings/packagemanager/promptdlg.cpp b/noncore/settings/packagemanager/promptdlg.cpp
index 841b98e..5053caa 100644
--- a/noncore/settings/packagemanager/promptdlg.cpp
+++ b/noncore/settings/packagemanager/promptdlg.cpp
@@ -1,75 +1,76 @@
1/* 1/*
2                This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5             .=l. 5 =.
6           .>+-= 6 .=l.
7 _;:,     .>    :=|. This file is free software; you can 7           .>+-=
8.> <`_,   >  .   <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i,     .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12     ._= =}       : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13    .%`+i>       _;_. 13     ._= =}       : or (at your option) any later version.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16    : ..    .:,     . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.=       =       ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++=   -.     .`     .: 20..}^=.=       =       ; Library General Public License for more
21 :     =  ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22 -.   .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24    --        :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#include "promptdlg.h" 31#include "promptdlg.h"
31 32
32#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
33 34
34#include <qlabel.h> 35#include <qlabel.h>
35#include <qlayout.h> 36#include <qlayout.h>
36#include <qpushbutton.h> 37#include <qpushbutton.h>
37#include <qwidgetlist.h> 38#include <qwidgetlist.h>
38 39
39PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, 40PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2,
40 QWidget *parent ) 41 QWidget *parent )
41 : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog ) 42 : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog )
42 , m_btnClicked( -1 ) 43 , m_btnClicked( -1 )
43{ 44{
44 setCaption( caption ); 45 setCaption( caption );
45 46
46 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); 47 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 );
47 QLabel *label = new QLabel( text, this ); 48 QLabel *label = new QLabel( text, this );
48 label->setAlignment( AlignCenter | WordBreak ); 49 label->setAlignment( AlignCenter | WordBreak );
49 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 50 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
50 51
51 QPushButton *btn = new QPushButton( btn1, this ); 52 QPushButton *btn = new QPushButton( btn1, this );
52 layout->addWidget( btn, 1, 0 ); 53 layout->addWidget( btn, 1, 0 );
53 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); 54 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) );
54 55
55 btn = new QPushButton( btn2, this ); 56 btn = new QPushButton( btn2, this );
56 layout->addWidget( btn, 1, 1 ); 57 layout->addWidget( btn, 1, 1 );
57 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); 58 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) );
58} 59}
59 60
60int PromptDlg::display() 61int PromptDlg::display()
61{ 62{
62 // Determine position of dialog. Derived from QT's QDialog::show() method. 63 // Determine position of dialog. Derived from QT's QDialog::show() method.
63 QWidget *w = parentWidget(); 64 QWidget *w = parentWidget();
64 QPoint p( 0, 0 ); 65 QPoint p( 0, 0 );
65 int extraw = 0, extrah = 0; 66 int extraw = 0, extrah = 0;
66 QWidget * desk = QApplication::desktop(); 67 QWidget * desk = QApplication::desktop();
67 if ( w ) 68 if ( w )
68 w = w->topLevelWidget(); 69 w = w->topLevelWidget();
69 70
70 QWidgetList *list = QApplication::topLevelWidgets(); 71 QWidgetList *list = QApplication::topLevelWidgets();
71 QWidgetListIt it( *list ); 72 QWidgetListIt it( *list );
72 while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) 73 while ( (extraw == 0 || extrah == 0) && it.current() != 0 )
73 { 74 {
74 int w, h; 75 int w, h;
75 QWidget * current = it.current(); 76 QWidget * current = it.current();
diff --git a/noncore/settings/packagemanager/promptdlg.h b/noncore/settings/packagemanager/promptdlg.h
index f7bc0c0..9f870fa 100644
--- a/noncore/settings/packagemanager/promptdlg.h
+++ b/noncore/settings/packagemanager/promptdlg.h
@@ -1,59 +1,60 @@
1/* 1/*
2 This file is part of the OPIE Project 2                 This file is part of the Opie Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
5 .=l. 5 =.
6 .>+-= 6 .=l.
7_;:, .> :=|. This file is free software; you can 7           .>+-=
8.> <`_, > . <= redistribute it and/or modify it under 8 _;:,     .>    :=|. This program is free software; you can
9:`=1 )Y*s>-.-- : the terms of the GNU General Public 9.> <`_,   >  .   <= redistribute it and/or modify it under
10.="- .-=="i, .._ License as published by the Free Software 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11- . .-<_> .<> Foundation; either version 2 of the License, 11.="- .-=="i,     .._ License as published by the Free Software
12 ._= =} : or (at your option) any later version. 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13 .%`+i> _;_. 13     ._= =}       : or (at your option) any later version.
14 .i_,=:_. -<s. This file is distributed in the hope that 14    .%`+i>       _;_.
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15    .i_,=:_.      -<s. This program is distributed in the hope that
16 : .. .:, . . . without even the implied warranty of 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 : ..    .:,     . . . without even the implied warranty of
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19..}^=.= = ; Public License for more details. 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20++= -. .` .: 20..}^=.=       =       ; Library General Public License for more
21: = ...= . :.=- You should have received a copy of the GNU 21++=   -.     .`     .: details.
22-. .:....=;==+<; General Public License along with this file; 22:     =  ...= . :.=-
23 -_. . . )=. = see the file COPYING. If not, write to the 23 -.   .:....=;==+<; You should have received a copy of the GNU
24 -- :-=` Free Software Foundation, Inc., 24  -_. . .   )=.  = Library General Public License along with
25 59 Temple Place - Suite 330, 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30#ifndef PROMPTDLG_H 31#ifndef PROMPTDLG_H
31#define PROMPTDLG_H 32#define PROMPTDLG_H
32 33
33#include <qwidget.h> 34#include <qwidget.h>
34 35
35class PromptDlg : public QWidget 36class PromptDlg : public QWidget
36{ 37{
37 Q_OBJECT 38 Q_OBJECT
38 39
39public: 40public:
40 PromptDlg( const QString &caption = QString::null, const QString &text = QString::null, 41 PromptDlg( const QString &caption = QString::null, const QString &text = QString::null,
41 const QString &btn1 = QString::null, const QString &btn2 = QString::null, 42 const QString &btn1 = QString::null, const QString &btn2 = QString::null,
42 QWidget *parent = 0x0 ); 43 QWidget *parent = 0x0 );
43 44
44 int display(); 45 int display();
45 int btnPressed() { return m_btnClicked; } 46 int btnPressed() { return m_btnClicked; }
46 47
47 static int ask( const QString &caption = QString::null, const QString &text = QString::null, 48 static int ask( const QString &caption = QString::null, const QString &text = QString::null,
48 const QString &btn1 = QString::null, const QString &btn2 = QString::null, 49 const QString &btn1 = QString::null, const QString &btn2 = QString::null,
49 QWidget *parent = 0x0 ); 50 QWidget *parent = 0x0 );
50 51
51private: 52private:
52 int m_btnClicked; // Indicator for which button was pressed 53 int m_btnClicked; // Indicator for which button was pressed
53 54
54private slots: 55private slots:
55 void slotBtn1Clicked(); 56 void slotBtn1Clicked();
56 void slotBtn2Clicked(); 57 void slotBtn2Clicked();
57}; 58};
58 59
59#endif 60#endif