summaryrefslogtreecommitdiff
authordrw <drw>2004-02-12 15:14:07 (UTC)
committer drw <drw>2004-02-12 15:14:07 (UTC)
commit596d87e16d593cbc52d510973ece99ffe26cd4c4 (patch) (unidiff)
tree1b04d79f2c5b61aeccca85505d87c9f0d9612d4d
parentc06370063cb3983c1e90434ee66db4d7a3bedda2 (diff)
downloadopie-596d87e16d593cbc52d510973ece99ffe26cd4c4.zip
opie-596d87e16d593cbc52d510973ece99ffe26cd4c4.tar.gz
opie-596d87e16d593cbc52d510973ece99ffe26cd4c4.tar.bz2
QDialog::exec() -> QPEApplication::execDialog()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog21
-rw-r--r--noncore/settings/packagemanager/entrydlg.cpp5
-rw-r--r--noncore/settings/packagemanager/filterdlg.cpp2
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp2
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp2
-rw-r--r--noncore/settings/packagemanager/opackagemanager.cpp2
-rw-r--r--noncore/settings/packagemanager/promptdlg.cpp4
-rw-r--r--noncore/settings/packagemanager/promptdlg.h2
8 files changed, 22 insertions, 18 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog
index 72e6169..744122f 100644
--- a/noncore/settings/packagemanager/ChangeLog
+++ b/noncore/settings/packagemanager/ChangeLog
@@ -1,20 +1,21 @@
12004-mm-dd Dan Williams <drw@handhelds.org> 12004-02-12 Dan Williams <drw@handhelds.org>
2 2
3 * Package information dialog implemented 3 * Package information dialog implemented
4 * What's This app icon enabled 4 * What's This app icon enabled
5 * Changed all QDialog::exec() occurences to QPEApplication::execDialog()
5 6
62004-01-23 Dan Williams <drw@handhelds.org> 72004-01-23 Dan Williams <drw@handhelds.org>
7 8
8 * Added package download functionality 9 * Added package download functionality
9 * Have Opie update links after install/removal so that apps 10 * Have Opie update links after install/removal so that apps
10 will display properly in Launcher 11 will display properly in Launcher
11 12
122004-01-20 Dan Williams <drw@handhelds.org> 132004-01-20 Dan Williams <drw@handhelds.org>
13 14
14 * Released version 0.2.0 15 * Released version 0.2.0
15 * Converted to use libipkg in place of spawning ipkg process 16 * Converted to use libipkg in place of spawning ipkg process
16 17
172004-01-13 Dan Williams <drw@handhelds.org> 182004-01-13 Dan Williams <drw@handhelds.org>
18 19
19 * Released version 0.1.0 20 * Released version 0.1.0
20 * Initial check-in of new package management client to eventually replace AQPkg 21 * Initial check-in of new package management client to eventually replace AQPkg
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp
index 8deaa37..663abd2 100644
--- a/noncore/settings/packagemanager/entrydlg.cpp
+++ b/noncore/settings/packagemanager/entrydlg.cpp
@@ -1,82 +1,85 @@
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 Dan Williams <drw@handhelds.org>
5             .=l. 5             .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "entrydlg.h" 30#include "entrydlg.h"
31 31
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qlayout.h> 33#include <qlayout.h>
34#include <qlineedit.h> 34#include <qlineedit.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36 36
37#include <qpe/qpeapplication.h>
38
37EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) 39EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal )
38 : QDialog( parent, name, modal ) 40 : QDialog( parent, name, modal )
39{ 41{
40 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); 42 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 );
41 43
42 QLabel *l = new QLabel( label, this ); 44 QLabel *l = new QLabel( label, this );
43 l->setAlignment( AlignLeft | AlignTop | WordBreak ); 45 l->setAlignment( AlignLeft | AlignTop | WordBreak );
44 vbox->addWidget( l ); 46 vbox->addWidget( l );
45 47
46 m_entry = new QLineEdit( this ); 48 m_entry = new QLineEdit( this );
47 vbox->addWidget( m_entry ); 49 vbox->addWidget( m_entry );
48 50
49 connect( m_entry, SIGNAL(returnPressed()), this, SLOT(tryAccept()) ); 51 connect( m_entry, SIGNAL(returnPressed()), this, SLOT(tryAccept()) );
50} 52}
51 53
52void EntryDlg::setText( const QString &text ) 54void EntryDlg::setText( const QString &text )
53{ 55{
54 m_entry->setText( text ); 56 m_entry->setText( text );
55 m_entry->selectAll(); 57 m_entry->selectAll();
56} 58}
57 59
58QString EntryDlg::getText() 60QString EntryDlg::getText()
59{ 61{
60 return m_entry->text(); 62 return m_entry->text();
61} 63}
62 64
63QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, 65QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok,
64 QWidget *parent, const char *name ) 66 QWidget *parent, const char *name )
65{ 67{
66 EntryDlg *dlg = new EntryDlg( label, parent, name, true ); 68 EntryDlg *dlg = new EntryDlg( label, parent, name, true );
67 dlg->setCaption( caption ); 69 dlg->setCaption( caption );
68 dlg->setText( text ); 70 dlg->setText( text );
69 71
70 QString result; 72 QString result;
71 *ok = ( dlg->exec() == QDialog::Accepted ); 73
74 *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted );
72 if ( *ok ) 75 if ( *ok )
73 result = dlg->getText(); 76 result = dlg->getText();
74 77
75 delete dlg; 78 delete dlg;
76 return result; 79 return result;
77} 80}
78void EntryDlg::tryAccept() 81void EntryDlg::tryAccept()
79{ 82{
80 if ( !m_entry->text().isEmpty() ) 83 if ( !m_entry->text().isEmpty() )
81 accept(); 84 accept();
82} 85}
diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp
index 2e48d5b..0da9d19 100644
--- a/noncore/settings/packagemanager/filterdlg.cpp
+++ b/noncore/settings/packagemanager/filterdlg.cpp
@@ -1,179 +1,179 @@
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) 2003 Dan Williams <drw@handhelds.org>
5             .=l. 5             .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "filterdlg.h" 30#include "filterdlg.h"
31 31
32FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, 32FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name,
33 const QString &server, const QString &destination, 33 const QString &server, const QString &destination,
34 OPackageManager::Status status, const QString &category ) 34 OPackageManager::Status status, const QString &category )
35 : QDialog( parent, QString::null, true ) 35 : QDialog( parent, QString::null, true )
36{ 36{
37 setCaption( tr( "Filter packages" ) ); 37 setCaption( tr( "Filter packages" ) );
38 38
39 QVBoxLayout *layout = new QVBoxLayout( this ); 39 QVBoxLayout *layout = new QVBoxLayout( this );
40 QScrollView *sv = new QScrollView( this ); 40 QScrollView *sv = new QScrollView( this );
41 layout->addWidget( sv, 0, 0 ); 41 layout->addWidget( sv, 0, 0 );
42 sv->setResizePolicy( QScrollView::AutoOneFit ); 42 sv->setResizePolicy( QScrollView::AutoOneFit );
43 sv->setFrameStyle( QFrame::NoFrame ); 43 sv->setFrameStyle( QFrame::NoFrame );
44 QWidget *container = new QWidget( sv->viewport() ); 44 QWidget *container = new QWidget( sv->viewport() );
45 sv->addChild( container ); 45 sv->addChild( container );
46 layout = new QVBoxLayout( container, 4, 4 ); 46 layout = new QVBoxLayout( container, 4, 4 );
47 47
48 // Category 48 // Category
49 m_categoryCB = new QCheckBox( tr( "Category:" ), container ); 49 m_categoryCB = new QCheckBox( tr( "Category:" ), container );
50 connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) ); 50 connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) );
51 m_category = new QComboBox( container ); 51 m_category = new QComboBox( container );
52 m_category->insertStringList( pm->categories() ); 52 m_category->insertStringList( pm->categories() );
53 initItem( m_category, m_categoryCB, category ); 53 initItem( m_category, m_categoryCB, category );
54 layout->addWidget( m_categoryCB ); 54 layout->addWidget( m_categoryCB );
55 layout->addWidget( m_category ); 55 layout->addWidget( m_category );
56 56
57 // Package name 57 // Package name
58 m_nameCB = new QCheckBox( tr( "Names containing:" ), container ); 58 m_nameCB = new QCheckBox( tr( "Names containing:" ), container );
59 connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) ); 59 connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) );
60 m_name = new QLineEdit( name, container ); 60 m_name = new QLineEdit( name, container );
61 if ( !name.isNull() ) 61 if ( !name.isNull() )
62 m_nameCB->setChecked( true ); 62 m_nameCB->setChecked( true );
63 m_name->setEnabled( !name.isNull() ); 63 m_name->setEnabled( !name.isNull() );
64 layout->addWidget( m_nameCB ); 64 layout->addWidget( m_nameCB );
65 layout->addWidget( m_name ); 65 layout->addWidget( m_name );
66 66
67 // Status 67 // Status
68 m_statusCB = new QCheckBox( tr( "With the status:" ), container ); 68 m_statusCB = new QCheckBox( tr( "With the status:" ), container );
69 connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); 69 connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) );
70 m_status = new QComboBox( container ); 70 m_status = new QComboBox( container );
71 connect( m_status, SIGNAL(activated(const QString &)), this, SLOT(slotStatusChanged(const QString &)) ); 71 connect( m_status, SIGNAL(activated(const QString &)), this, SLOT(slotStatusChanged(const QString &)) );
72 QString currStatus; 72 QString currStatus;
73 switch ( status ) 73 switch ( status )
74 { 74 {
75 case OPackageManager::All : currStatus = tr( "All" ); 75 case OPackageManager::All : currStatus = tr( "All" );
76 break; 76 break;
77 case OPackageManager::Installed : currStatus = tr( "Installed" ); 77 case OPackageManager::Installed : currStatus = tr( "Installed" );
78 break; 78 break;
79 case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); 79 case OPackageManager::NotInstalled : currStatus = tr( "Not installed" );
80 break; 80 break;
81 case OPackageManager::Updated : currStatus = tr( "Updated" ); 81 case OPackageManager::Updated : currStatus = tr( "Updated" );
82 break; 82 break;
83 default : currStatus = QString::null; 83 default : currStatus = QString::null;
84 }; 84 };
85 m_status->insertItem( tr( "All" ) ); 85 m_status->insertItem( tr( "All" ) );
86 m_status->insertItem( tr( "Installed" ) ); 86 m_status->insertItem( tr( "Installed" ) );
87 m_status->insertItem( tr( "Not installed" ) ); 87 m_status->insertItem( tr( "Not installed" ) );
88 m_status->insertItem( tr( "Updated" ) ); 88 m_status->insertItem( tr( "Updated" ) );
89 initItem( m_status, m_statusCB, currStatus ); 89 initItem( m_status, m_statusCB, currStatus );
90 layout->addWidget( m_statusCB ); 90 layout->addWidget( m_statusCB );
91 layout->addWidget( m_status ); 91 layout->addWidget( m_status );
92 92
93 // Server 93 // Server
94 m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); 94 m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container );
95 connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); 95 connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) );
96 m_server = new QComboBox( container ); 96 m_server = new QComboBox( container );
97 m_server->insertStringList( *(pm->servers()) ); 97 m_server->insertStringList( *(pm->servers()) );
98 initItem( m_server, m_serverCB, server ); 98 initItem( m_server, m_serverCB, server );
99 layout->addWidget( m_serverCB ); 99 layout->addWidget( m_serverCB );
100 layout->addWidget( m_server ); 100 layout->addWidget( m_server );
101 101
102 // Destination 102 // Destination
103 m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); 103 m_destCB = new QCheckBox( tr( "Installed on device at:" ), container );
104 connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); 104 connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) );
105 m_destination = new QComboBox( container ); 105 m_destination = new QComboBox( container );
106 m_destination->insertStringList( *(pm->destinations()) ); 106 m_destination->insertStringList( *(pm->destinations()) );
107 initItem( m_destination, m_destCB, destination ); 107 initItem( m_destination, m_destCB, destination );
108 layout->addWidget( m_destCB ); 108 layout->addWidget( m_destCB );
109 layout->addWidget( m_destination ); 109 layout->addWidget( m_destination );
110 110
111 showMaximized(); 111 //showMaximized();
112} 112}
113 113
114void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) 114void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection )
115{ 115{
116 if ( !selection.isNull() ) 116 if ( !selection.isNull() )
117 { 117 {
118 checkBox->setChecked( true ); 118 checkBox->setChecked( true );
119 119
120 for ( int i = 0; i < comboBox->count(); i++ ) 120 for ( int i = 0; i < comboBox->count(); i++ )
121 { 121 {
122 if ( comboBox->text( i ) == selection ) 122 if ( comboBox->text( i ) == selection )
123 { 123 {
124 comboBox->setCurrentItem( i ); 124 comboBox->setCurrentItem( i );
125 return; 125 return;
126 } 126 }
127 } 127 }
128 } 128 }
129 comboBox->setEnabled( !selection.isNull() ); 129 comboBox->setEnabled( !selection.isNull() );
130} 130}
131 131
132void FilterDlg::slotNameSelected( bool selected ) 132void FilterDlg::slotNameSelected( bool selected )
133{ 133{
134 m_name->setEnabled( selected ); 134 m_name->setEnabled( selected );
135} 135}
136 136
137void FilterDlg::slotServerSelected( bool selected ) 137void FilterDlg::slotServerSelected( bool selected )
138{ 138{
139 m_server->setEnabled( selected ); 139 m_server->setEnabled( selected );
140} 140}
141 141
142void FilterDlg::slotDestSelected( bool selected ) 142void FilterDlg::slotDestSelected( bool selected )
143{ 143{
144 m_destination->setEnabled( selected ); 144 m_destination->setEnabled( selected );
145} 145}
146 146
147void FilterDlg::slotStatusSelected( bool selected ) 147void FilterDlg::slotStatusSelected( bool selected )
148{ 148{
149 m_status->setEnabled( selected ); 149 m_status->setEnabled( selected );
150 150
151 if ( !selected && !m_destCB->isEnabled() ) 151 if ( !selected && !m_destCB->isEnabled() )
152 { 152 {
153 // If status check box has been deselected and destination option was previously deselected 153 // If status check box has been deselected and destination option was previously deselected
154 // (because status == "Not installed"), re-enable destination option 154 // (because status == "Not installed"), re-enable destination option
155 m_destCB->setEnabled( true ); 155 m_destCB->setEnabled( true );
156 m_destination->setEnabled( true ); 156 m_destination->setEnabled( true );
157 } 157 }
158 else if ( selected && m_destCB->isEnabled() && m_status->currentText() == tr( "Not installed" ) ) 158 else if ( selected && m_destCB->isEnabled() && m_status->currentText() == tr( "Not installed" ) )
159 { 159 {
160 // If status check box has been selected and status == "Not installed", disable destination option 160 // If status check box has been selected and status == "Not installed", disable destination option
161 m_destCB->setEnabled( false ); 161 m_destCB->setEnabled( false );
162 m_destCB->setChecked( false ); 162 m_destCB->setChecked( false );
163 m_destination->setEnabled( false ); 163 m_destination->setEnabled( false );
164 } 164 }
165} 165}
166 166
167void FilterDlg::slotStatusChanged( const QString &category ) 167void FilterDlg::slotStatusChanged( const QString &category )
168{ 168{
169 bool notInstalled = ( category == tr( "Not installed" ) ); 169 bool notInstalled = ( category == tr( "Not installed" ) );
170 m_destCB->setEnabled( !notInstalled ); 170 m_destCB->setEnabled( !notInstalled );
171 m_destination->setEnabled( !notInstalled ); 171 m_destination->setEnabled( !notInstalled );
172 if ( notInstalled ) 172 if ( notInstalled )
173 m_destCB->setChecked( false ); 173 m_destCB->setChecked( false );
174} 174}
175 175
176void FilterDlg::slotCategorySelected( bool selected ) 176void FilterDlg::slotCategorySelected( bool selected )
177{ 177{
178 m_category->setEnabled( selected ); 178 m_category->setEnabled( selected );
179} 179}
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 8b374ab..2cb11ba 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -102,581 +102,581 @@ void MainWindow::closeEvent( QCloseEvent *event )
102 // TODO - write out application configuration settings 102 // TODO - write out application configuration settings
103 103
104 // Write out package manager configuration settings 104 // Write out package manager configuration settings
105 m_packman.saveSettings(); 105 m_packman.saveSettings();
106 event->accept(); 106 event->accept();
107 } 107 }
108 else 108 else
109 { 109 {
110 delete m_widgetStack.visibleWidget(); 110 delete m_widgetStack.visibleWidget();
111 m_widgetStack.raiseWidget( &m_packageList ); 111 m_widgetStack.raiseWidget( &m_packageList );
112 event->ignore(); 112 event->ignore();
113 } 113 }
114} 114}
115 115
116void MainWindow::initPackageList() 116void MainWindow::initPackageList()
117{ 117{
118 m_packageList.addColumn( tr( "Packages" ) ); 118 m_packageList.addColumn( tr( "Packages" ) );
119 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\nClick inside the box at the left to select a package." ) ); 119 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\nClick inside the box at the left to select a package." ) );
120 QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); 120 QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold );
121 connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)), 121 connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)),
122 this, SLOT(slotDisplayPackageInfo(QListViewItem *)) ); 122 this, SLOT(slotDisplayPackageInfo(QListViewItem *)) );
123} 123}
124 124
125void MainWindow::initStatusWidget() 125void MainWindow::initStatusWidget()
126{ 126{
127 QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 ); 127 QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 );
128 128
129 m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 129 m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
130 layout->addWidget( &m_statusText ); 130 layout->addWidget( &m_statusText );
131 131
132 connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) ); 132 connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) );
133 connect( &m_packman, SIGNAL(statusText(const QString &)), this, SLOT(slotStatusText(const QString &)) ); 133 connect( &m_packman, SIGNAL(statusText(const QString &)), this, SLOT(slotStatusText(const QString &)) );
134 connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) ); 134 connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) );
135 135
136 layout->addWidget( &m_statusBar ); 136 layout->addWidget( &m_statusBar );
137} 137}
138 138
139void MainWindow::initUI() 139void MainWindow::initUI()
140{ 140{
141 // Build menu and tool bars 141 // Build menu and tool bars
142 setToolBarsMovable( false ); 142 setToolBarsMovable( false );
143 143
144 m_menuBar.setHorizontalStretchable( true ); 144 m_menuBar.setHorizontalStretchable( true );
145 QMenuBar *mb = new QMenuBar( &m_menuBar ); 145 QMenuBar *mb = new QMenuBar( &m_menuBar );
146 mb->setMargin( 0 ); 146 mb->setMargin( 0 );
147 147
148 // Find toolbar 148 // Find toolbar
149 addToolBar( &m_findBar, QMainWindow::Top, true ); 149 addToolBar( &m_findBar, QMainWindow::Top, true );
150 m_findBar.setHorizontalStretchable( true ); 150 m_findBar.setHorizontalStretchable( true );
151 m_findEdit = new QLineEdit( &m_findBar ); 151 m_findEdit = new QLineEdit( &m_findBar );
152 QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) ); 152 QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) );
153 m_findBar.setStretchableWidget( m_findEdit ); 153 m_findBar.setStretchableWidget( m_findEdit );
154 connect( m_findEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotFindChanged(const QString &)) ); 154 connect( m_findEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotFindChanged(const QString &)) );
155 155
156 // Packages menu 156 // Packages menu
157 QPopupMenu *popup = new QPopupMenu( this ); 157 QPopupMenu *popup = new QPopupMenu( this );
158 158
159 QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); 159 QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 );
160 a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); 160 a->setWhatsThis( tr( "Click here to update package lists from servers." ) );
161 connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); 161 connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) );
162 a->addTo( popup ); 162 a->addTo( popup );
163 a->addTo( &m_toolBar ); 163 a->addTo( &m_toolBar );
164 164
165 QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); 165 QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 );
166 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); 166 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) );
167 connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); 167 connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) );
168 actionUpgrade->addTo( popup ); 168 actionUpgrade->addTo( popup );
169 actionUpgrade->addTo( &m_toolBar ); 169 actionUpgrade->addTo( &m_toolBar );
170 170
171 QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); 171 QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" );
172 QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); 172 QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" );
173 QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); 173 QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 );
174 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); 174 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) );
175 connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); 175 connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) );
176 actionDownload->addTo( popup ); 176 actionDownload->addTo( popup );
177 actionDownload->addTo( &m_toolBar ); 177 actionDownload->addTo( &m_toolBar );
178 178
179 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); 179 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 );
180 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); 180 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) );
181 connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); 181 connect( a, SIGNAL(activated()), this, SLOT(slotApply()) );
182 a->addTo( popup ); 182 a->addTo( popup );
183 a->addTo( &m_toolBar ); 183 a->addTo( &m_toolBar );
184 184
185 popup->insertSeparator(); 185 popup->insertSeparator();
186 186
187 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); 187 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
188 a->setWhatsThis( tr( "Click here to configure this application." ) ); 188 a->setWhatsThis( tr( "Click here to configure this application." ) );
189 connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); 189 connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) );
190 a->addTo( popup ); 190 a->addTo( popup );
191 mb->insertItem( tr( "Actions" ), popup ); 191 mb->insertItem( tr( "Actions" ), popup );
192 192
193 // View menu 193 // View menu
194 popup = new QPopupMenu( this ); 194 popup = new QPopupMenu( this );
195 195
196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); 196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 );
197 m_actionShowNotInstalled->setToggleAction( true ); 197 m_actionShowNotInstalled->setToggleAction( true );
198 m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); 198 m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) );
199 connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); 199 connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) );
200 m_actionShowNotInstalled->addTo( popup ); 200 m_actionShowNotInstalled->addTo( popup );
201 201
202 m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); 202 m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 );
203 m_actionShowInstalled->setToggleAction( true ); 203 m_actionShowInstalled->setToggleAction( true );
204 m_actionShowInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); 204 m_actionShowInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) );
205 connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); 205 connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) );
206 m_actionShowInstalled->addTo( popup ); 206 m_actionShowInstalled->addTo( popup );
207 207
208 m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); 208 m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 );
209 m_actionShowUpdated->setToggleAction( true ); 209 m_actionShowUpdated->setToggleAction( true );
210 m_actionShowUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); 210 m_actionShowUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) );
211 connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); 211 connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) );
212 m_actionShowUpdated->addTo( popup ); 212 m_actionShowUpdated->addTo( popup );
213 213
214 popup->insertSeparator(); 214 popup->insertSeparator();
215 215
216 a = new QAction( tr( "Configure filter" ), QString::null, 0, this, 0 ); 216 a = new QAction( tr( "Configure filter" ), QString::null, 0, this, 0 );
217 a->setWhatsThis( tr( "Click here to change package filter criteria." ) ); 217 a->setWhatsThis( tr( "Click here to change package filter criteria." ) );
218 connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); 218 connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) );
219 a->addTo( popup ); 219 a->addTo( popup );
220 220
221 m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), 221 m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ),
222 QString::null, 0, this, 0 ); 222 QString::null, 0, this, 0 );
223 m_actionFilter->setToggleAction( true ); 223 m_actionFilter->setToggleAction( true );
224 m_actionFilter->setWhatsThis( tr( "Click here to apply current filter." ) ); 224 m_actionFilter->setWhatsThis( tr( "Click here to apply current filter." ) );
225 connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); 225 connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) );
226 m_actionFilter->addTo( popup ); 226 m_actionFilter->addTo( popup );
227 227
228 popup->insertSeparator(); 228 popup->insertSeparator();
229 229
230 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 230 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
231 a->setWhatsThis( tr( "Click here to search for text in package names." ) ); 231 a->setWhatsThis( tr( "Click here to search for text in package names." ) );
232 connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); 232 connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) );
233 a->addTo( popup ); 233 a->addTo( popup );
234 234
235 m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); 235 m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 );
236 m_actionFindNext->setEnabled( false ); 236 m_actionFindNext->setEnabled( false );
237 m_actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); 237 m_actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) );
238 connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); 238 connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) );
239 m_actionFindNext->addTo( popup ); 239 m_actionFindNext->addTo( popup );
240 m_actionFindNext->addTo( &m_findBar ); 240 m_actionFindNext->addTo( &m_findBar );
241 241
242 mb->insertItem( tr( "View" ), popup ); 242 mb->insertItem( tr( "View" ), popup );
243 243
244 // Finish find toolbar creation 244 // Finish find toolbar creation
245 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 245 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
246 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); 246 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) );
247 connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) ); 247 connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) );
248 a->addTo( &m_findBar ); 248 a->addTo( &m_findBar );
249 m_findBar.hide(); 249 m_findBar.hide();
250} 250}
251 251
252void MainWindow::loadPackageList( OPackageList *packages, bool clearList ) 252void MainWindow::loadPackageList( OPackageList *packages, bool clearList )
253{ 253{
254 if ( clearList ) 254 if ( clearList )
255 m_packageList.clear(); 255 m_packageList.clear();
256 256
257 if ( packages ) 257 if ( packages )
258 { 258 {
259 for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt ) 259 for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt )
260 { 260 {
261 OPackage *package = packageIt.current(); 261 OPackage *package = packageIt.current();
262 QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(), 262 QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(),
263 QCheckListItem::CheckBox ); 263 QCheckListItem::CheckBox );
264 m_packageList.insertItem( item ); 264 m_packageList.insertItem( item );
265 265
266 // If a different version of package is available, show update available icon 266 // If a different version of package is available, show update available icon
267 // Otherwise, show installed icon 267 // Otherwise, show installed icon
268 if ( !package->versionInstalled().isNull() ) 268 if ( !package->versionInstalled().isNull() )
269 { 269 {
270 if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 ) 270 if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 )
271 item->setPixmap( 0, m_iconUpdated ); 271 item->setPixmap( 0, m_iconUpdated );
272 else 272 else
273 item->setPixmap( 0, m_iconInstalled ); 273 item->setPixmap( 0, m_iconInstalled );
274 } 274 }
275 else 275 else
276 item->setPixmap( 0, m_iconNull ); 276 item->setPixmap( 0, m_iconNull );
277 } 277 }
278 } 278 }
279} 279}
280 280
281void MainWindow::searchForPackage( const QString &text ) 281void MainWindow::searchForPackage( const QString &text )
282{ 282{
283 if ( !text.isEmpty() ) 283 if ( !text.isEmpty() )
284 { 284 {
285 // look through package list for text startng at current position 285 // look through package list for text startng at current position
286 QCheckListItem *start = static_cast<QCheckListItem *>(m_packageList.currentItem()); 286 QCheckListItem *start = static_cast<QCheckListItem *>(m_packageList.currentItem());
287 if ( start == 0 ) 287 if ( start == 0 )
288 start = static_cast<QCheckListItem *>(m_packageList.firstChild()); 288 start = static_cast<QCheckListItem *>(m_packageList.firstChild());
289 289
290// for ( QCheckListItem *item = static_cast<QCheckListItem *>(start->nextSibling()); item != 0 ; 290// for ( QCheckListItem *item = static_cast<QCheckListItem *>(start->nextSibling()); item != 0 ;
291 for ( QCheckListItem *item = static_cast<QCheckListItem *>(start); item != 0 ; 291 for ( QCheckListItem *item = static_cast<QCheckListItem *>(start); item != 0 ;
292 item = static_cast<QCheckListItem *>(item->nextSibling()) ) 292 item = static_cast<QCheckListItem *>(item->nextSibling()) )
293 { 293 {
294 if ( item->text().lower().find( text ) != -1 ) 294 if ( item->text().lower().find( text ) != -1 )
295 { 295 {
296 m_packageList.ensureItemVisible( item ); 296 m_packageList.ensureItemVisible( item );
297 m_packageList.setCurrentItem( item ); 297 m_packageList.setCurrentItem( item );
298 break; 298 break;
299 } 299 }
300 } 300 }
301 } 301 }
302} 302}
303 303
304void MainWindow::initPackageInfo() 304void MainWindow::initPackageInfo()
305{ 305{
306 m_widgetStack.raiseWidget( &m_statusWidget ); 306 m_widgetStack.raiseWidget( &m_statusWidget );
307 307
308 // Load package list 308 // Load package list
309 m_packman.loadAvailablePackages(); 309 m_packman.loadAvailablePackages();
310 m_packman.loadInstalledPackages(); 310 m_packman.loadInstalledPackages();
311 311
312 OPackageList *packageList = m_packman.packages(); 312 OPackageList *packageList = m_packman.packages();
313 if ( packageList ) 313 if ( packageList )
314 { 314 {
315 loadPackageList( packageList, true ); 315 loadPackageList( packageList, true );
316 delete packageList; 316 delete packageList;
317 } 317 }
318 318
319 m_widgetStack.raiseWidget( &m_packageList ); 319 m_widgetStack.raiseWidget( &m_packageList );
320} 320}
321 321
322void MainWindow::slotWidgetStackShow( QWidget *widget ) 322void MainWindow::slotWidgetStackShow( QWidget *widget )
323{ 323{
324 if ( widget == &m_packageList ) 324 if ( widget == &m_packageList )
325 { 325 {
326 setCaption( tr( "Package Manager" ) ); 326 setCaption( tr( "Package Manager" ) );
327 327
328 m_menuBar.show(); 328 m_menuBar.show();
329 m_toolBar.show(); 329 m_toolBar.show();
330 } 330 }
331 else 331 else
332 { 332 {
333 m_menuBar.hide(); 333 m_menuBar.hide();
334 m_toolBar.hide(); 334 m_toolBar.hide();
335 } 335 }
336} 336}
337 337
338void MainWindow::slotInitStatusBar( int numSteps ) 338void MainWindow::slotInitStatusBar( int numSteps )
339{ 339{
340 m_statusBar.setTotalSteps( numSteps ); 340 m_statusBar.setTotalSteps( numSteps );
341} 341}
342 342
343void MainWindow::slotStatusText( const QString &status ) 343void MainWindow::slotStatusText( const QString &status )
344{ 344{
345 m_statusText.setText( status ); 345 m_statusText.setText( status );
346} 346}
347 347
348void MainWindow::slotStatusBar( int currStep ) 348void MainWindow::slotStatusBar( int currStep )
349{ 349{
350 m_statusBar.setProgress( currStep ); 350 m_statusBar.setProgress( currStep );
351} 351}
352 352
353void MainWindow::slotUpdate() 353void MainWindow::slotUpdate()
354{ 354{
355 // Create package manager output widget 355 // Create package manager output widget
356 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false, 356 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false,
357 OPackage::Update ); 357 OPackage::Update );
358 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); 358 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
359 359
360 // Display widget 360 // Display widget
361 m_widgetStack.addWidget( dlg, 3 ); 361 m_widgetStack.addWidget( dlg, 3 );
362 m_widgetStack.raiseWidget( dlg ); 362 m_widgetStack.raiseWidget( dlg );
363} 363}
364 364
365void MainWindow::slotUpgrade() 365void MainWindow::slotUpgrade()
366{ 366{
367 // Create package manager output widget 367 // Create package manager output widget
368 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false, 368 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false,
369 OPackage::Upgrade ); 369 OPackage::Upgrade );
370 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); 370 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
371 371
372 // Display widget 372 // Display widget
373 m_widgetStack.addWidget( dlg, 3 ); 373 m_widgetStack.addWidget( dlg, 3 );
374 m_widgetStack.raiseWidget( dlg ); 374 m_widgetStack.raiseWidget( dlg );
375} 375}
376 376
377void MainWindow::slotDownload() 377void MainWindow::slotDownload()
378{ 378{
379 // Retrieve list of packages selected for download (if any) 379 // Retrieve list of packages selected for download (if any)
380 QStringList *workingPackages = new QStringList(); 380 QStringList *workingPackages = new QStringList();
381 381
382 for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild()); 382 for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild());
383 item != 0 ; 383 item != 0 ;
384 item = static_cast<QCheckListItem *>(item->nextSibling()) ) 384 item = static_cast<QCheckListItem *>(item->nextSibling()) )
385 { 385 {
386 if ( item->isOn() ) 386 if ( item->isOn() )
387 workingPackages->append( item->text() ); 387 workingPackages->append( item->text() );
388 } 388 }
389 389
390 if ( workingPackages->isEmpty() ) 390 if ( workingPackages->isEmpty() )
391 { 391 {
392 QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); 392 QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) );
393 return; 393 return;
394 } 394 }
395 else 395 else
396 { 396 {
397 // Download selected packages 397 // Download selected packages
398 m_config.setGroup( "settings" ); 398 m_config.setGroup( "settings" );
399 QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" ); 399 QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" );
400 400
401 bool ok = false; 401 bool ok = false;
402 QString text = EntryDlg::getText( tr( "Download" ), tr( "Enter path to download package to:" ), workingDir, &ok, this ); 402 QString text = EntryDlg::getText( tr( "Download" ), tr( "Enter path to download package to:" ), workingDir, &ok, this );
403 if ( ok && !text.isEmpty() ) 403 if ( ok && !text.isEmpty() )
404 workingDir = text; // user entered something and pressed ok 404 workingDir = text; // user entered something and pressed ok
405 else 405 else
406 return; // user entered nothing or pressed cancel 406 return; // user entered nothing or pressed cancel
407 407
408 // Store download directory in config file 408 // Store download directory in config file
409 m_config.writeEntry( "DownloadDir", workingDir ); 409 m_config.writeEntry( "DownloadDir", workingDir );
410 410
411 // Get starting directory 411 // Get starting directory
412 QDir::setCurrent( workingDir ); 412 QDir::setCurrent( workingDir );
413 413
414 // Create package manager output widget 414 // Create package manager output widget
415 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, 415 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false,
416 OPackage::Download, workingPackages ); 416 OPackage::Download, workingPackages );
417 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); 417 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
418 418
419 // Display widget 419 // Display widget
420 m_widgetStack.addWidget( dlg, 3 ); 420 m_widgetStack.addWidget( dlg, 3 );
421 m_widgetStack.raiseWidget( dlg ); 421 m_widgetStack.raiseWidget( dlg );
422 } 422 }
423} 423}
424 424
425void MainWindow::slotApply() 425void MainWindow::slotApply()
426{ 426{
427 QStringList *removeList = 0x0; 427 QStringList *removeList = 0x0;
428 QStringList *installList = 0x0; 428 QStringList *installList = 0x0;
429 QStringList *upgradeList = 0x0; 429 QStringList *upgradeList = 0x0;
430 430
431 for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild()); 431 for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild());
432 item != 0 ; 432 item != 0 ;
433 item = static_cast<QCheckListItem *>(item->nextSibling()) ) 433 item = static_cast<QCheckListItem *>(item->nextSibling()) )
434 { 434 {
435 if ( item->isOn() ) 435 if ( item->isOn() )
436 { 436 {
437 OPackage *package = m_packman.findPackage( item->text() ); 437 OPackage *package = m_packman.findPackage( item->text() );
438 if ( package ) 438 if ( package )
439 { 439 {
440 if ( !package->versionInstalled().isNull() ) 440 if ( !package->versionInstalled().isNull() )
441 { 441 {
442 if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 ) 442 if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 )
443 { 443 {
444 // Remove/upgrade package 444 // Remove/upgrade package
445 int answer = PromptDlg::ask( tr( "Remove or upgrade" ), 445 int answer = PromptDlg::ask( tr( "Remove or upgrade" ),
446 tr( QString( "Do you wish to remove or upgrade\n%1?" ).arg( item->text() ) ), 446 tr( QString( "Do you wish to remove or upgrade\n%1?" ).arg( item->text() ) ),
447 tr( "Remove" ), tr( "Upgrade" ), this ); 447 tr( "Remove" ), tr( "Upgrade" ), this );
448 if ( answer == 1 ) // Remove 448 if ( answer == 1 ) // Remove
449 { 449 {
450 if ( !removeList ) 450 if ( !removeList )
451 removeList = new QStringList(); 451 removeList = new QStringList();
452 removeList->append( item->text() ); 452 removeList->append( item->text() );
453 } 453 }
454 else if ( answer == 2 ) // Upgrade 454 else if ( answer == 2 ) // Upgrade
455 { 455 {
456 if ( !upgradeList ) 456 if ( !upgradeList )
457 upgradeList = new QStringList(); 457 upgradeList = new QStringList();
458 upgradeList->append( item->text() ); 458 upgradeList->append( item->text() );
459 } 459 }
460 } 460 }
461 else 461 else
462 { 462 {
463 // Remove/reinstall package 463 // Remove/reinstall package
464 int answer = PromptDlg::ask( tr( "Remove or reinstall" ), 464 int answer = PromptDlg::ask( tr( "Remove or reinstall" ),
465 tr( QString( "Do you wish to remove or reinstall\n%1?" ).arg( item->text() ) ), 465 tr( QString( "Do you wish to remove or reinstall\n%1?" ).arg( item->text() ) ),
466 tr( "Remove" ), tr( "Reinstall" ), this ); 466 tr( "Remove" ), tr( "Reinstall" ), this );
467 if ( answer == 1 ) // Remove 467 if ( answer == 1 ) // Remove
468 { 468 {
469 if ( !removeList ) 469 if ( !removeList )
470 removeList = new QStringList(); 470 removeList = new QStringList();
471 removeList->append( item->text() ); 471 removeList->append( item->text() );
472 } 472 }
473 else if ( answer == 2 ) // Reinstall 473 else if ( answer == 2 ) // Reinstall
474 { 474 {
475 if ( !installList ) 475 if ( !installList )
476 installList = new QStringList(); 476 installList = new QStringList();
477 installList->append( item->text() ); 477 installList->append( item->text() );
478 } 478 }
479 } 479 }
480 } 480 }
481 else 481 else
482 { 482 {
483 // Install package 483 // Install package
484 if ( !installList ) 484 if ( !installList )
485 installList = new QStringList(); 485 installList = new QStringList();
486 installList->append( item->text() ); 486 installList->append( item->text() );
487 } 487 }
488 } 488 }
489 } 489 }
490 } 490 }
491 491
492 // If nothing is selected, display message and exit 492 // If nothing is selected, display message and exit
493 if ( !removeList && !installList && !upgradeList ) 493 if ( !removeList && !installList && !upgradeList )
494 { 494 {
495 QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); 495 QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) );
496 return; 496 return;
497 } 497 }
498 498
499 // Send command only if there are packages to process 499 // Send command only if there are packages to process
500 OPackage::Command removeCmd = OPackage::NotDefined; 500 OPackage::Command removeCmd = OPackage::NotDefined;
501 if ( removeList && !removeList->isEmpty() ) 501 if ( removeList && !removeList->isEmpty() )
502 removeCmd = OPackage::Remove; 502 removeCmd = OPackage::Remove;
503 OPackage::Command installCmd = OPackage::NotDefined; 503 OPackage::Command installCmd = OPackage::NotDefined;
504 if ( installList && !installList->isEmpty() ) 504 if ( installList && !installList->isEmpty() )
505 installCmd = OPackage::Install; 505 installCmd = OPackage::Install;
506 OPackage::Command upgradeCmd = OPackage::NotDefined; 506 OPackage::Command upgradeCmd = OPackage::NotDefined;
507 if ( upgradeList && !upgradeList->isEmpty() ) 507 if ( upgradeList && !upgradeList->isEmpty() )
508 upgradeCmd = OPackage::Upgrade; 508 upgradeCmd = OPackage::Upgrade;
509 509
510 // Create package manager output widget 510 // Create package manager output widget
511 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, 511 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true,
512 removeCmd, removeList, 512 removeCmd, removeList,
513 installCmd, installList, 513 installCmd, installList,
514 upgradeCmd, upgradeList ); 514 upgradeCmd, upgradeList );
515 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); 515 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
516 516
517 // Display widget 517 // Display widget
518 m_widgetStack.addWidget( dlg, 3 ); 518 m_widgetStack.addWidget( dlg, 3 );
519 m_widgetStack.raiseWidget( dlg ); 519 m_widgetStack.raiseWidget( dlg );
520} 520}
521 521
522void MainWindow::slotCloseDlg() 522void MainWindow::slotCloseDlg()
523{ 523{
524 // Close install dialog 524 // Close install dialog
525 delete m_widgetStack.visibleWidget(); 525 delete m_widgetStack.visibleWidget();
526 526
527 // Reload package list 527 // Reload package list
528 initPackageInfo(); 528 initPackageInfo();
529 529
530 // Update Opie launcher links 530 // Update Opie launcher links
531 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 531 QCopEnvelope e("QPE/System", "linkChanged(QString)");
532 QString lf = QString::null; 532 QString lf = QString::null;
533 e << lf; 533 e << lf;
534} 534}
535 535
536void MainWindow::slotConfigure() 536void MainWindow::slotConfigure()
537{ 537{
538 if ( m_packman.configureDlg( false ) ) 538 if ( m_packman.configureDlg( false ) )
539 { 539 {
540 if ( PromptDlg::ask( tr( "Config updated" ), 540 if ( PromptDlg::ask( tr( "Config updated" ),
541 tr( "The configuration has been updated. Do you want to update server and package information now?" ), 541 tr( "The configuration has been updated. Do you want to update server and package information now?" ),
542 tr( "Yes" ), tr( "No" ), this ) == 1 ) 542 tr( "Yes" ), tr( "No" ), this ) == 1 )
543 { 543 {
544 // Update package list and reload package info 544 // Update package list and reload package info
545 slotUpdate(); 545 slotUpdate();
546 } 546 }
547 } 547 }
548} 548}
549 549
550void MainWindow::slotShowNotInstalled() 550void MainWindow::slotShowNotInstalled()
551{ 551{
552 OPackageList *packageList; 552 OPackageList *packageList;
553 if ( m_actionShowNotInstalled->isOn() ) 553 if ( m_actionShowNotInstalled->isOn() )
554 { 554 {
555 m_actionShowInstalled->setOn( false ); 555 m_actionShowInstalled->setOn( false );
556 m_actionShowUpdated->setOn( false ); 556 m_actionShowUpdated->setOn( false );
557 packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, 557 packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
558 OPackageManager::NotInstalled, QString::null ); 558 OPackageManager::NotInstalled, QString::null );
559 } 559 }
560 else 560 else
561 packageList = m_packman.packages(); 561 packageList = m_packman.packages();
562 562
563 if ( packageList ) 563 if ( packageList )
564 { 564 {
565 loadPackageList( packageList, true ); 565 loadPackageList( packageList, true );
566 delete packageList; 566 delete packageList;
567 } 567 }
568} 568}
569 569
570void MainWindow::slotShowInstalled() 570void MainWindow::slotShowInstalled()
571{ 571{
572 OPackageList *packageList; 572 OPackageList *packageList;
573 if ( m_actionShowInstalled->isOn() ) 573 if ( m_actionShowInstalled->isOn() )
574 { 574 {
575 m_actionShowNotInstalled->setOn( false ); 575 m_actionShowNotInstalled->setOn( false );
576 m_actionShowUpdated->setOn( false ); 576 m_actionShowUpdated->setOn( false );
577 packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, 577 packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
578 OPackageManager::Installed, QString::null ); 578 OPackageManager::Installed, QString::null );
579 } 579 }
580 else 580 else
581 packageList = m_packman.packages(); 581 packageList = m_packman.packages();
582 582
583 if ( packageList ) 583 if ( packageList )
584 { 584 {
585 loadPackageList( packageList, true ); 585 loadPackageList( packageList, true );
586 delete packageList; 586 delete packageList;
587 } 587 }
588} 588}
589 589
590void MainWindow::slotShowUpdated() 590void MainWindow::slotShowUpdated()
591{ 591{
592 OPackageList *packageList; 592 OPackageList *packageList;
593 if ( m_actionShowUpdated->isOn() ) 593 if ( m_actionShowUpdated->isOn() )
594 { 594 {
595 m_actionShowInstalled->setOn( false ); 595 m_actionShowInstalled->setOn( false );
596 m_actionShowNotInstalled->setOn( false ); 596 m_actionShowNotInstalled->setOn( false );
597 packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, 597 packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
598 OPackageManager::Updated, QString::null ); 598 OPackageManager::Updated, QString::null );
599 } 599 }
600 else 600 else
601 packageList = m_packman.packages(); 601 packageList = m_packman.packages();
602 602
603 if ( packageList ) 603 if ( packageList )
604 { 604 {
605 loadPackageList( packageList, true ); 605 loadPackageList( packageList, true );
606 delete packageList; 606 delete packageList;
607 } 607 }
608} 608}
609 609
610void MainWindow::slotFilterChange() 610void MainWindow::slotFilterChange()
611{ 611{
612 FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, 612 FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus,
613 m_filterCategory ); 613 m_filterCategory );
614 if ( dlg.exec() == QDialog::Accepted ) 614 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted )
615 { 615 {
616 m_filterName = dlg.name(); 616 m_filterName = dlg.name();
617 m_filterServer = dlg.server(); 617 m_filterServer = dlg.server();
618 m_filterDest = dlg.destination(); 618 m_filterDest = dlg.destination();
619 m_filterStatus = dlg.status(); 619 m_filterStatus = dlg.status();
620 m_filterCategory = dlg.category(); 620 m_filterCategory = dlg.category();
621 m_actionFilter->setOn( true ); 621 m_actionFilter->setOn( true );
622 slotFilter( true ); 622 slotFilter( true );
623 } 623 }
624 else 624 else
625 { 625 {
626 m_actionFilter->setOn( false ); 626 m_actionFilter->setOn( false );
627 slotFilter( false ); 627 slotFilter( false );
628 } 628 }
629} 629}
630 630
631void MainWindow::slotFilter( bool isOn ) 631void MainWindow::slotFilter( bool isOn )
632{ 632{
633 OPackageList *packageList; 633 OPackageList *packageList;
634 if ( isOn ) 634 if ( isOn )
635 { 635 {
636 packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, 636 packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest,
637 m_filterStatus, m_filterCategory ); 637 m_filterStatus, m_filterCategory );
638 } 638 }
639 else 639 else
640 packageList = m_packman.packages(); 640 packageList = m_packman.packages();
641 641
642 if ( packageList ) 642 if ( packageList )
643 { 643 {
644 loadPackageList( packageList, true ); 644 loadPackageList( packageList, true );
645 delete packageList; 645 delete packageList;
646 } 646 }
647} 647}
648 648
649void MainWindow::slotFindShowToolbar() 649void MainWindow::slotFindShowToolbar()
650{ 650{
651 m_findBar.show(); 651 m_findBar.show();
652 m_findEdit->setFocus(); 652 m_findEdit->setFocus();
653} 653}
654 654
655void MainWindow::slotFindHideToolbar() 655void MainWindow::slotFindHideToolbar()
656{ 656{
657 m_findBar.hide(); 657 m_findBar.hide();
658} 658}
659 659
660void MainWindow::slotFindChanged( const QString &findText ) 660void MainWindow::slotFindChanged( const QString &findText )
661{ 661{
662 662
663 m_actionFindNext->setEnabled( !findText.isEmpty() ); 663 m_actionFindNext->setEnabled( !findText.isEmpty() );
664 searchForPackage( findText ); 664 searchForPackage( findText );
665} 665}
666 666
667void MainWindow::slotFindNext() 667void MainWindow::slotFindNext()
668{ 668{
669 searchForPackage( m_findEdit->text() ); 669 searchForPackage( m_findEdit->text() );
670} 670}
671 671
672void MainWindow::slotDisplayPackageInfo( QListViewItem *packageItem ) 672void MainWindow::slotDisplayPackageInfo( QListViewItem *packageItem )
673{ 673{
674 QString packageName( ( static_cast<QCheckListItem*>( packageItem ) )->text() ); 674 QString packageName( ( static_cast<QCheckListItem*>( packageItem ) )->text() );
675 675
676 // Create package manager output widget 676 // Create package manager output widget
677 PackageInfoDlg *dlg = new PackageInfoDlg( this, &m_packman, packageName ); 677 PackageInfoDlg *dlg = new PackageInfoDlg( this, &m_packman, packageName );
678 678
679 // Display widget 679 // Display widget
680 m_widgetStack.addWidget( dlg, 3 ); 680 m_widgetStack.addWidget( dlg, 3 );
681 m_widgetStack.raiseWidget( dlg ); 681 m_widgetStack.raiseWidget( dlg );
682} 682}
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index e335f8f..84c6de4 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -1,558 +1,558 @@
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) 2003 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 29
30*/ 30*/
31 31
32#include "oipkgconfigdlg.h" 32#include "oipkgconfigdlg.h"
33 33
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qgroupbox.h> 36#include <qgroupbox.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qlineedit.h> 38#include <qlineedit.h>
39#include <qlistbox.h> 39#include <qlistbox.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qscrollview.h> 41#include <qscrollview.h>
42 42
43#include <qpe/resource.h> 43#include <qpe/resource.h>
44 44
45OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) 45OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent )
46 : QDialog( parent, QString::null, true ) 46 : QDialog( parent, QString::null, true )
47 , m_ipkg( ipkg ) 47 , m_ipkg( ipkg )
48 , m_configs( 0x0 ) 48 , m_configs( 0x0 )
49 , m_installOptions( installOptions ) 49 , m_installOptions( installOptions )
50 , m_serverNew( false ) 50 , m_serverNew( false )
51 , m_serverCurrent( -1 ) 51 , m_serverCurrent( -1 )
52 , m_destNew( false ) 52 , m_destNew( false )
53 , m_destCurrent( -1 ) 53 , m_destCurrent( -1 )
54 , m_layout( this, 2, 4 ) 54 , m_layout( this, 2, 4 )
55 , m_tabWidget( this ) 55 , m_tabWidget( this )
56{ 56{
57 setCaption( tr( "Configuration" ) ); 57 setCaption( tr( "Configuration" ) );
58 58
59 // Initialize configuration widgets 59 // Initialize configuration widgets
60 if ( !installOptions ) 60 if ( !installOptions )
61 { 61 {
62 initServerWidget(); 62 initServerWidget();
63 initDestinationWidget(); 63 initDestinationWidget();
64 initProxyWidget(); 64 initProxyWidget();
65 } 65 }
66 initOptionsWidget(); 66 initOptionsWidget();
67 67
68 // Load configuration information 68 // Load configuration information
69 initData(); 69 initData();
70 70
71 // Setup tabs for all info 71 // Setup tabs for all info
72 m_layout.addWidget( &m_tabWidget ); 72 m_layout.addWidget( &m_tabWidget );
73 if ( !m_installOptions ) 73 if ( !m_installOptions )
74 { 74 {
75 m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); 75 m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) );
76 m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); 76 m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) );
77 m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); 77 m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) );
78 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); 78 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) );
79 m_tabWidget.setCurrentTab( tr( "Servers" ) ); 79 m_tabWidget.setCurrentTab( tr( "Servers" ) );
80 } 80 }
81 else 81 else
82 { 82 {
83 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); 83 m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) );
84 } 84 }
85 85
86 showMaximized(); 86 //showMaximized();
87} 87}
88 88
89void OIpkgConfigDlg::accept() 89void OIpkgConfigDlg::accept()
90{ 90{
91 // Save server, destination and proxy configuration 91 // Save server, destination and proxy configuration
92 if ( !m_installOptions ) 92 if ( !m_installOptions )
93 m_ipkg->setConfigItems( m_configs ); 93 m_ipkg->setConfigItems( m_configs );
94 94
95 // Save options configuration 95 // Save options configuration
96 int options = 0; 96 int options = 0;
97 if ( m_optForceDepends->isChecked() ) 97 if ( m_optForceDepends->isChecked() )
98 options |= FORCE_DEPENDS; 98 options |= FORCE_DEPENDS;
99 if ( m_optForceReinstall->isChecked() ) 99 if ( m_optForceReinstall->isChecked() )
100 options |= FORCE_REINSTALL; 100 options |= FORCE_REINSTALL;
101 if ( m_optForceRemove->isChecked() ) 101 if ( m_optForceRemove->isChecked() )
102 options |= FORCE_REMOVE; 102 options |= FORCE_REMOVE;
103 if ( m_optForceOverwrite->isChecked() ) 103 if ( m_optForceOverwrite->isChecked() )
104 options |= FORCE_OVERWRITE; 104 options |= FORCE_OVERWRITE;
105 m_ipkg->setIpkgExecOptions( options ); 105 m_ipkg->setIpkgExecOptions( options );
106 m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); 106 m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() );
107 107
108 QDialog::accept(); 108 QDialog::accept();
109} 109}
110 110
111void OIpkgConfigDlg::reject() 111void OIpkgConfigDlg::reject()
112{ 112{
113 if ( m_configs ) 113 if ( m_configs )
114 delete m_configs; 114 delete m_configs;
115} 115}
116 116
117void OIpkgConfigDlg::initServerWidget() 117void OIpkgConfigDlg::initServerWidget()
118{ 118{
119 m_serverWidget = new QWidget( this ); 119 m_serverWidget = new QWidget( this );
120 120
121 // Initialize UI 121 // Initialize UI
122 QVBoxLayout *vb = new QVBoxLayout( m_serverWidget ); 122 QVBoxLayout *vb = new QVBoxLayout( m_serverWidget );
123 QScrollView *sv = new QScrollView( m_serverWidget ); 123 QScrollView *sv = new QScrollView( m_serverWidget );
124 vb->addWidget( sv, 0, 0 ); 124 vb->addWidget( sv, 0, 0 );
125 sv->setResizePolicy( QScrollView::AutoOneFit ); 125 sv->setResizePolicy( QScrollView::AutoOneFit );
126 sv->setFrameStyle( QFrame::NoFrame ); 126 sv->setFrameStyle( QFrame::NoFrame );
127 QWidget *container = new QWidget( sv->viewport() ); 127 QWidget *container = new QWidget( sv->viewport() );
128 sv->addChild( container ); 128 sv->addChild( container );
129 QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); 129 QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 );
130 130
131 m_serverList = new QListBox( container ); 131 m_serverList = new QListBox( container );
132 m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); 132 m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
133 connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerEdit(int)) ); 133 connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerEdit(int)) );
134 layout->addMultiCellWidget( m_serverList, 0, 0, 0, 1 ); 134 layout->addMultiCellWidget( m_serverList, 0, 0, 0, 1 );
135 135
136 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); 136 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container );
137 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); 137 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) );
138 layout->addWidget( btn, 1, 0 ); 138 layout->addWidget( btn, 1, 0 );
139 139
140 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); 140 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container );
141 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); 141 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) );
142 layout->addWidget( btn, 1, 1 ); 142 layout->addWidget( btn, 1, 1 );
143 143
144 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); 144 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container );
145 grpbox->layout()->setSpacing( 2 ); 145 grpbox->layout()->setSpacing( 2 );
146 grpbox->layout()->setMargin( 4 ); 146 grpbox->layout()->setMargin( 4 );
147 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); 147 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 );
148 148
149 QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); 149 QGridLayout *grplayout = new QGridLayout( grpbox->layout() );
150 150
151 QLabel *label = new QLabel( tr( "Name:" ), grpbox ); 151 QLabel *label = new QLabel( tr( "Name:" ), grpbox );
152 grplayout->addWidget( label, 0, 0 ); 152 grplayout->addWidget( label, 0, 0 );
153 m_serverName = new QLineEdit( grpbox ); 153 m_serverName = new QLineEdit( grpbox );
154 grplayout->addWidget( m_serverName, 0, 1 ); 154 grplayout->addWidget( m_serverName, 0, 1 );
155 155
156 label = new QLabel( tr( "Address:" ), grpbox ); 156 label = new QLabel( tr( "Address:" ), grpbox );
157 grplayout->addWidget( label, 1, 0 ); 157 grplayout->addWidget( label, 1, 0 );
158 m_serverLocation = new QLineEdit( grpbox ); 158 m_serverLocation = new QLineEdit( grpbox );
159 grplayout->addWidget( m_serverLocation, 1, 1 ); 159 grplayout->addWidget( m_serverLocation, 1, 1 );
160 160
161 m_serverActive = new QCheckBox( tr( "Active Server" ), grpbox ); 161 m_serverActive = new QCheckBox( tr( "Active Server" ), grpbox );
162 grplayout->addMultiCellWidget( m_serverActive, 2, 2, 0, 1 ); 162 grplayout->addMultiCellWidget( m_serverActive, 2, 2, 0, 1 );
163 163
164 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); 164 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox );
165 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerUpdate()) ); 165 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerUpdate()) );
166 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); 166 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 );
167} 167}
168 168
169void OIpkgConfigDlg::initDestinationWidget() 169void OIpkgConfigDlg::initDestinationWidget()
170{ 170{
171 m_destWidget = new QWidget( this ); 171 m_destWidget = new QWidget( this );
172 172
173 // Initialize UI 173 // Initialize UI
174 QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); 174 QVBoxLayout *vb = new QVBoxLayout( m_destWidget );
175 QScrollView *sv = new QScrollView( m_destWidget ); 175 QScrollView *sv = new QScrollView( m_destWidget );
176 vb->addWidget( sv, 0, 0 ); 176 vb->addWidget( sv, 0, 0 );
177 sv->setResizePolicy( QScrollView::AutoOneFit ); 177 sv->setResizePolicy( QScrollView::AutoOneFit );
178 sv->setFrameStyle( QFrame::NoFrame ); 178 sv->setFrameStyle( QFrame::NoFrame );
179 QWidget *container = new QWidget( sv->viewport() ); 179 QWidget *container = new QWidget( sv->viewport() );
180 sv->addChild( container ); 180 sv->addChild( container );
181 QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); 181 QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 );
182 182
183 m_destList = new QListBox( container ); 183 m_destList = new QListBox( container );
184 m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); 184 m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
185 connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestEdit(int)) ); 185 connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestEdit(int)) );
186 layout->addMultiCellWidget( m_destList, 0, 0, 0, 1 ); 186 layout->addMultiCellWidget( m_destList, 0, 0, 0, 1 );
187 187
188 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); 188 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container );
189 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); 189 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) );
190 layout->addWidget( btn, 1, 0 ); 190 layout->addWidget( btn, 1, 0 );
191 191
192 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); 192 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container );
193 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); 193 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) );
194 layout->addWidget( btn, 1, 1 ); 194 layout->addWidget( btn, 1, 1 );
195 195
196 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); 196 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container );
197 grpbox->layout()->setSpacing( 2 ); 197 grpbox->layout()->setSpacing( 2 );
198 grpbox->layout()->setMargin( 4 ); 198 grpbox->layout()->setMargin( 4 );
199 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); 199 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 );
200 200
201 QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); 201 QGridLayout *grplayout = new QGridLayout( grpbox->layout() );
202 202
203 QLabel *label = new QLabel( tr( "Name:" ), grpbox ); 203 QLabel *label = new QLabel( tr( "Name:" ), grpbox );
204 grplayout->addWidget( label, 0, 0 ); 204 grplayout->addWidget( label, 0, 0 );
205 m_destName = new QLineEdit( grpbox ); 205 m_destName = new QLineEdit( grpbox );
206 grplayout->addWidget( m_destName, 0, 1 ); 206 grplayout->addWidget( m_destName, 0, 1 );
207 207
208 label = new QLabel( tr( "Address:" ), grpbox ); 208 label = new QLabel( tr( "Address:" ), grpbox );
209 grplayout->addWidget( label, 1, 0 ); 209 grplayout->addWidget( label, 1, 0 );
210 m_destLocation = new QLineEdit( grpbox ); 210 m_destLocation = new QLineEdit( grpbox );
211 grplayout->addWidget( m_destLocation, 1, 1 ); 211 grplayout->addWidget( m_destLocation, 1, 1 );
212 212
213 m_destActive = new QCheckBox( tr( "Active Server" ), grpbox ); 213 m_destActive = new QCheckBox( tr( "Active Server" ), grpbox );
214 grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 1 ); 214 grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 1 );
215 215
216 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); 216 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox );
217 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); 217 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) );
218 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); 218 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 );
219} 219}
220 220
221void OIpkgConfigDlg::initProxyWidget() 221void OIpkgConfigDlg::initProxyWidget()
222{ 222{
223 m_proxyWidget = new QWidget( this ); 223 m_proxyWidget = new QWidget( this );
224 224
225 // Initialize UI 225 // Initialize UI
226 QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); 226 QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget );
227 QScrollView *sv = new QScrollView( m_proxyWidget ); 227 QScrollView *sv = new QScrollView( m_proxyWidget );
228 vb->addWidget( sv, 0, 0 ); 228 vb->addWidget( sv, 0, 0 );
229 sv->setResizePolicy( QScrollView::AutoOneFit ); 229 sv->setResizePolicy( QScrollView::AutoOneFit );
230 sv->setFrameStyle( QFrame::NoFrame ); 230 sv->setFrameStyle( QFrame::NoFrame );
231 QWidget *container = new QWidget( sv->viewport() ); 231 QWidget *container = new QWidget( sv->viewport() );
232 sv->addChild( container ); 232 sv->addChild( container );
233 QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 ); 233 QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 );
234 234
235 // HTTP proxy server configuration 235 // HTTP proxy server configuration
236 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); 236 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container );
237 grpbox->layout()->setSpacing( 2 ); 237 grpbox->layout()->setSpacing( 2 );
238 grpbox->layout()->setMargin( 4 ); 238 grpbox->layout()->setMargin( 4 );
239 layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); 239 layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 );
240 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); 240 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
241 m_proxyHttpServer = new QLineEdit( grpbox ); 241 m_proxyHttpServer = new QLineEdit( grpbox );
242 grplayout->addWidget( m_proxyHttpServer ); 242 grplayout->addWidget( m_proxyHttpServer );
243 m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox ); 243 m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox );
244 grplayout->addWidget( m_proxyHttpActive ); 244 grplayout->addWidget( m_proxyHttpActive );
245 245
246 // FTP proxy server configuration 246 // FTP proxy server configuration
247 grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); 247 grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container );
248 grpbox->layout()->setSpacing( 2 ); 248 grpbox->layout()->setSpacing( 2 );
249 grpbox->layout()->setMargin( 4 ); 249 grpbox->layout()->setMargin( 4 );
250 layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); 250 layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 );
251 grplayout = new QVBoxLayout( grpbox->layout() ); 251 grplayout = new QVBoxLayout( grpbox->layout() );
252 m_proxyFtpServer = new QLineEdit( grpbox ); 252 m_proxyFtpServer = new QLineEdit( grpbox );
253 grplayout->addWidget( m_proxyFtpServer ); 253 grplayout->addWidget( m_proxyFtpServer );
254 m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox ); 254 m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox );
255 grplayout->addWidget( m_proxyFtpActive ); 255 grplayout->addWidget( m_proxyFtpActive );
256 256
257 // Proxy server username and password configuration 257 // Proxy server username and password configuration
258 QLabel *label = new QLabel( tr( "Username:" ), container ); 258 QLabel *label = new QLabel( tr( "Username:" ), container );
259 layout->addWidget( label, 2, 0 ); 259 layout->addWidget( label, 2, 0 );
260 m_proxyUsername = new QLineEdit( container ); 260 m_proxyUsername = new QLineEdit( container );
261 layout->addWidget( m_proxyUsername, 2, 1 ); 261 layout->addWidget( m_proxyUsername, 2, 1 );
262 262
263 label = new QLabel( tr( "Password:" ), container ); 263 label = new QLabel( tr( "Password:" ), container );
264 layout->addWidget( label, 3, 0 ); 264 layout->addWidget( label, 3, 0 );
265 m_proxyPassword = new QLineEdit( container ); 265 m_proxyPassword = new QLineEdit( container );
266 layout->addWidget( m_proxyPassword, 3, 1 ); 266 layout->addWidget( m_proxyPassword, 3, 1 );
267} 267}
268 268
269void OIpkgConfigDlg::initOptionsWidget() 269void OIpkgConfigDlg::initOptionsWidget()
270{ 270{
271 m_optionsWidget = new QWidget( this ); 271 m_optionsWidget = new QWidget( this );
272 272
273 // Initialize UI 273 // Initialize UI
274 QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); 274 QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget );
275 QScrollView *sv = new QScrollView( m_optionsWidget ); 275 QScrollView *sv = new QScrollView( m_optionsWidget );
276 vb->addWidget( sv, 0, 0 ); 276 vb->addWidget( sv, 0, 0 );
277 sv->setResizePolicy( QScrollView::AutoOneFit ); 277 sv->setResizePolicy( QScrollView::AutoOneFit );
278 sv->setFrameStyle( QFrame::NoFrame ); 278 sv->setFrameStyle( QFrame::NoFrame );
279 QWidget *container = new QWidget( sv->viewport() ); 279 QWidget *container = new QWidget( sv->viewport() );
280 sv->addChild( container ); 280 sv->addChild( container );
281 QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); 281 QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 );
282 282
283 m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); 283 m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container );
284 layout->addWidget( m_optForceDepends ); 284 layout->addWidget( m_optForceDepends );
285 285
286 m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); 286 m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container );
287 layout->addWidget( m_optForceReinstall ); 287 layout->addWidget( m_optForceReinstall );
288 288
289 m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); 289 m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container );
290 layout->addWidget( m_optForceRemove ); 290 layout->addWidget( m_optForceRemove );
291 291
292 m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); 292 m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container );
293 layout->addWidget( m_optForceOverwrite ); 293 layout->addWidget( m_optForceOverwrite );
294 294
295 QLabel *l = new QLabel( tr( "Information Level" ), container ); 295 QLabel *l = new QLabel( tr( "Information Level" ), container );
296 layout->addWidget( l ); 296 layout->addWidget( l );
297 297
298 m_optVerboseIpkg = new QComboBox( container ); 298 m_optVerboseIpkg = new QComboBox( container );
299 m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); 299 m_optVerboseIpkg->insertItem( tr( "Errors only" ) );
300 m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); 300 m_optVerboseIpkg->insertItem( tr( "Normal messages" ) );
301 m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); 301 m_optVerboseIpkg->insertItem( tr( "Informative messages" ) );
302 m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); 302 m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) );
303 layout->addWidget( m_optVerboseIpkg ); 303 layout->addWidget( m_optVerboseIpkg );
304 304
305 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 305 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
306} 306}
307 307
308void OIpkgConfigDlg::initData() 308void OIpkgConfigDlg::initData()
309{ 309{
310 // Read ipkg configuration (server/destination/proxy) information 310 // Read ipkg configuration (server/destination/proxy) information
311 if ( m_ipkg && !m_installOptions ) 311 if ( m_ipkg && !m_installOptions )
312 { 312 {
313 m_configs = m_ipkg->configItems(); 313 m_configs = m_ipkg->configItems();
314 if ( m_configs ) 314 if ( m_configs )
315 { 315 {
316 for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) 316 for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt )
317 { 317 {
318 OConfItem *config = configIt.current(); 318 OConfItem *config = configIt.current();
319 319
320 // Add configuration item to the appropriate dialog controls 320 // Add configuration item to the appropriate dialog controls
321 if ( config ) 321 if ( config )
322 { 322 {
323 if ( config->type() == OConfItem::Source ) 323 if ( config->type() == OConfItem::Source )
324 { 324 {
325 m_serverList->insertItem( config->name() ); 325 m_serverList->insertItem( config->name() );
326 } 326 }
327 else if ( config->type() == OConfItem::Destination ) 327 else if ( config->type() == OConfItem::Destination )
328 { 328 {
329 m_destList->insertItem( config->name() ); 329 m_destList->insertItem( config->name() );
330 } 330 }
331 else if ( config->type() == OConfItem::Option ) 331 else if ( config->type() == OConfItem::Option )
332 { 332 {
333 if ( config->name() == "http_proxy" ) 333 if ( config->name() == "http_proxy" )
334 { 334 {
335 m_proxyHttpServer->setText( config->value() ); 335 m_proxyHttpServer->setText( config->value() );
336 m_proxyHttpActive->setChecked( config->active() ); 336 m_proxyHttpActive->setChecked( config->active() );
337 } 337 }
338 else if ( config->name() == "ftp_proxy" ) 338 else if ( config->name() == "ftp_proxy" )
339 { 339 {
340 m_proxyFtpServer->setText( config->value() ); 340 m_proxyFtpServer->setText( config->value() );
341 m_proxyFtpActive->setChecked( config->active() ); 341 m_proxyFtpActive->setChecked( config->active() );
342 } 342 }
343 else if ( config->name() == "proxy_username" ) 343 else if ( config->name() == "proxy_username" )
344 { 344 {
345 m_proxyUsername->setText( config->value() ); 345 m_proxyUsername->setText( config->value() );
346 } 346 }
347 else if ( config->name() == "proxy_password" ) 347 else if ( config->name() == "proxy_password" )
348 { 348 {
349 m_proxyPassword->setText( config->value() ); 349 m_proxyPassword->setText( config->value() );
350 } 350 }
351 } 351 }
352 } 352 }
353 } 353 }
354 } 354 }
355 } 355 }
356 356
357 // Get Ipkg execution options 357 // Get Ipkg execution options
358 int options = m_ipkg->ipkgExecOptions(); 358 int options = m_ipkg->ipkgExecOptions();
359 if ( options & FORCE_DEPENDS ) 359 if ( options & FORCE_DEPENDS )
360 m_optForceDepends->setChecked( true ); 360 m_optForceDepends->setChecked( true );
361 if ( options & FORCE_REINSTALL ) 361 if ( options & FORCE_REINSTALL )
362 m_optForceReinstall->setChecked( true ); 362 m_optForceReinstall->setChecked( true );
363 if ( options & FORCE_REMOVE ) 363 if ( options & FORCE_REMOVE )
364 m_optForceRemove->setChecked( true ); 364 m_optForceRemove->setChecked( true );
365 if ( options & FORCE_OVERWRITE ) 365 if ( options & FORCE_OVERWRITE )
366 m_optForceOverwrite->setChecked( true ); 366 m_optForceOverwrite->setChecked( true );
367 367
368 m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); 368 m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() );
369} 369}
370 370
371OConfItem *OIpkgConfigDlg::findConfItem( OConfItem::Type type, const QString &name ) 371OConfItem *OIpkgConfigDlg::findConfItem( OConfItem::Type type, const QString &name )
372{ 372{
373 // Find selected server in list 373 // Find selected server in list
374 OConfItemListIterator configIt( *m_configs ); 374 OConfItemListIterator configIt( *m_configs );
375 OConfItem *config = 0x0; 375 OConfItem *config = 0x0;
376 for ( ; configIt.current(); ++configIt ) 376 for ( ; configIt.current(); ++configIt )
377 { 377 {
378 config = configIt.current(); 378 config = configIt.current();
379 if ( config->type() == type && config->name() == name ) 379 if ( config->type() == type && config->name() == name )
380 break; 380 break;
381 } 381 }
382 382
383 if ( config && config->type() == type && config->name() == name ) 383 if ( config && config->type() == type && config->name() == name )
384 return config; 384 return config;
385 385
386 return 0x0; 386 return 0x0;
387} 387}
388 388
389void OIpkgConfigDlg::slotServerEdit( int index ) 389void OIpkgConfigDlg::slotServerEdit( int index )
390{ 390{
391 m_serverNew = false; 391 m_serverNew = false;
392 m_serverCurrent = index; 392 m_serverCurrent = index;
393 393
394 // Find selected server in list 394 // Find selected server in list
395 OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); 395 OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() );
396 396
397 // Display server details 397 // Display server details
398 if ( server ) 398 if ( server )
399 { 399 {
400 m_serverCurrName = server->name(); 400 m_serverCurrName = server->name();
401 m_serverName->setText( server->name() ); 401 m_serverName->setText( server->name() );
402 m_serverLocation->setText( server->value() ); 402 m_serverLocation->setText( server->value() );
403 m_serverActive->setChecked( server->active() ); 403 m_serverActive->setChecked( server->active() );
404 m_serverName->setFocus(); 404 m_serverName->setFocus();
405 } 405 }
406} 406}
407 407
408void OIpkgConfigDlg::slotServerNew() 408void OIpkgConfigDlg::slotServerNew()
409{ 409{
410 m_serverNew = true; 410 m_serverNew = true;
411 411
412 m_serverName->setText( QString::null ); 412 m_serverName->setText( QString::null );
413 m_serverLocation->setText( QString::null ); 413 m_serverLocation->setText( QString::null );
414 m_serverActive->setChecked( true ); 414 m_serverActive->setChecked( true );
415 m_serverName->setFocus(); 415 m_serverName->setFocus();
416} 416}
417 417
418void OIpkgConfigDlg::slotServerDelete() 418void OIpkgConfigDlg::slotServerDelete()
419{ 419{
420 // Find selected server in list 420 // Find selected server in list
421 OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); 421 OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() );
422 422
423 // Delete server 423 // Delete server
424 if ( server ) 424 if ( server )
425 { 425 {
426 m_configs->removeRef( server ); 426 m_configs->removeRef( server );
427 m_serverList->removeItem( m_serverCurrent ); 427 m_serverList->removeItem( m_serverCurrent );
428 } 428 }
429} 429}
430 430
431void OIpkgConfigDlg::slotServerUpdate() 431void OIpkgConfigDlg::slotServerUpdate()
432{ 432{
433 QString newName = m_serverName->text(); 433 QString newName = m_serverName->text();
434 434
435 // Convert any spaces to underscores 435 // Convert any spaces to underscores
436 newName.replace( QRegExp( " " ), "_" ); 436 newName.replace( QRegExp( " " ), "_" );
437 437
438 if ( !m_serverNew ) 438 if ( !m_serverNew )
439 { 439 {
440 // Find selected server in list 440 // Find selected server in list
441 OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName ); 441 OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName );
442 442
443 // Delete server 443 // Delete server
444 if ( server ) 444 if ( server )
445 { 445 {
446 // Update url 446 // Update url
447 server->setValue( m_serverLocation->text() ); 447 server->setValue( m_serverLocation->text() );
448 server->setActive( m_serverActive->isChecked() ); 448 server->setActive( m_serverActive->isChecked() );
449 449
450 // Check if server name has changed, if it has then we need to replace the key in the map 450 // Check if server name has changed, if it has then we need to replace the key in the map
451 if ( m_serverCurrName != newName ) 451 if ( m_serverCurrName != newName )
452 { 452 {
453 // Update server name 453 // Update server name
454 server->setName( newName ); 454 server->setName( newName );
455 455
456 // Update list box 456 // Update list box
457 m_serverList->changeItem( newName, m_serverCurrent ); 457 m_serverList->changeItem( newName, m_serverCurrent );
458 } 458 }
459 } 459 }
460 } 460 }
461 else 461 else
462 { 462 {
463 // Add new destination to configuration list 463 // Add new destination to configuration list
464 m_configs->append( new OConfItem( QString::null, OConfItem::Source, newName, 464 m_configs->append( new OConfItem( QString::null, OConfItem::Source, newName,
465 m_serverLocation->text(), m_serverActive->isChecked() ) ); 465 m_serverLocation->text(), m_serverActive->isChecked() ) );
466 m_configs->sort(); 466 m_configs->sort();
467 467
468 m_serverList->insertItem( newName ); 468 m_serverList->insertItem( newName );
469 m_serverList->setCurrentItem( m_serverList->count() ); 469 m_serverList->setCurrentItem( m_serverList->count() );
470 m_serverNew = false; 470 m_serverNew = false;
471 m_serverList->insertItem( newName ); 471 m_serverList->insertItem( newName );
472 } 472 }
473} 473}
474 474
475void OIpkgConfigDlg::slotDestEdit( int index ) 475void OIpkgConfigDlg::slotDestEdit( int index )
476{ 476{
477 m_destNew = false; 477 m_destNew = false;
478 m_destCurrent = index; 478 m_destCurrent = index;
479 479
480 // Find selected destination in list 480 // Find selected destination in list
481 OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); 481 OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() );
482 482
483 // Display destination details 483 // Display destination details
484 if ( destination ) 484 if ( destination )
485 { 485 {
486 m_destCurrName = destination->name(); 486 m_destCurrName = destination->name();
487 m_destName->setText( destination->name() ); 487 m_destName->setText( destination->name() );
488 m_destLocation->setText( destination->value() ); 488 m_destLocation->setText( destination->value() );
489 m_destActive->setChecked( destination->active() ); 489 m_destActive->setChecked( destination->active() );
490 m_destName->setFocus(); 490 m_destName->setFocus();
491 } 491 }
492} 492}
493 493
494void OIpkgConfigDlg::slotDestNew() 494void OIpkgConfigDlg::slotDestNew()
495{ 495{
496 m_destNew = true; 496 m_destNew = true;
497 497
498 m_destName->setText( QString::null ); 498 m_destName->setText( QString::null );
499 m_destLocation->setText( QString::null ); 499 m_destLocation->setText( QString::null );
500 m_destActive->setChecked( true ); 500 m_destActive->setChecked( true );
501 m_destName->setFocus(); 501 m_destName->setFocus();
502} 502}
503 503
504void OIpkgConfigDlg::slotDestDelete() 504void OIpkgConfigDlg::slotDestDelete()
505{ 505{
506 // Find selected destination in list 506 // Find selected destination in list
507 OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); 507 OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() );
508 508
509 // Delete destination 509 // Delete destination
510 if ( destination ) 510 if ( destination )
511 { 511 {
512 m_configs->removeRef( destination ); 512 m_configs->removeRef( destination );
513 m_destList->removeItem( m_destCurrent ); 513 m_destList->removeItem( m_destCurrent );
514 } 514 }
515} 515}
516 516
517void OIpkgConfigDlg::slotDestUpdate() 517void OIpkgConfigDlg::slotDestUpdate()
518{ 518{
519 QString newName = m_destName->text(); 519 QString newName = m_destName->text();
520 520
521 // Convert any spaces to underscores 521 // Convert any spaces to underscores
522 newName.replace( QRegExp( " " ), "_" ); 522 newName.replace( QRegExp( " " ), "_" );
523 523
524 if ( !m_destNew ) 524 if ( !m_destNew )
525 { 525 {
526 // Find selected destination in list 526 // Find selected destination in list
527 OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName ); 527 OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName );
528 528
529 // Display destination details 529 // Display destination details
530 if ( destination ) 530 if ( destination )
531 { 531 {
532 // Update url 532 // Update url
533 destination->setValue( m_destLocation->text() ); 533 destination->setValue( m_destLocation->text() );
534 destination->setActive( m_destActive->isChecked() ); 534 destination->setActive( m_destActive->isChecked() );
535 535
536 // Check if destination name has changed, if it has then we need to replace the key in the map 536 // Check if destination name has changed, if it has then we need to replace the key in the map
537 if ( m_destCurrName != newName ) 537 if ( m_destCurrName != newName )
538 { 538 {
539 // Update destination name 539 // Update destination name
540 destination->setName( newName ); 540 destination->setName( newName );
541 541
542 // Update list box 542 // Update list box
543 m_destList->changeItem( newName, m_destCurrent ); 543 m_destList->changeItem( newName, m_destCurrent );
544 } 544 }
545 } 545 }
546 } 546 }
547 else 547 else
548 { 548 {
549 // Add new destination to configuration list 549 // Add new destination to configuration list
550 m_configs->append( new OConfItem( QString::null, OConfItem::Destination, newName, 550 m_configs->append( new OConfItem( QString::null, OConfItem::Destination, newName,
551 m_destLocation->text(), m_destActive->isChecked() ) ); 551 m_destLocation->text(), m_destActive->isChecked() ) );
552 m_configs->sort(); 552 m_configs->sort();
553 553
554 m_destList->insertItem( newName ); 554 m_destList->insertItem( newName );
555 m_destList->setCurrentItem( m_destList->count() ); 555 m_destList->setCurrentItem( m_destList->count() );
556 m_destNew = false; 556 m_destNew = false;
557 } 557 }
558} 558}
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp
index e1c8a21..ad2fe02 100644
--- a/noncore/settings/packagemanager/opackagemanager.cpp
+++ b/noncore/settings/packagemanager/opackagemanager.cpp
@@ -1,323 +1,323 @@
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) 2003 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 29
30*/ 30*/
31 31
32#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
33 33
34#include "opackagemanager.h" 34#include "opackagemanager.h"
35#include "oipkgconfigdlg.h" 35#include "oipkgconfigdlg.h"
36 36
37OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) 37OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name )
38 : QObject( parent, name ) 38 : QObject( parent, name )
39 , m_config( config ) 39 , m_config( config )
40 , m_ipkg( m_config, this ) 40 , m_ipkg( m_config, this )
41 , m_packages( 9973 ) 41 , m_packages( 9973 )
42 , m_categories() 42 , m_categories()
43{ 43{
44 m_packages.setAutoDelete( true ); 44 m_packages.setAutoDelete( true );
45} 45}
46 46
47void OPackageManager::loadAvailablePackages() 47void OPackageManager::loadAvailablePackages()
48{ 48{
49 m_packages.clear(); 49 m_packages.clear();
50 50
51 OConfItemList *serverList = m_ipkg.servers(); 51 OConfItemList *serverList = m_ipkg.servers();
52 52
53 if ( serverList ) 53 if ( serverList )
54 { 54 {
55 // Initialize status messaging 55 // Initialize status messaging
56 emit initStatus( serverList->count() ); 56 emit initStatus( serverList->count() );
57 int serverCount = 0; 57 int serverCount = 0;
58 58
59 bool categoryAdded = false; 59 bool categoryAdded = false;
60 60
61 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) 61 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
62 { 62 {
63 OConfItem *server = serverIt.current(); 63 OConfItem *server = serverIt.current();
64 64
65 // Process server only if it is active 65 // Process server only if it is active
66 if ( server->active() ) 66 if ( server->active() )
67 { 67 {
68 // Update status 68 // Update status
69 QString status = tr( "Reading available packages:\n\t" ); 69 QString status = tr( "Reading available packages:\n\t" );
70 status.append( server->name() ); 70 status.append( server->name() );
71 emit statusText( status ); 71 emit statusText( status );
72 ++serverCount; 72 ++serverCount;
73 emit statusBar( serverCount ); 73 emit statusBar( serverCount );
74 qApp->processEvents(); 74 qApp->processEvents();
75 75
76 OPackageList *packageList = m_ipkg.availablePackages( server->name() ); 76 OPackageList *packageList = m_ipkg.availablePackages( server->name() );
77 if ( packageList ) 77 if ( packageList )
78 { 78 {
79 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) 79 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
80 { 80 {
81 OPackage *package = packageIt.current(); 81 OPackage *package = packageIt.current();
82 82
83 // Load package info 83 // Load package info
84 if ( !m_packages.find( package->name() ) ) 84 if ( !m_packages.find( package->name() ) )
85 m_packages.insert( package->name(), package ); 85 m_packages.insert( package->name(), package );
86 else 86 else
87 { 87 {
88 // If new package is newer version, replace existing package 88 // If new package is newer version, replace existing package
89 OPackage *currPackage = m_packages[package->name()]; 89 OPackage *currPackage = m_packages[package->name()];
90 if ( compareVersions( package->version(), currPackage->version() ) == 1 ) 90 if ( compareVersions( package->version(), currPackage->version() ) == 1 )
91 m_packages.replace( package->name(), package ); 91 m_packages.replace( package->name(), package );
92 } 92 }
93 93
94 // Add category to list if it doesn't already exist 94 // Add category to list if it doesn't already exist
95 if ( m_categories.grep( package->category() ).isEmpty() ) 95 if ( m_categories.grep( package->category() ).isEmpty() )
96 { 96 {
97 m_categories << package->category(); 97 m_categories << package->category();
98 categoryAdded = true; 98 categoryAdded = true;
99 } 99 }
100 } 100 }
101 } 101 }
102 } 102 }
103 } 103 }
104 delete serverList; 104 delete serverList;
105 105
106 // Sort category list if categories were added 106 // Sort category list if categories were added
107 if ( categoryAdded ) 107 if ( categoryAdded )
108 m_categories.sort(); 108 m_categories.sort();
109 } 109 }
110} 110}
111 111
112void OPackageManager::loadInstalledPackages() 112void OPackageManager::loadInstalledPackages()
113{ 113{
114 OConfItemList *destList = m_ipkg.destinations(); 114 OConfItemList *destList = m_ipkg.destinations();
115 115
116 if ( destList ) 116 if ( destList )
117 { 117 {
118 // Initialize status messaging 118 // Initialize status messaging
119 emit initStatus( destList->count() ); 119 emit initStatus( destList->count() );
120 int destCount = 0; 120 int destCount = 0;
121 121
122 bool categoryAdded = false; 122 bool categoryAdded = false;
123 123
124 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) 124 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt )
125 { 125 {
126 OConfItem *destination = destIt.current(); 126 OConfItem *destination = destIt.current();
127 127
128 // Process destination only if it is active 128 // Process destination only if it is active
129 if ( destination->active() ) 129 if ( destination->active() )
130 { 130 {
131 // Update status 131 // Update status
132 QString status = tr( "Reading installed packages:\n\t" ); 132 QString status = tr( "Reading installed packages:\n\t" );
133 status.append( destination->name() ); 133 status.append( destination->name() );
134 emit statusText( status ); 134 emit statusText( status );
135 ++destCount; 135 ++destCount;
136 emit statusBar( destCount ); 136 emit statusBar( destCount );
137 qApp->processEvents(); 137 qApp->processEvents();
138 138
139 OPackageList *packageList = m_ipkg.installedPackages( destination->name(), 139 OPackageList *packageList = m_ipkg.installedPackages( destination->name(),
140 destination->value() ); 140 destination->value() );
141 if ( packageList ) 141 if ( packageList )
142 { 142 {
143 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) 143 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
144 { 144 {
145 OPackage *package = packageIt.current(); 145 OPackage *package = packageIt.current();
146 OPackage *currPackage = m_packages[package->name()]; 146 OPackage *currPackage = m_packages[package->name()];
147 if ( currPackage ) 147 if ( currPackage )
148 { 148 {
149 // Package is in a current feed, update installed version, destination 149 // Package is in a current feed, update installed version, destination
150 currPackage->setVersionInstalled( package->versionInstalled() ); 150 currPackage->setVersionInstalled( package->versionInstalled() );
151 currPackage->setDestination( package->destination() ); 151 currPackage->setDestination( package->destination() );
152 152
153 delete package; 153 delete package;
154 } 154 }
155 else 155 else
156 { 156 {
157 // Package isn't in a current feed, add to list 157 // Package isn't in a current feed, add to list
158 m_packages.insert( package->name(), package ); 158 m_packages.insert( package->name(), package );
159 159
160 // Add category to list if it doesn't already exist 160 // Add category to list if it doesn't already exist
161 if ( m_categories.grep( package->category() ).isEmpty() ) 161 if ( m_categories.grep( package->category() ).isEmpty() )
162 { 162 {
163 m_categories << package->category(); 163 m_categories << package->category();
164 categoryAdded = true; 164 categoryAdded = true;
165 } 165 }
166 } 166 }
167 } 167 }
168 } 168 }
169 } 169 }
170 } 170 }
171 delete destList; 171 delete destList;
172 172
173 // Sort category list if categories were added 173 // Sort category list if categories were added
174 if ( categoryAdded ) 174 if ( categoryAdded )
175 m_categories.sort(); 175 m_categories.sort();
176 } 176 }
177} 177}
178 178
179OPackageList *OPackageManager::packages() 179OPackageList *OPackageManager::packages()
180{ 180{
181 // TODO - look to see if list is loaded, if not, load available & installed 181 // TODO - look to see if list is loaded, if not, load available & installed
182 182
183 OPackageList *pl = new OPackageList; 183 OPackageList *pl = new OPackageList;
184 184
185 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt ) 185 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt )
186 pl->append( packageIt.current() ); 186 pl->append( packageIt.current() );
187 187
188 return pl; 188 return pl;
189} 189}
190 190
191OPackageList *OPackageManager::filterPackages( const QString &name,const QString &server, 191OPackageList *OPackageManager::filterPackages( const QString &name,const QString &server,
192 const QString &destination, Status status, const QString &category ) 192 const QString &destination, Status status, const QString &category )
193{ 193{
194 // TODO - look to see if list is loaded, if not, load available & installed 194 // TODO - look to see if list is loaded, if not, load available & installed
195 195
196 OPackageList *pl = new OPackageList; 196 OPackageList *pl = new OPackageList;
197 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt ) 197 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt )
198 { 198 {
199 OPackage *package = packageIt.current(); 199 OPackage *package = packageIt.current();
200 200
201 bool nameMatch = ( name.isNull() || package->name().contains( name ) ); 201 bool nameMatch = ( name.isNull() || package->name().contains( name ) );
202 bool serverMatch = ( server.isNull() || package->source() == server ); 202 bool serverMatch = ( server.isNull() || package->source() == server );
203 bool destinationMatch = ( destination.isNull() || package->destination() == destination ); 203 bool destinationMatch = ( destination.isNull() || package->destination() == destination );
204 bool statusMatch; 204 bool statusMatch;
205 switch ( status ) 205 switch ( status )
206 { 206 {
207 case All : statusMatch = true; 207 case All : statusMatch = true;
208 break; 208 break;
209 case NotInstalled : statusMatch = package->versionInstalled().isNull(); 209 case NotInstalled : statusMatch = package->versionInstalled().isNull();
210 break; 210 break;
211 case Installed : statusMatch = !package->versionInstalled().isNull(); 211 case Installed : statusMatch = !package->versionInstalled().isNull();
212 break; 212 break;
213 case Updated : statusMatch = ( !package->versionInstalled().isNull() && 213 case Updated : statusMatch = ( !package->versionInstalled().isNull() &&
214 compareVersions( package->version(), package->versionInstalled() ) == 1 ); 214 compareVersions( package->version(), package->versionInstalled() ) == 1 );
215 break; 215 break;
216 default : statusMatch = true; 216 default : statusMatch = true;
217 break; 217 break;
218 }; 218 };
219 bool categoryMatch = ( category.isNull() || package->category() == category ); 219 bool categoryMatch = ( category.isNull() || package->category() == category );
220 220
221 if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch ) 221 if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch )
222 pl->append( packageIt.current() ); 222 pl->append( packageIt.current() );
223 } 223 }
224 224
225 return pl; 225 return pl;
226} 226}
227 227
228QStringList *OPackageManager::servers() 228QStringList *OPackageManager::servers()
229{ 229{
230 QStringList *sl = new QStringList(); 230 QStringList *sl = new QStringList();
231 231
232 OConfItemList *serverList = m_ipkg.servers(); 232 OConfItemList *serverList = m_ipkg.servers();
233 if ( serverList ) 233 if ( serverList )
234 { 234 {
235 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) 235 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
236 { 236 {
237 OConfItem *server = serverIt.current(); 237 OConfItem *server = serverIt.current();
238 238
239 // Add only active servers 239 // Add only active servers
240 if ( server->active() ) 240 if ( server->active() )
241 *sl << server->name(); 241 *sl << server->name();
242 } 242 }
243 } 243 }
244 244
245 return sl; 245 return sl;
246} 246}
247 247
248QStringList *OPackageManager::destinations() 248QStringList *OPackageManager::destinations()
249{ 249{
250 QStringList *dl = new QStringList(); 250 QStringList *dl = new QStringList();
251 251
252 OConfItemList *destList = m_ipkg.destinations(); 252 OConfItemList *destList = m_ipkg.destinations();
253 if ( destList ) 253 if ( destList )
254 { 254 {
255 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) 255 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt )
256 { 256 {
257 OConfItem *destination = destIt.current(); 257 OConfItem *destination = destIt.current();
258 258
259 // Add only active destinations 259 // Add only active destinations
260 if ( destination->active() ) 260 if ( destination->active() )
261 *dl << destination->name(); 261 *dl << destination->name();
262 } 262 }
263 } 263 }
264 264
265 return dl; 265 return dl;
266} 266}
267 267
268OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) 268OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name )
269{ 269{
270 OConfItem *confItem = 0x0; 270 OConfItem *confItem = 0x0;
271 OConfItemList *confList = m_ipkg.configItems(); 271 OConfItemList *confList = m_ipkg.configItems();
272 if ( confList ) 272 if ( confList )
273 { 273 {
274 for ( OConfItemListIterator confIt( *confList ); confIt.current(); ++confIt ) 274 for ( OConfItemListIterator confIt( *confList ); confIt.current(); ++confIt )
275 { 275 {
276 OConfItem *conf = confIt.current(); 276 OConfItem *conf = confIt.current();
277 277
278 // Add only active confinations 278 // Add only active confinations
279 if ( conf->type() == type && conf->name() == name ) 279 if ( conf->type() == type && conf->name() == name )
280 { 280 {
281 confItem = conf; 281 confItem = conf;
282 break; 282 break;
283 } 283 }
284 } 284 }
285 } 285 }
286 286
287 return confItem; 287 return confItem;
288 288
289} 289}
290 290
291OPackage *OPackageManager::findPackage( const QString &name ) 291OPackage *OPackageManager::findPackage( const QString &name )
292{ 292{
293 return m_packages[ name ]; 293 return m_packages[ name ];
294} 294}
295 295
296int OPackageManager::compareVersions( const QString &version1, const QString &version2 ) 296int OPackageManager::compareVersions( const QString &version1, const QString &version2 )
297{ 297{
298 // TODO - do proper compare! 298 // TODO - do proper compare!
299 if ( version1 < version2 ) 299 if ( version1 < version2 )
300 return -1; 300 return -1;
301 else if ( version1 > version2 ) 301 else if ( version1 > version2 )
302 return 1; 302 return 1;
303 303
304 return 0; 304 return 0;
305} 305}
306 306
307bool OPackageManager::configureDlg( bool installOptions ) 307bool OPackageManager::configureDlg( bool installOptions )
308{ 308{
309 OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); 309 OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) );
310 return ( dlg.exec() == QDialog::Accepted ); 310 return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
311} 311}
312 312
313void OPackageManager::saveSettings() 313void OPackageManager::saveSettings()
314{ 314{
315 m_ipkg.saveSettings(); 315 m_ipkg.saveSettings();
316} 316}
317 317
318bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages, 318bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages,
319 const QString &destination, const QObject *receiver, 319 const QString &destination, const QObject *receiver,
320 const char *slotOutput, bool rawOutput ) 320 const char *slotOutput, bool rawOutput )
321{ 321{
322 return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); 322 return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput );
323} 323}
diff --git a/noncore/settings/packagemanager/promptdlg.cpp b/noncore/settings/packagemanager/promptdlg.cpp
index bb27190..128e88e 100644
--- a/noncore/settings/packagemanager/promptdlg.cpp
+++ b/noncore/settings/packagemanager/promptdlg.cpp
@@ -1,140 +1,140 @@
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) 2003 Dan Williams <drw@handhelds.org>
5             .=l. 5             .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "promptdlg.h" 30#include "promptdlg.h"
31 31
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qlayout.h> 33#include <qlayout.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qwidgetlist.h> 35#include <qwidgetlist.h>
36 36
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38 38
39PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, 39PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2,
40 QWidget *parent ) 40 QWidget *parent )
41 : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog ) 41 : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog )
42 , m_btnClicked( -1 ) 42 , m_btnClicked( -1 )
43{ 43{
44 setCaption( caption ); 44 setCaption( caption );
45 45
46 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); 46 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 );
47 QLabel *label = new QLabel( text, this ); 47 QLabel *label = new QLabel( text, this );
48 label->setAlignment( AlignCenter | AlignTop | WordBreak ); 48 label->setAlignment( AlignCenter | AlignTop | WordBreak );
49 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 49 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
50 50
51 QPushButton *btn = new QPushButton( btn1, this ); 51 QPushButton *btn = new QPushButton( btn1, this );
52 layout->addWidget( btn, 1, 0 ); 52 layout->addWidget( btn, 1, 0 );
53 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); 53 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) );
54 54
55 btn = new QPushButton( btn2, this ); 55 btn = new QPushButton( btn2, this );
56 layout->addWidget( btn, 1, 1 ); 56 layout->addWidget( btn, 1, 1 );
57 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); 57 connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) );
58} 58}
59 59
60int PromptDlg::exec() 60int PromptDlg::display()
61{ 61{
62 // Determine position of dialog. Derived from QT's QDialog::show() method. 62 // Determine position of dialog. Derived from QT's QDialog::show() method.
63 QWidget *w = parentWidget(); 63 QWidget *w = parentWidget();
64 QPoint p( 0, 0 ); 64 QPoint p( 0, 0 );
65 int extraw = 0, extrah = 0; 65 int extraw = 0, extrah = 0;
66 QWidget * desk = QApplication::desktop(); 66 QWidget * desk = QApplication::desktop();
67 if ( w ) 67 if ( w )
68 w = w->topLevelWidget(); 68 w = w->topLevelWidget();
69 69
70 QWidgetList *list = QApplication::topLevelWidgets(); 70 QWidgetList *list = QApplication::topLevelWidgets();
71 QWidgetListIt it( *list ); 71 QWidgetListIt it( *list );
72 while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) 72 while ( (extraw == 0 || extrah == 0) && it.current() != 0 )
73 { 73 {
74 int w, h; 74 int w, h;
75 QWidget * current = it.current(); 75 QWidget * current = it.current();
76 ++it; 76 ++it;
77 w = current->geometry().x() - current->x(); 77 w = current->geometry().x() - current->x();
78 h = current->geometry().y() - current->y(); 78 h = current->geometry().y() - current->y();
79 79
80 extraw = QMAX( extraw, w ); 80 extraw = QMAX( extraw, w );
81 extrah = QMAX( extrah, h ); 81 extrah = QMAX( extrah, h );
82 } 82 }
83 delete list; 83 delete list;
84 84
85 // sanity check for decoration frames. With embedding, we 85 // sanity check for decoration frames. With embedding, we
86 // might get extraordinary values 86 // might get extraordinary values
87 if ( extraw >= 10 || extrah >= 40 ) 87 if ( extraw >= 10 || extrah >= 40 )
88 extraw = extrah = 0; 88 extraw = extrah = 0;
89 89
90 if ( w ) 90 if ( w )
91 { 91 {
92 // Use mapToGlobal rather than geometry() in case w might 92 // Use mapToGlobal rather than geometry() in case w might
93 // be embedded in another application 93 // be embedded in another application
94 QPoint pp = w->mapToGlobal( QPoint(0,0) ); 94 QPoint pp = w->mapToGlobal( QPoint(0,0) );
95 p = QPoint( pp.x() + w->width()/2, pp.y() + w->height()/ 2 ); 95 p = QPoint( pp.x() + w->width()/2, pp.y() + w->height()/ 2 );
96 } 96 }
97 else 97 else
98 p = QPoint( desk->width()/2, desk->height()/2 ); 98 p = QPoint( desk->width()/2, desk->height()/2 );
99 99
100 p = QPoint( p.x()-width()/2 - extraw, p.y()-height()/2 - extrah ); 100 p = QPoint( p.x()-width()/2 - extraw, p.y()-height()/2 - extrah );
101 101
102 if ( p.x() + extraw + width() > desk->width() ) 102 if ( p.x() + extraw + width() > desk->width() )
103 p.setX( desk->width() - width() - extraw ); 103 p.setX( desk->width() - width() - extraw );
104 if ( p.x() < 0 ) 104 if ( p.x() < 0 )
105 p.setX( 0 ); 105 p.setX( 0 );
106 106
107 if ( p.y() + extrah + height() > desk->height() ) 107 if ( p.y() + extrah + height() > desk->height() )
108 p.setY( desk->height() - height() - extrah ); 108 p.setY( desk->height() - height() - extrah );
109 if ( p.y() < 0 ) 109 if ( p.y() < 0 )
110 p.setY( 0 ); 110 p.setY( 0 );
111 111
112 move( p ); 112 move( p );
113 show(); 113 show();
114 114
115 // Enter event loop for modality 115 // Enter event loop for modality
116 qApp->enter_loop(); 116 qApp->enter_loop();
117 117
118 return m_btnClicked; 118 return m_btnClicked;
119} 119}
120 120
121int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, 121int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2,
122 QWidget *parent ) 122 QWidget *parent )
123{ 123{
124 PromptDlg *dlg = new PromptDlg( caption, text, btn1, btn2, parent ); 124 PromptDlg *dlg = new PromptDlg( caption, text, btn1, btn2, parent );
125 int rc = dlg->exec(); 125 int rc = dlg->display();
126 delete dlg; 126 delete dlg;
127 return rc; 127 return rc;
128} 128}
129 129
130void PromptDlg::slotBtn1Clicked() 130void PromptDlg::slotBtn1Clicked()
131{ 131{
132 m_btnClicked = 1; 132 m_btnClicked = 1;
133 qApp->exit_loop(); 133 qApp->exit_loop();
134} 134}
135 135
136void PromptDlg::slotBtn2Clicked() 136void PromptDlg::slotBtn2Clicked()
137{ 137{
138 m_btnClicked = 2; 138 m_btnClicked = 2;
139 qApp->exit_loop(); 139 qApp->exit_loop();
140} 140}
diff --git a/noncore/settings/packagemanager/promptdlg.h b/noncore/settings/packagemanager/promptdlg.h
index e0e9f41..790ff4d 100644
--- a/noncore/settings/packagemanager/promptdlg.h
+++ b/noncore/settings/packagemanager/promptdlg.h
@@ -1,57 +1,57 @@
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) 2003 Dan Williams <drw@handhelds.org>
5             .=l. 5             .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#ifndef PROMPTDLG_H 30#ifndef PROMPTDLG_H
31#define PROMPTDLG_H 31#define PROMPTDLG_H
32 32
33#include <qwidget.h> 33#include <qwidget.h>
34 34
35class PromptDlg : public QWidget 35class PromptDlg : public QWidget
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 38
39public: 39public:
40 PromptDlg( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, 40 PromptDlg( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0,
41 const QString &btn2 = 0x0, QWidget *parent = 0x0 ); 41 const QString &btn2 = 0x0, QWidget *parent = 0x0 );
42 42
43 int exec(); 43 int display();
44 int btnPressed() { return m_btnClicked; } 44 int btnPressed() { return m_btnClicked; }
45 45
46 static int ask( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, 46 static int ask( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0,
47 const QString &btn2 = 0x0, QWidget *parent = 0x0 ); 47 const QString &btn2 = 0x0, QWidget *parent = 0x0 );
48 48
49private: 49private:
50 int m_btnClicked; // Indicator for which button was pressed 50 int m_btnClicked; // Indicator for which button was pressed
51 51
52private slots: 52private slots:
53 void slotBtn1Clicked(); 53 void slotBtn1Clicked();
54 void slotBtn2Clicked(); 54 void slotBtn2Clicked();
55}; 55};
56 56
57#endif 57#endif