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,107 +1,108 @@ | |||
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 | ||
42 | EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) | 43 | EntryDlg::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 | ||
67 | void EntryDlg::setText( const QString &text ) | 68 | void 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 | ||
73 | QString EntryDlg::getText() | 74 | QString EntryDlg::getText() |
74 | { | 75 | { |
75 | return m_entry->text(); | 76 | return m_entry->text(); |
76 | } | 77 | } |
77 | 78 | ||
78 | QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, | 79 | QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, |
79 | QWidget *parent, const char *name ) | 80 | QWidget *parent, const char *name ) |
80 | { | 81 | { |
81 | EntryDlg *dlg = new EntryDlg( label, parent, name, true ); | 82 | EntryDlg *dlg = new EntryDlg( label, parent, name, true ); |
82 | dlg->setCaption( caption ); | 83 | dlg->setCaption( caption ); |
83 | dlg->setText( text ); | 84 | dlg->setText( text ); |
84 | 85 | ||
85 | QString result; | 86 | QString result; |
86 | 87 | ||
87 | *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted ); | 88 | *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted ); |
88 | if ( *ok ) | 89 | if ( *ok ) |
89 | result = dlg->getText(); | 90 | result = dlg->getText(); |
90 | 91 | ||
91 | delete dlg; | 92 | delete dlg; |
92 | return result; | 93 | return result; |
93 | } | 94 | } |
94 | void EntryDlg::slotTryAccept() | 95 | void EntryDlg::slotTryAccept() |
95 | { | 96 | { |
96 | if ( !m_entry->text().isEmpty() ) | 97 | if ( !m_entry->text().isEmpty() ) |
97 | accept(); | 98 | accept(); |
98 | } | 99 | } |
99 | 100 | ||
100 | void EntryDlg::slotSelectPath() | 101 | void EntryDlg::slotSelectPath() |
101 | { | 102 | { |
102 | QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_entry->text() ); | 103 | QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_entry->text() ); |
103 | if ( path.at( path.length() - 1 ) == '/' ) | 104 | if ( path.at( path.length() - 1 ) == '/' ) |
104 | path.truncate( path.length() - 1 ); | 105 | path.truncate( path.length() - 1 ); |
105 | if ( !path.isNull() ) | 106 | if ( !path.isNull() ) |
106 | m_entry->setText( path ); | 107 | m_entry->setText( path ); |
107 | } | 108 | } |
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 | ||
35 | class QLineEdit; | 36 | class QLineEdit; |
36 | 37 | ||
37 | class EntryDlg : public QDialog | 38 | class EntryDlg : public QDialog |
38 | { | 39 | { |
39 | Q_OBJECT | 40 | Q_OBJECT |
40 | 41 | ||
41 | public: | 42 | public: |
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 | ||
50 | private slots: | 51 | private slots: |
51 | void slotTryAccept(); | 52 | void slotTryAccept(); |
52 | void slotSelectPath(); | 53 | void slotSelectPath(); |
53 | 54 | ||
54 | private: | 55 | private: |
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,123 +1,124 @@ | |||
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 | ||
34 | FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, | 35 | FilterDlg::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." ) ); |
76 | connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); | 77 | connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); |
77 | m_status = new QComboBox( container ); | 78 | m_status = new QComboBox( container ); |
78 | QWhatsThis::add( m_status, tr( "Select the package status to filter by here." ) ); | 79 | QWhatsThis::add( m_status, tr( "Select the package status to filter by here." ) ); |
79 | connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) ); | 80 | connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) ); |
80 | QString currStatus; | 81 | QString currStatus; |
81 | switch ( status ) | 82 | switch ( status ) |
82 | { | 83 | { |
83 | case OPackageManager::All : currStatus = tr( "All" ); | 84 | case OPackageManager::All : currStatus = tr( "All" ); |
84 | break; | 85 | break; |
85 | case OPackageManager::Installed : currStatus = tr( "Installed" ); | 86 | case OPackageManager::Installed : currStatus = tr( "Installed" ); |
86 | break; | 87 | break; |
87 | case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); | 88 | case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); |
88 | break; | 89 | break; |
89 | case OPackageManager::Updated : currStatus = tr( "Updated" ); | 90 | case OPackageManager::Updated : currStatus = tr( "Updated" ); |
90 | break; | 91 | break; |
91 | default : currStatus = QString::null; | 92 | default : currStatus = QString::null; |
92 | }; | 93 | }; |
93 | m_status->insertItem( tr( "All" ) ); | 94 | m_status->insertItem( tr( "All" ) ); |
94 | m_status->insertItem( tr( "Installed" ) ); | 95 | m_status->insertItem( tr( "Installed" ) ); |
95 | m_status->insertItem( tr( "Not installed" ) ); | 96 | m_status->insertItem( tr( "Not installed" ) ); |
96 | m_status->insertItem( tr( "Updated" ) ); | 97 | m_status->insertItem( tr( "Updated" ) ); |
97 | initItem( m_status, m_statusCB, currStatus ); | 98 | initItem( m_status, m_statusCB, currStatus ); |
98 | layout->addWidget( m_statusCB ); | 99 | layout->addWidget( m_statusCB ); |
99 | layout->addWidget( m_status ); | 100 | layout->addWidget( m_status ); |
100 | 101 | ||
101 | // Server | 102 | // Server |
102 | m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); | 103 | m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); |
103 | QWhatsThis::add( m_serverCB, tr( "Tap here to filter package list by source server." ) ); | 104 | QWhatsThis::add( m_serverCB, tr( "Tap here to filter package list by source server." ) ); |
104 | connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); | 105 | connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); |
105 | m_server = new QComboBox( container ); | 106 | m_server = new QComboBox( container ); |
106 | QWhatsThis::add( m_server, tr( "Select the source server to filter by here." ) ); | 107 | QWhatsThis::add( m_server, tr( "Select the source server to filter by here." ) ); |
107 | m_server->insertStringList( pm->servers() ); | 108 | m_server->insertStringList( pm->servers() ); |
108 | initItem( m_server, m_serverCB, server ); | 109 | initItem( m_server, m_serverCB, server ); |
109 | layout->addWidget( m_serverCB ); | 110 | layout->addWidget( m_serverCB ); |
110 | layout->addWidget( m_server ); | 111 | layout->addWidget( m_server ); |
111 | 112 | ||
112 | // Destination | 113 | // Destination |
113 | m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); | 114 | m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); |
114 | QWhatsThis::add( m_destCB, tr( "Tap here to filter package list by destination where the package is installed to on this device." ) ); | 115 | QWhatsThis::add( m_destCB, tr( "Tap here to filter package list by destination where the package is installed to on this device." ) ); |
115 | connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); | 116 | connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); |
116 | m_destination = new QComboBox( container ); | 117 | m_destination = new QComboBox( container ); |
117 | QWhatsThis::add( m_destination, tr( "Select the destination location to filter by here." ) ); | 118 | QWhatsThis::add( m_destination, tr( "Select the destination location to filter by here." ) ); |
118 | m_destination->insertStringList( pm->destinations() ); | 119 | m_destination->insertStringList( pm->destinations() ); |
119 | initItem( m_destination, m_destCB, destination ); | 120 | initItem( m_destination, m_destCB, destination ); |
120 | layout->addWidget( m_destCB ); | 121 | layout->addWidget( m_destCB ); |
121 | layout->addWidget( m_destination ); | 122 | layout->addWidget( m_destination ); |
122 | } | 123 | } |
123 | 124 | ||
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,101 +1,102 @@ | |||
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 | ||
42 | class FilterDlg : public QDialog | 43 | class FilterDlg : public QDialog |
43 | { | 44 | { |
44 | Q_OBJECT | 45 | Q_OBJECT |
45 | 46 | ||
46 | public: | 47 | public: |
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; }; |
76 | 77 | ||
77 | private: | 78 | private: |
78 | QCheckBox *m_nameCB; | 79 | QCheckBox *m_nameCB; |
79 | QCheckBox *m_serverCB; | 80 | QCheckBox *m_serverCB; |
80 | QCheckBox *m_destCB; | 81 | QCheckBox *m_destCB; |
81 | QCheckBox *m_statusCB; | 82 | QCheckBox *m_statusCB; |
82 | QCheckBox *m_categoryCB; | 83 | QCheckBox *m_categoryCB; |
83 | 84 | ||
84 | QLineEdit *m_name; | 85 | QLineEdit *m_name; |
85 | QComboBox *m_server; | 86 | QComboBox *m_server; |
86 | QComboBox *m_destination; | 87 | QComboBox *m_destination; |
87 | QComboBox *m_status; | 88 | QComboBox *m_status; |
88 | QComboBox *m_category; | 89 | QComboBox *m_category; |
89 | 90 | ||
90 | void initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ); | 91 | void initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ); |
91 | 92 | ||
92 | private slots: | 93 | private slots: |
93 | void slotNameSelected( bool ); | 94 | void slotNameSelected( bool ); |
94 | void slotServerSelected( bool ); | 95 | void slotServerSelected( bool ); |
95 | void slotDestSelected( bool ); | 96 | void slotDestSelected( bool ); |
96 | void slotStatusSelected( bool ); | 97 | void slotStatusSelected( bool ); |
97 | void slotStatusChanged( const QString & ); | 98 | void slotStatusChanged( const QString & ); |
98 | void slotCategorySelected( bool ); | 99 | void slotCategorySelected( bool ); |
99 | }; | 100 | }; |
100 | 101 | ||
101 | #endif | 102 | #endif |
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,123 +1,124 @@ | |||
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 | ||
52 | InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, | 53 | InstallDlg::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; |
76 | m_packages[ m_numCommands ] = packages2; | 77 | m_packages[ m_numCommands ] = packages2; |
77 | ++m_numCommands; | 78 | ++m_numCommands; |
78 | 79 | ||
79 | if ( command2 == OPackage::Install ) | 80 | if ( command2 == OPackage::Install ) |
80 | m_installFound = true; | 81 | m_installFound = true; |
81 | } | 82 | } |
82 | if ( command3 != OPackage::NotDefined ) | 83 | if ( command3 != OPackage::NotDefined ) |
83 | { | 84 | { |
84 | m_command[ m_numCommands ] = command3; | 85 | m_command[ m_numCommands ] = command3; |
85 | m_packages[ m_numCommands ] = packages3; | 86 | m_packages[ m_numCommands ] = packages3; |
86 | ++m_numCommands; | 87 | ++m_numCommands; |
87 | 88 | ||
88 | if ( command3 == OPackage::Install ) | 89 | if ( command3 == OPackage::Install ) |
89 | m_installFound = true; | 90 | m_installFound = true; |
90 | } | 91 | } |
91 | 92 | ||
92 | // Initialize UI | 93 | // Initialize UI |
93 | if ( parent ) | 94 | if ( parent ) |
94 | parent->setCaption( caption ); | 95 | parent->setCaption( caption ); |
95 | 96 | ||
96 | QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); | 97 | QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); |
97 | 98 | ||
98 | if ( m_installFound ) | 99 | if ( m_installFound ) |
99 | { | 100 | { |
100 | QLabel *label = new QLabel( tr( "Destination" ), this ); | 101 | QLabel *label = new QLabel( tr( "Destination" ), this ); |
101 | layout->addWidget( label, 0, 0 ); | 102 | layout->addWidget( label, 0, 0 ); |
102 | m_destination = new QComboBox( this ); | 103 | m_destination = new QComboBox( this ); |
103 | m_destination->insertStringList( m_packman->destinations() ); | 104 | m_destination->insertStringList( m_packman->destinations() ); |
104 | layout->addWidget( m_destination, 0, 1 ); | 105 | layout->addWidget( m_destination, 0, 1 ); |
105 | connect( m_destination, SIGNAL(highlighted(const QString&)), | 106 | connect( m_destination, SIGNAL(highlighted(const QString&)), |
106 | this, SLOT(slotDisplayAvailSpace(const QString&)) ); | 107 | this, SLOT(slotDisplayAvailSpace(const QString&)) ); |
107 | 108 | ||
108 | label = new QLabel( tr( "Space Avail" ), this ); | 109 | label = new QLabel( tr( "Space Avail" ), this ); |
109 | layout->addWidget( label, 1, 0 ); | 110 | layout->addWidget( label, 1, 0 ); |
110 | m_availSpace = new QLabel( this ); | 111 | m_availSpace = new QLabel( this ); |
111 | layout->addWidget( m_availSpace, 1, 1 ); | 112 | layout->addWidget( m_availSpace, 1, 1 ); |
112 | 113 | ||
113 | // TODO - select correct destination | 114 | // TODO - select correct destination |
114 | slotDisplayAvailSpace( m_destination->currentText() ); | 115 | slotDisplayAvailSpace( m_destination->currentText() ); |
115 | } | 116 | } |
116 | else | 117 | else |
117 | { | 118 | { |
118 | m_destination = 0l; | 119 | m_destination = 0l; |
119 | m_availSpace = 0l; | 120 | m_availSpace = 0l; |
120 | } | 121 | } |
121 | 122 | ||
122 | QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); | 123 | QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); |
123 | groupBox->layout()->setSpacing( 0 ); | 124 | groupBox->layout()->setSpacing( 0 ); |
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,92 +1,93 @@ | |||
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 | ||
37 | class QComboBox; | 38 | class QComboBox; |
38 | class QLabel; | 39 | class QLabel; |
39 | class QMultiLineEdit; | 40 | class QMultiLineEdit; |
40 | class QPushButton; | 41 | class QPushButton; |
41 | 42 | ||
42 | class OConfItem; | 43 | class OConfItem; |
43 | class OPackageManager; | 44 | class OPackageManager; |
44 | 45 | ||
45 | class InstallDlg : public QWidget | 46 | class InstallDlg : public QWidget |
46 | { | 47 | { |
47 | Q_OBJECT | 48 | Q_OBJECT |
48 | 49 | ||
49 | public: | 50 | public: |
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 | ||
59 | private: | 60 | private: |
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 |
76 | QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) | 77 | QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) |
77 | OConfItem *m_destItem; // Pointer to destination for package installation | 78 | OConfItem *m_destItem; // Pointer to destination for package installation |
78 | 79 | ||
79 | private slots: | 80 | private slots: |
80 | // UI control slots | 81 | // UI control slots |
81 | void slotDisplayAvailSpace( const QString &destination ); | 82 | void slotDisplayAvailSpace( const QString &destination ); |
82 | void slotBtnStart(); | 83 | void slotBtnStart(); |
83 | void slotBtnOptions(); | 84 | void slotBtnOptions(); |
84 | 85 | ||
85 | // Execution slots | 86 | // Execution slots |
86 | void slotOutput( const QString &msg ); | 87 | void slotOutput( const QString &msg ); |
87 | 88 | ||
88 | signals: | 89 | signals: |
89 | void closeInstallDlg(); | 90 | void closeInstallDlg(); |
90 | }; | 91 | }; |
91 | 92 | ||
92 | #endif | 93 | #endif |
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 | ||
34 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) | 35 | OPIE_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,123 +1,124 @@ | |||
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 | ||
54 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) | 55 | MainWindow::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 | { |
76 | // setCaption( tr( "Package Manager" ) ); | 77 | // setCaption( tr( "Package Manager" ) ); |
77 | 78 | ||
78 | m_iconNull.fill( colorGroup().base() ); | 79 | m_iconNull.fill( colorGroup().base() ); |
79 | 80 | ||
80 | connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) ); | 81 | connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) ); |
81 | 82 | ||
82 | // Initialize widget stack, package list and status widget | 83 | // Initialize widget stack, package list and status widget |
83 | initStatusWidget(); | 84 | initStatusWidget(); |
84 | initPackageList(); | 85 | initPackageList(); |
85 | 86 | ||
86 | m_widgetStack.addWidget( &m_statusWidget, 2 ); | 87 | m_widgetStack.addWidget( &m_statusWidget, 2 ); |
87 | m_widgetStack.addWidget( &m_packageList, 1 ); | 88 | m_widgetStack.addWidget( &m_packageList, 1 ); |
88 | setCentralWidget( &m_widgetStack ); | 89 | setCentralWidget( &m_widgetStack ); |
89 | 90 | ||
90 | // Initialize remaining user interface items | 91 | // Initialize remaining user interface items |
91 | initUI(); | 92 | initUI(); |
92 | 93 | ||
93 | // Initialize package information | 94 | // Initialize package information |
94 | QTimer::singleShot( -1, this, SLOT( initPackageInfo() ) ); | 95 | QTimer::singleShot( -1, this, SLOT( initPackageInfo() ) ); |
95 | } | 96 | } |
96 | 97 | ||
97 | void MainWindow::closeEvent( QCloseEvent *event ) | 98 | void MainWindow::closeEvent( QCloseEvent *event ) |
98 | { | 99 | { |
99 | // Close app only if either the package or status widgets are currently active | 100 | // Close app only if either the package or status widgets are currently active |
100 | bool close = m_widgetStack.visibleWidget() == &m_packageList || | 101 | bool close = m_widgetStack.visibleWidget() == &m_packageList || |
101 | m_widgetStack.visibleWidget() == &m_statusWidget; | 102 | m_widgetStack.visibleWidget() == &m_statusWidget; |
102 | if ( close ) | 103 | if ( close ) |
103 | { | 104 | { |
104 | // TODO - write out application configuration settings | 105 | // TODO - write out application configuration settings |
105 | 106 | ||
106 | // Write out package manager configuration settings | 107 | // Write out package manager configuration settings |
107 | m_packman.saveSettings(); | 108 | m_packman.saveSettings(); |
108 | event->accept(); | 109 | event->accept(); |
109 | } | 110 | } |
110 | else | 111 | else |
111 | { | 112 | { |
112 | delete m_widgetStack.visibleWidget(); | 113 | delete m_widgetStack.visibleWidget(); |
113 | m_widgetStack.raiseWidget( &m_packageList ); | 114 | m_widgetStack.raiseWidget( &m_packageList ); |
114 | event->ignore(); | 115 | event->ignore(); |
115 | } | 116 | } |
116 | } | 117 | } |
117 | 118 | ||
118 | void MainWindow::initPackageList() | 119 | void MainWindow::initPackageList() |
119 | { | 120 | { |
120 | m_packageList.addColumn( tr( "Packages" ) ); | 121 | m_packageList.addColumn( tr( "Packages" ) ); |
121 | QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nTap inside the box at the left to select a package. Tap and hold to view package details." ) ); | 122 | QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nTap inside the box at the left to select a package. Tap and hold to view package details." ) ); |
122 | QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); | 123 | QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); |
123 | connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), | 124 | connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), |
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,123 +1,124 @@ | |||
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 | ||
45 | class QAction; | 46 | class QAction; |
46 | class QLineEdit; | 47 | class QLineEdit; |
47 | 48 | ||
48 | class MainWindow :public QMainWindow | 49 | class MainWindow :public QMainWindow |
49 | { | 50 | { |
50 | Q_OBJECT | 51 | Q_OBJECT |
51 | 52 | ||
52 | public: | 53 | public: |
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 | ||
56 | protected: | 57 | protected: |
57 | void closeEvent( QCloseEvent *event ); | 58 | void closeEvent( QCloseEvent *event ); |
58 | 59 | ||
59 | private: | 60 | private: |
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 |
76 | QLabel m_statusText; // Text status message | 77 | QLabel m_statusText; // Text status message |
77 | QProgressBar m_statusBar; // Progress bar showing % completed | 78 | QProgressBar m_statusBar; // Progress bar showing % completed |
78 | 79 | ||
79 | // Icon pixmaps | 80 | // Icon pixmaps |
80 | QPixmap m_iconUpdated; // Cached icon which shows when package can be updated | 81 | QPixmap m_iconUpdated; // Cached icon which shows when package can be updated |
81 | QPixmap m_iconInstalled; // Cached icon which shows when package is installed | 82 | QPixmap m_iconInstalled; // Cached icon which shows when package is installed |
82 | QPixmap m_iconNull; // Cached icon which shows when package is not installed | 83 | QPixmap m_iconNull; // Cached icon which shows when package is not installed |
83 | 84 | ||
84 | // Menu/tool bar actions | 85 | // Menu/tool bar actions |
85 | QAction *m_actionShowNotInstalled; // Action to show pakages not currently installed | 86 | QAction *m_actionShowNotInstalled; // Action to show pakages not currently installed |
86 | QAction *m_actionShowInstalled; // Action to show pakages currently installed | 87 | QAction *m_actionShowInstalled; // Action to show pakages currently installed |
87 | QAction *m_actionShowUpdated; // Action to show pakages currently installed with update available | 88 | QAction *m_actionShowUpdated; // Action to show pakages currently installed with update available |
88 | QAction *m_actionFilter; // Action to filter packages | 89 | QAction *m_actionFilter; // Action to filter packages |
89 | QAction *m_actionFindNext; // Action to find next match | 90 | QAction *m_actionFindNext; // Action to find next match |
90 | 91 | ||
91 | // Cached filter settings | 92 | // Cached filter settings |
92 | QString m_filterName; // Cached name filter value | 93 | QString m_filterName; // Cached name filter value |
93 | QString m_filterServer; // Cached server name filter value | 94 | QString m_filterServer; // Cached server name filter value |
94 | QString m_filterDest; // Cached destination name filter value | 95 | QString m_filterDest; // Cached destination name filter value |
95 | OPackageManager::Status m_filterStatus; // Cached status filter value | 96 | OPackageManager::Status m_filterStatus; // Cached status filter value |
96 | QString m_filterCategory; // Cached category filter value | 97 | QString m_filterCategory; // Cached category filter value |
97 | 98 | ||
98 | void initPackageList(); | 99 | void initPackageList(); |
99 | void initStatusWidget(); | 100 | void initStatusWidget(); |
100 | void initUI(); | 101 | void initUI(); |
101 | 102 | ||
102 | void loadPackageList( OPackageList *packages = 0x0, bool clearList = true ); | 103 | void loadPackageList( OPackageList *packages = 0x0, bool clearList = true ); |
103 | void searchForPackage( const QString &text ); | 104 | void searchForPackage( const QString &text ); |
104 | void installLocalPackage( const QString &ipkFile ); | 105 | void installLocalPackage( const QString &ipkFile ); |
105 | 106 | ||
106 | private slots: | 107 | private slots: |
107 | void setDocument( const QString &ipkFile ); | 108 | void setDocument( const QString &ipkFile ); |
108 | 109 | ||
109 | void initPackageInfo(); | 110 | void initPackageInfo(); |
110 | void slotWidgetStackShow( QWidget *widget ); | 111 | void slotWidgetStackShow( QWidget *widget ); |
111 | 112 | ||
112 | // Status widget slots | 113 | // Status widget slots |
113 | void slotInitStatusBar( int numSteps ); | 114 | void slotInitStatusBar( int numSteps ); |
114 | void slotStatusText( const QString &status ); | 115 | void slotStatusText( const QString &status ); |
115 | void slotStatusBar( int currStep ); | 116 | void slotStatusBar( int currStep ); |
116 | 117 | ||
117 | // Actions menu action slots | 118 | // Actions menu action slots |
118 | void slotUpdate(); | 119 | void slotUpdate(); |
119 | void slotUpgrade(); | 120 | void slotUpgrade(); |
120 | void slotDownload(); | 121 | void slotDownload(); |
121 | void slotApply(); | 122 | void slotApply(); |
122 | void slotInstallLocal(); | 123 | void slotInstallLocal(); |
123 | void slotCloseDlg(); | 124 | void slotCloseDlg(); |
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 | ||
34 | OConfItem::OConfItem( Type type, const QString &name, const QString &value, | 33 | OConfItem::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,96 +1,95 @@ | |||
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 | ||
38 | class OConfItem | 37 | class OConfItem |
39 | { | 38 | { |
40 | public: | 39 | public: |
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 | ||
59 | private: | 58 | private: |
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 | ||
67 | class OConfItemList : public QList<OConfItem> | 66 | class OConfItemList : public QList<OConfItem> |
68 | { | 67 | { |
69 | private: | 68 | private: |
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; |
78 | else if ( type1 == type2 ) | 77 | else if ( type1 == type2 ) |
79 | { | 78 | { |
80 | QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); | 79 | QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); |
81 | QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); | 80 | QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); |
82 | if ( name1 < name2 ) | 81 | if ( name1 < name2 ) |
83 | return -1; | 82 | return -1; |
84 | else if ( name1 == name2 ) | 83 | else if ( name1 == name2 ) |
85 | return 0; | 84 | return 0; |
86 | else /*if ( name1 > name2 )*/ | 85 | else /*if ( name1 > name2 )*/ |
87 | return 1; | 86 | return 1; |
88 | } | 87 | } |
89 | else /*if ( type1 > type2 )*/ | 88 | else /*if ( type1 > type2 )*/ |
90 | return 1; | 89 | return 1; |
91 | } | 90 | } |
92 | }; | 91 | }; |
93 | 92 | ||
94 | typedef QListIterator<OConfItem> OConfItemListIterator; | 93 | typedef QListIterator<OConfItem> OConfItemListIterator; |
95 | 94 | ||
96 | #endif | 95 | #endif |
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,125 +1,124 @@ | |||
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 | ||
41 | extern "C" { | 40 | extern "C" { |
42 | #include <libipkg.h> | 41 | #include <libipkg.h> |
43 | }; | 42 | }; |
44 | args_t m_ipkgArgs; // libipkg configuration arguments | 43 | args_t m_ipkgArgs; // libipkg configuration arguments |
45 | 44 | ||
46 | const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file | 45 | const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file |
47 | const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files | 46 | const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files |
48 | const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists | 47 | const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists |
49 | const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location | 48 | const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location |
50 | const QString IPKG_INFO_PATH = "usr/lib/ipkg/info"; // Package file lists location | 49 | const QString IPKG_INFO_PATH = "usr/lib/ipkg/info"; // Package file lists location |
51 | 50 | ||
52 | OIpkg *oipkg; | 51 | OIpkg *oipkg; |
53 | 52 | ||
54 | // Ipkg callback functions | 53 | // Ipkg callback functions |
55 | 54 | ||
56 | int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg ) | 55 | int 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 | ||
67 | char *fIpkgResponse( char */*question*/ ) | 66 | char *fIpkgResponse( char */*question*/ ) |
68 | { | 67 | { |
69 | return 0l; | 68 | return 0l; |
70 | } | 69 | } |
71 | 70 | ||
72 | int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ ) | 71 | int 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 | ||
78 | int fIpkgFiles( char */*name*/, char *desc, char */*version*/, pkg_state_status_t /*status*/, | 77 | int fIpkgFiles( char */*name*/, char *desc, char */*version*/, pkg_state_status_t /*status*/, |
79 | void */*userdata*/ ) | 78 | void */*userdata*/ ) |
80 | { | 79 | { |
81 | oipkg->ipkgList( desc ); | 80 | oipkg->ipkgList( desc ); |
82 | return 0; | 81 | return 0; |
83 | } | 82 | } |
84 | 83 | ||
85 | OIpkg::OIpkg( Config *config, QObject *parent, const char *name ) | 84 | OIpkg::OIpkg( Config *config, QObject *parent, const char *name ) |
86 | : QObject( parent, name ) | 85 | : QObject( parent, name ) |
87 | , m_config( config ) | 86 | , m_config( config ) |
88 | , m_confInfo( NULL ) | 87 | , m_confInfo( NULL ) |
89 | , m_ipkgExecOptions( 0 ) | 88 | , m_ipkgExecOptions( 0 ) |
90 | , m_ipkgExecVerbosity( 1 ) | 89 | , m_ipkgExecVerbosity( 1 ) |
91 | { | 90 | { |
92 | // Keep pointer to self for the Ipkg callback functions | 91 | // Keep pointer to self for the Ipkg callback functions |
93 | oipkg = this; | 92 | oipkg = this; |
94 | 93 | ||
95 | // Initialize libipkg | 94 | // Initialize libipkg |
96 | ipkg_init( &fsignalIpkgMessage, &fIpkgResponse, &m_ipkgArgs ); | 95 | ipkg_init( &fsignalIpkgMessage, &fIpkgResponse, &m_ipkgArgs ); |
97 | 96 | ||
98 | // Default ipkg run-time arguments | 97 | // Default ipkg run-time arguments |
99 | m_ipkgArgs.noaction = false; | 98 | m_ipkgArgs.noaction = false; |
100 | m_ipkgArgs.force_defaults = true; | 99 | m_ipkgArgs.force_defaults = true; |
101 | } | 100 | } |
102 | 101 | ||
103 | OIpkg::~OIpkg() | 102 | OIpkg::~OIpkg() |
104 | { | 103 | { |
105 | // Upon destruction, ensure that items in config list are deleted with list | 104 | // Upon destruction, ensure that items in config list are deleted with list |
106 | if ( m_confInfo ) | 105 | if ( m_confInfo ) |
107 | m_confInfo->setAutoDelete( true ); | 106 | m_confInfo->setAutoDelete( true ); |
108 | 107 | ||
109 | // Free up libipkg resources | 108 | // Free up libipkg resources |
110 | ipkg_deinit( &m_ipkgArgs ); | 109 | ipkg_deinit( &m_ipkgArgs ); |
111 | } | 110 | } |
112 | 111 | ||
113 | OConfItemList *OIpkg::configItems() | 112 | OConfItemList *OIpkg::configItems() |
114 | { | 113 | { |
115 | // Retrieve all configuration items | 114 | // Retrieve all configuration items |
116 | return filterConfItems(); | 115 | return filterConfItems(); |
117 | } | 116 | } |
118 | 117 | ||
119 | OConfItemList *OIpkg::servers() | 118 | OConfItemList *OIpkg::servers() |
120 | { | 119 | { |
121 | // Retrieve only servers | 120 | // Retrieve only servers |
122 | return filterConfItems( OConfItem::Source ); | 121 | return filterConfItems( OConfItem::Source ); |
123 | } | 122 | } |
124 | 123 | ||
125 | OConfItemList *OIpkg::destinations() | 124 | OConfItemList *OIpkg::destinations() |
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,111 +1,110 @@ | |||
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 | ||
48 | class OConfItemList; | 47 | class OConfItemList; |
49 | 48 | ||
50 | class OIpkg : public QObject | 49 | class OIpkg : public QObject |
51 | { | 50 | { |
52 | Q_OBJECT | 51 | Q_OBJECT |
53 | 52 | ||
54 | public: | 53 | public: |
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 ); |
78 | 77 | ||
79 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, | 78 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, |
80 | const QStringList ¶meters = QStringList(), | 79 | const QStringList ¶meters = QStringList(), |
81 | const QString &destination = QString::null, | 80 | const QString &destination = QString::null, |
82 | const QObject *receiver = 0l, | 81 | const QObject *receiver = 0l, |
83 | const char *slotOutput = 0l, | 82 | const char *slotOutput = 0l, |
84 | bool rawOutput = true ); | 83 | bool rawOutput = true ); |
85 | void abortCommand(); | 84 | void abortCommand(); |
86 | 85 | ||
87 | void ipkgMessage( char *msg ); | 86 | void ipkgMessage( char *msg ); |
88 | void ipkgStatus( char *status ); | 87 | void ipkgStatus( char *status ); |
89 | void ipkgList( char *filelist ); | 88 | void ipkgList( char *filelist ); |
90 | 89 | ||
91 | private: | 90 | private: |
92 | Config *m_config; // Pointer to application configuration file | 91 | Config *m_config; // Pointer to application configuration file |
93 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files | 92 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files |
94 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options | 93 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options |
95 | int m_ipkgExecVerbosity; // Ipkg execution verbosity level | 94 | int m_ipkgExecVerbosity; // Ipkg execution verbosity level |
96 | QString m_rootPath; // Directory path where the 'root' destination is located | 95 | QString m_rootPath; // Directory path where the 'root' destination is located |
97 | 96 | ||
98 | void loadConfiguration(); | 97 | void loadConfiguration(); |
99 | OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); | 98 | OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); |
100 | const QString &rootPath(); | 99 | const QString &rootPath(); |
101 | void linkPackageDir( const QString &dest = QString::null ); | 100 | void linkPackageDir( const QString &dest = QString::null ); |
102 | void unlinkPackage( const QString &package = QString::null, | 101 | void unlinkPackage( const QString &package = QString::null, |
103 | OConfItemList *destList = 0l ); | 102 | OConfItemList *destList = 0l ); |
104 | 103 | ||
105 | signals: | 104 | signals: |
106 | void signalIpkgMessage( const QString &msg ); | 105 | void signalIpkgMessage( const QString &msg ); |
107 | void signalIpkgStatus( const QString &status ); | 106 | void signalIpkgStatus( const QString &status ); |
108 | void signalIpkgList( const QString &filelist ); | 107 | void signalIpkgList( const QString &filelist ); |
109 | }; | 108 | }; |
110 | 109 | ||
111 | #endif | 110 | #endif |
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,125 +1,124 @@ | |||
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 | ||
49 | OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) | 48 | OIpkgConfigDlg::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" ) ); |
78 | m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); | 77 | m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); |
79 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); | 78 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); |
80 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 79 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
81 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); | 80 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); |
82 | } | 81 | } |
83 | else | 82 | else |
84 | { | 83 | { |
85 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 84 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
86 | } | 85 | } |
87 | } | 86 | } |
88 | 87 | ||
89 | void OIpkgConfigDlg::accept() | 88 | void OIpkgConfigDlg::accept() |
90 | { | 89 | { |
91 | // Save server, destination and proxy configuration | 90 | // Save server, destination and proxy configuration |
92 | if ( !m_installOptions ) | 91 | if ( !m_installOptions ) |
93 | { | 92 | { |
94 | // Update proxy information before saving settings | 93 | // Update proxy information before saving settings |
95 | OConfItem *confItem = m_ipkg->findConfItem( OConfItem::Option, "http_proxy" ); | 94 | OConfItem *confItem = m_ipkg->findConfItem( OConfItem::Option, "http_proxy" ); |
96 | if ( confItem ) | 95 | if ( confItem ) |
97 | { | 96 | { |
98 | confItem->setValue( m_proxyHttpServer->text() ); | 97 | confItem->setValue( m_proxyHttpServer->text() ); |
99 | confItem->setActive( m_proxyHttpActive->isChecked() ); | 98 | confItem->setActive( m_proxyHttpActive->isChecked() ); |
100 | } | 99 | } |
101 | else | 100 | else |
102 | m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", | 101 | m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", |
103 | m_proxyHttpServer->text(), QString::null, | 102 | m_proxyHttpServer->text(), QString::null, |
104 | m_proxyHttpActive->isChecked() ) ); | 103 | m_proxyHttpActive->isChecked() ) ); |
105 | 104 | ||
106 | confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); | 105 | confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); |
107 | if ( confItem ) | 106 | if ( confItem ) |
108 | { | 107 | { |
109 | confItem->setValue( m_proxyFtpServer->text() ); | 108 | confItem->setValue( m_proxyFtpServer->text() ); |
110 | confItem->setActive( m_proxyFtpActive->isChecked() ); | 109 | confItem->setActive( m_proxyFtpActive->isChecked() ); |
111 | } | 110 | } |
112 | else | 111 | else |
113 | m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", | 112 | m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", |
114 | m_proxyFtpServer->text(), QString::null, | 113 | m_proxyFtpServer->text(), QString::null, |
115 | m_proxyFtpActive->isChecked() ) ); | 114 | m_proxyFtpActive->isChecked() ) ); |
116 | 115 | ||
117 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); | 116 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); |
118 | if ( confItem ) | 117 | if ( confItem ) |
119 | confItem->setValue( m_proxyUsername->text() ); | 118 | confItem->setValue( m_proxyUsername->text() ); |
120 | else | 119 | else |
121 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", | 120 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", |
122 | m_proxyUsername->text() ) ); | 121 | m_proxyUsername->text() ) ); |
123 | 122 | ||
124 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); | 123 | confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); |
125 | if ( confItem ) | 124 | if ( confItem ) |
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,128 +1,126 @@ | |||
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 | ||
43 | class QCheckBox; | 41 | class QCheckBox; |
44 | class QComboBox; | 42 | class QComboBox; |
45 | class QLineEdit; | 43 | class QLineEdit; |
46 | class QListBox; | 44 | class QListBox; |
47 | class QPushButton; | 45 | class QPushButton; |
48 | 46 | ||
49 | class OIpkgConfigDlg : public QDialog | 47 | class OIpkgConfigDlg : public QDialog |
50 | { | 48 | { |
51 | Q_OBJECT | 49 | Q_OBJECT |
52 | 50 | ||
53 | public: | 51 | public: |
54 | OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); | 52 | OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); |
55 | 53 | ||
56 | protected slots: | 54 | protected slots: |
57 | void accept(); | 55 | void accept(); |
58 | void reject(); | 56 | void reject(); |
59 | 57 | ||
60 | private: | 58 | private: |
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 |
81 | QPushButton *m_serverDeleteBtn; // Server edit button | 79 | QPushButton *m_serverDeleteBtn; // Server edit button |
82 | 80 | ||
83 | // Destination configuration UI controls | 81 | // Destination configuration UI controls |
84 | QListBox *m_destList; // Destination list selection | 82 | QListBox *m_destList; // Destination list selection |
85 | QPushButton *m_destEditBtn; // Destination edit button | 83 | QPushButton *m_destEditBtn; // Destination edit button |
86 | QPushButton *m_destDeleteBtn; // Destination edit button | 84 | QPushButton *m_destDeleteBtn; // Destination edit button |
87 | 85 | ||
88 | // Proxy server configuration UI controls | 86 | // Proxy server configuration UI controls |
89 | QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box | 87 | QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box |
90 | QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box | 88 | QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box |
91 | QLineEdit *m_proxyFtpServer; // FTP proxy server edit box | 89 | QLineEdit *m_proxyFtpServer; // FTP proxy server edit box |
92 | QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box | 90 | QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box |
93 | QLineEdit *m_proxyUsername; // Proxy server username edit box | 91 | QLineEdit *m_proxyUsername; // Proxy server username edit box |
94 | QLineEdit *m_proxyPassword; // Proxy server password edit box | 92 | QLineEdit *m_proxyPassword; // Proxy server password edit box |
95 | 93 | ||
96 | // Options configuration UI controls | 94 | // Options configuration UI controls |
97 | QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox | 95 | QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox |
98 | QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox | 96 | QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox |
99 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox | 97 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox |
100 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox | 98 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox |
101 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection | 99 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection |
102 | QLineEdit *m_optSourceLists; // Ipkg source lists destination directory | 100 | QLineEdit *m_optSourceLists; // Ipkg source lists destination directory |
103 | 101 | ||
104 | void initServerWidget(); | 102 | void initServerWidget(); |
105 | void initDestinationWidget(); | 103 | void initDestinationWidget(); |
106 | void initProxyWidget(); | 104 | void initProxyWidget(); |
107 | void initOptionsWidget(); | 105 | void initOptionsWidget(); |
108 | 106 | ||
109 | void initData(); | 107 | void initData(); |
110 | 108 | ||
111 | private slots: | 109 | private slots: |
112 | void slotServerSelected( int index ); | 110 | void slotServerSelected( int index ); |
113 | void slotServerNew(); | 111 | void slotServerNew(); |
114 | void slotServerEdit(); | 112 | void slotServerEdit(); |
115 | void slotServerDelete(); | 113 | void slotServerDelete(); |
116 | 114 | ||
117 | void slotDestSelected( int index ); | 115 | void slotDestSelected( int index ); |
118 | void slotDestNew(); | 116 | void slotDestNew(); |
119 | void slotDestEdit(); | 117 | void slotDestEdit(); |
120 | void slotDestDelete(); | 118 | void slotDestDelete(); |
121 | 119 | ||
122 | void slotOptSelectSourceListsPath(); | 120 | void slotOptSelectSourceListsPath(); |
123 | }; | 121 | }; |
124 | 122 | ||
125 | class OIpkgServerDlg : public QDialog | 123 | class OIpkgServerDlg : public QDialog |
126 | { | 124 | { |
127 | Q_OBJECT | 125 | Q_OBJECT |
128 | 126 | ||
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 | ||
34 | OPackage::OPackage( const QString &name, const QString &version, const QString &versionInstalled, | 33 | OPackage::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,81 +1,80 @@ | |||
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 | ||
38 | class OPackage | 37 | class OPackage |
39 | { | 38 | { |
40 | public: | 39 | public: |
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 | ||
67 | private: | 66 | private: |
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 | ||
78 | typedef QList<OPackage> OPackageList; | 77 | typedef QList<OPackage> OPackageList; |
79 | typedef QListIterator<OPackage> OPackageListIterator; | 78 | typedef QListIterator<OPackage> OPackageListIterator; |
80 | 79 | ||
81 | #endif | 80 | #endif |
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,125 +1,124 @@ | |||
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 | ||
39 | OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) | 38 | OPackageManager::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 | ||
49 | void OPackageManager::loadAvailablePackages() | 48 | void 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 | ||
78 | OPackageList *packageList = m_ipkg.availablePackages( server->name() ); | 77 | OPackageList *packageList = m_ipkg.availablePackages( server->name() ); |
79 | if ( packageList ) | 78 | if ( packageList ) |
80 | { | 79 | { |
81 | for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) | 80 | for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) |
82 | { | 81 | { |
83 | OPackage *package = packageIt.current(); | 82 | OPackage *package = packageIt.current(); |
84 | 83 | ||
85 | // Load package info | 84 | // Load package info |
86 | if ( !m_packages.find( package->name() ) ) | 85 | if ( !m_packages.find( package->name() ) ) |
87 | m_packages.insert( package->name(), package ); | 86 | m_packages.insert( package->name(), package ); |
88 | else | 87 | else |
89 | { | 88 | { |
90 | // If new package is newer version, replace existing package | 89 | // If new package is newer version, replace existing package |
91 | OPackage *currPackage = m_packages[package->name()]; | 90 | OPackage *currPackage = m_packages[package->name()]; |
92 | if ( compareVersions( package->version(), currPackage->version() ) == 1 ) | 91 | if ( compareVersions( package->version(), currPackage->version() ) == 1 ) |
93 | m_packages.replace( package->name(), package ); | 92 | m_packages.replace( package->name(), package ); |
94 | } | 93 | } |
95 | 94 | ||
96 | // Add category to list if it doesn't already exist | 95 | // Add category to list if it doesn't already exist |
97 | if ( m_categories.grep( package->category() ).isEmpty() ) | 96 | if ( m_categories.grep( package->category() ).isEmpty() ) |
98 | { | 97 | { |
99 | m_categories << package->category(); | 98 | m_categories << package->category(); |
100 | categoryAdded = true; | 99 | categoryAdded = true; |
101 | } | 100 | } |
102 | } | 101 | } |
103 | } | 102 | } |
104 | } | 103 | } |
105 | } | 104 | } |
106 | delete serverList; | 105 | delete serverList; |
107 | 106 | ||
108 | // Sort category list if categories were added | 107 | // Sort category list if categories were added |
109 | if ( categoryAdded ) | 108 | if ( categoryAdded ) |
110 | m_categories.sort(); | 109 | m_categories.sort(); |
111 | } | 110 | } |
112 | } | 111 | } |
113 | 112 | ||
114 | void OPackageManager::loadInstalledPackages() | 113 | void OPackageManager::loadInstalledPackages() |
115 | { | 114 | { |
116 | OConfItemList *destList = m_ipkg.destinations(); | 115 | OConfItemList *destList = m_ipkg.destinations(); |
117 | 116 | ||
118 | if ( destList ) | 117 | if ( destList ) |
119 | { | 118 | { |
120 | // Initialize status messaging | 119 | // Initialize status messaging |
121 | emit initStatus( destList->count() ); | 120 | emit initStatus( destList->count() ); |
122 | int destCount = 0; | 121 | int destCount = 0; |
123 | 122 | ||
124 | bool categoryAdded = false; | 123 | bool categoryAdded = false; |
125 | 124 | ||
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,95 +1,94 @@ | |||
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 | ||
43 | class OPackageManager : public QObject | 42 | class OPackageManager : public QObject |
44 | { | 43 | { |
45 | Q_OBJECT | 44 | Q_OBJECT |
46 | 45 | ||
47 | public: | 46 | public: |
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 ¶meters = QStringList(), | 75 | const QStringList ¶meters = QStringList(), |
77 | const QString &destination = QString::null, const QObject *receiver = 0x0, | 76 | const QString &destination = QString::null, const QObject *receiver = 0x0, |
78 | const char *slotOutput = 0x0, bool rawOutput = true ); | 77 | const char *slotOutput = 0x0, bool rawOutput = true ); |
79 | 78 | ||
80 | private: | 79 | private: |
81 | Config *m_config; // Pointer to application configuration file | 80 | Config *m_config; // Pointer to application configuration file |
82 | OIpkg m_ipkg; // OIpkg object to retrieve package/configuration information | 81 | OIpkg m_ipkg; // OIpkg object to retrieve package/configuration information |
83 | QDict<OPackage> m_packages; // Global list of available packages | 82 | QDict<OPackage> m_packages; // Global list of available packages |
84 | QStringList m_categories; // List of all categories | 83 | QStringList m_categories; // List of all categories |
85 | 84 | ||
86 | void parseVersion( const QString &verstr, int *epoch, QString *version, QString *revision ); | 85 | void parseVersion( const QString &verstr, int *epoch, QString *version, QString *revision ); |
87 | int verrevcmp( const char *val, const char *ref ); | 86 | int verrevcmp( const char *val, const char *ref ); |
88 | 87 | ||
89 | signals: | 88 | signals: |
90 | void initStatus( int numSteps ); | 89 | void initStatus( int numSteps ); |
91 | void statusText( const QString &status ); | 90 | void statusText( const QString &status ); |
92 | void statusBar( int currStep ); | 91 | void statusBar( int currStep ); |
93 | }; | 92 | }; |
94 | 93 | ||
95 | #endif | 94 | #endif |
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,123 +1,124 @@ | |||
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 | ||
42 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) | 43 | PackageInfoDlg::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 |
76 | { | 77 | { |
77 | // Package information is not cached, retrieve it | 78 | // Package information is not cached, retrieve it |
78 | QStringList list( package ); | 79 | QStringList list( package ); |
79 | m_packman->executeCommand( OPackage::Info, list, QString::null, | 80 | m_packman->executeCommand( OPackage::Info, list, QString::null, |
80 | this, SLOT(slotInfo(const QString &)), true ); | 81 | this, SLOT(slotInfo(const QString &)), true ); |
81 | } | 82 | } |
82 | 83 | ||
83 | // Files tab (display only if package is installed) | 84 | // Files tab (display only if package is installed) |
84 | if ( !m_package->versionInstalled().isNull() ) | 85 | if ( !m_package->versionInstalled().isNull() ) |
85 | { | 86 | { |
86 | QWidget *filesWidget = new QWidget( tabWidget ); | 87 | QWidget *filesWidget = new QWidget( tabWidget ); |
87 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); | 88 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); |
88 | QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); | 89 | QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); |
89 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); | 90 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); |
90 | m_files.setReadOnly( true ); | 91 | m_files.setReadOnly( true ); |
91 | filesLayout->addWidget( &m_files ); | 92 | filesLayout->addWidget( &m_files ); |
92 | 93 | ||
93 | // If file list is already cached, display | 94 | // If file list is already cached, display |
94 | if ( !m_package->files().isNull() ) | 95 | if ( !m_package->files().isNull() ) |
95 | m_files.setText( m_package->files() ); | 96 | m_files.setText( m_package->files() ); |
96 | else | 97 | else |
97 | { | 98 | { |
98 | m_retrieveFiles = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), | 99 | m_retrieveFiles = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), |
99 | tr( "Retrieve file list" ), filesWidget ); | 100 | tr( "Retrieve file list" ), filesWidget ); |
100 | QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) ); | 101 | QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) ); |
101 | filesLayout->addWidget( m_retrieveFiles ); | 102 | filesLayout->addWidget( m_retrieveFiles ); |
102 | connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); | 103 | connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); |
103 | } | 104 | } |
104 | 105 | ||
105 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); | 106 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); |
106 | tabWidget->setCurrentTab( tr( "Information" ) ); | 107 | tabWidget->setCurrentTab( tr( "Information" ) ); |
107 | 108 | ||
108 | } | 109 | } |
109 | else | 110 | else |
110 | m_files.hide(); | 111 | m_files.hide(); |
111 | } | 112 | } |
112 | 113 | ||
113 | PackageInfoDlg::~PackageInfoDlg() | 114 | PackageInfoDlg::~PackageInfoDlg() |
114 | { | 115 | { |
115 | if ( !m_package ) | 116 | if ( !m_package ) |
116 | return; | 117 | return; |
117 | 118 | ||
118 | // Cache package information | 119 | // Cache package information |
119 | if ( !m_information.text().isNull() ) | 120 | if ( !m_information.text().isNull() ) |
120 | m_package->setInformation( m_information.text() ); | 121 | m_package->setInformation( m_information.text() ); |
121 | 122 | ||
122 | // Cache package file list | 123 | // Cache package file list |
123 | if ( !m_files.text().isEmpty() ) | 124 | if ( !m_files.text().isEmpty() ) |
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 | ||
38 | class QPushButton; | 39 | class QPushButton; |
39 | 40 | ||
40 | class OPackage; | 41 | class OPackage; |
41 | class OPackageManager; | 42 | class OPackageManager; |
42 | 43 | ||
43 | class PackageInfoDlg : public QWidget | 44 | class PackageInfoDlg : public QWidget |
44 | { | 45 | { |
45 | Q_OBJECT | 46 | Q_OBJECT |
46 | 47 | ||
47 | public: | 48 | public: |
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 | ||
51 | private: | 52 | private: |
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 | ||
60 | private slots: | 61 | private 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,123 +1,124 @@ | |||
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 | ||
39 | PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, | 40 | PromptDlg::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 | ||
60 | int PromptDlg::display() | 61 | int 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(); |
76 | ++it; | 77 | ++it; |
77 | w = current->geometry().x() - current->x(); | 78 | w = current->geometry().x() - current->x(); |
78 | h = current->geometry().y() - current->y(); | 79 | h = current->geometry().y() - current->y(); |
79 | 80 | ||
80 | extraw = QMAX( extraw, w ); | 81 | extraw = QMAX( extraw, w ); |
81 | extrah = QMAX( extrah, h ); | 82 | extrah = QMAX( extrah, h ); |
82 | } | 83 | } |
83 | delete list; | 84 | delete list; |
84 | 85 | ||
85 | // sanity check for decoration frames. With embedding, we | 86 | // sanity check for decoration frames. With embedding, we |
86 | // might get extraordinary values | 87 | // might get extraordinary values |
87 | if ( extraw >= 10 || extrah >= 40 ) | 88 | if ( extraw >= 10 || extrah >= 40 ) |
88 | extraw = extrah = 0; | 89 | extraw = extrah = 0; |
89 | 90 | ||
90 | if ( w ) | 91 | if ( w ) |
91 | { | 92 | { |
92 | // Use mapToGlobal rather than geometry() in case w might | 93 | // Use mapToGlobal rather than geometry() in case w might |
93 | // be embedded in another application | 94 | // be embedded in another application |
94 | QPoint pp = w->mapToGlobal( QPoint(0,0) ); | 95 | QPoint pp = w->mapToGlobal( QPoint(0,0) ); |
95 | p = QPoint( pp.x() + w->width()/2, pp.y() + w->height()/ 2 ); | 96 | p = QPoint( pp.x() + w->width()/2, pp.y() + w->height()/ 2 ); |
96 | } | 97 | } |
97 | else | 98 | else |
98 | p = QPoint( desk->width()/2, desk->height()/2 ); | 99 | p = QPoint( desk->width()/2, desk->height()/2 ); |
99 | 100 | ||
100 | p = QPoint( p.x()-width()/2 - extraw, p.y()-height()/2 - extrah ); | 101 | p = QPoint( p.x()-width()/2 - extraw, p.y()-height()/2 - extrah ); |
101 | 102 | ||
102 | if ( p.x() + extraw + width() > desk->width() ) | 103 | if ( p.x() + extraw + width() > desk->width() ) |
103 | p.setX( desk->width() - width() - extraw ); | 104 | p.setX( desk->width() - width() - extraw ); |
104 | if ( p.x() < 0 ) | 105 | if ( p.x() < 0 ) |
105 | p.setX( 0 ); | 106 | p.setX( 0 ); |
106 | 107 | ||
107 | if ( p.y() + extrah + height() > desk->height() ) | 108 | if ( p.y() + extrah + height() > desk->height() ) |
108 | p.setY( desk->height() - height() - extrah ); | 109 | p.setY( desk->height() - height() - extrah ); |
109 | if ( p.y() < 0 ) | 110 | if ( p.y() < 0 ) |
110 | p.setY( 0 ); | 111 | p.setY( 0 ); |
111 | 112 | ||
112 | move( p ); | 113 | move( p ); |
113 | show(); | 114 | show(); |
114 | 115 | ||
115 | // Enter event loop for modality | 116 | // Enter event loop for modality |
116 | qApp->enter_loop(); | 117 | qApp->enter_loop(); |
117 | 118 | ||
118 | return m_btnClicked; | 119 | return m_btnClicked; |
119 | } | 120 | } |
120 | 121 | ||
121 | int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, | 122 | int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, |
122 | QWidget *parent ) | 123 | QWidget *parent ) |
123 | { | 124 | { |
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 | ||
35 | class PromptDlg : public QWidget | 36 | class PromptDlg : public QWidget |
36 | { | 37 | { |
37 | Q_OBJECT | 38 | Q_OBJECT |
38 | 39 | ||
39 | public: | 40 | public: |
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 | ||
51 | private: | 52 | private: |
52 | int m_btnClicked; // Indicator for which button was pressed | 53 | int m_btnClicked; // Indicator for which button was pressed |
53 | 54 | ||
54 | private slots: | 55 | private slots: |
55 | void slotBtn1Clicked(); | 56 | void slotBtn1Clicked(); |
56 | void slotBtn2Clicked(); | 57 | void slotBtn2Clicked(); |
57 | }; | 58 | }; |
58 | 59 | ||
59 | #endif | 60 | #endif |