8 files changed, 7 insertions, 14 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 0c2ea78..aedd972 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp | |||
@@ -1,144 +1,144 @@ | |||
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 "installdlg.h" | 30 | #include "installdlg.h" |
31 | 31 | ||
32 | #include <sys/vfs.h> | 32 | #include <sys/vfs.h> |
33 | 33 | ||
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <qcombobox.h> | 35 | #include <qcombobox.h> |
36 | #include <qfileinfo.h> | 36 | #include <qfileinfo.h> |
37 | #include <qgroupbox.h> | 37 | #include <qgroupbox.h> |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | #include <qmap.h> | 40 | #include <qmap.h> |
41 | #include <qmultilineedit.h> | 41 | #include <qmultilineedit.h> |
42 | #include <qpushbutton.h> | 42 | #include <qpushbutton.h> |
43 | 43 | ||
44 | #include <qpe/fileselector.h> | 44 | #include <qpe/fileselector.h> |
45 | #include <qpe/resource.h> | 45 | #include <qpe/resource.h> |
46 | #include <qpe/storage.h> | 46 | #include <qpe/storage.h> |
47 | 47 | ||
48 | #include <opie/ofiledialog.h> | 48 | #include <opie2/ofiledialog.h> |
49 | 49 | ||
50 | #include "opackagemanager.h" | 50 | #include "opackagemanager.h" |
51 | 51 | ||
52 | InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, | 52 | InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, |
53 | OPackage::Command command1, QStringList *packages1, | 53 | OPackage::Command command1, QStringList *packages1, |
54 | OPackage::Command command2, QStringList *packages2, | 54 | OPackage::Command command2, QStringList *packages2, |
55 | OPackage::Command command3, QStringList *packages3 ) | 55 | OPackage::Command command3, QStringList *packages3 ) |
56 | : QWidget( 0x0 ) | 56 | : QWidget( 0x0 ) |
57 | , m_packman( pm ) | 57 | , m_packman( pm ) |
58 | , m_numCommands( 0 ) | 58 | , m_numCommands( 0 ) |
59 | , m_currCommand( 0 ) | 59 | , m_currCommand( 0 ) |
60 | { | 60 | { |
61 | // Save command/package list information | 61 | // Save command/package list information |
62 | if ( command1 != OPackage::NotDefined ) | 62 | if ( command1 != OPackage::NotDefined ) |
63 | { | 63 | { |
64 | m_command[ m_numCommands ] = command1; | 64 | m_command[ m_numCommands ] = command1; |
65 | m_packages[ m_numCommands ] = packages1; | 65 | m_packages[ m_numCommands ] = packages1; |
66 | ++m_numCommands; | 66 | ++m_numCommands; |
67 | } | 67 | } |
68 | if ( command2 != OPackage::NotDefined ) | 68 | if ( command2 != OPackage::NotDefined ) |
69 | { | 69 | { |
70 | m_command[ m_numCommands ] = command2; | 70 | m_command[ m_numCommands ] = command2; |
71 | m_packages[ m_numCommands ] = packages2; | 71 | m_packages[ m_numCommands ] = packages2; |
72 | ++m_numCommands; | 72 | ++m_numCommands; |
73 | } | 73 | } |
74 | if ( command3 != OPackage::NotDefined ) | 74 | if ( command3 != OPackage::NotDefined ) |
75 | { | 75 | { |
76 | m_command[ m_numCommands ] = command3; | 76 | m_command[ m_numCommands ] = command3; |
77 | m_packages[ m_numCommands ] = packages3; | 77 | m_packages[ m_numCommands ] = packages3; |
78 | ++m_numCommands; | 78 | ++m_numCommands; |
79 | } | 79 | } |
80 | 80 | ||
81 | // Initialize UI | 81 | // Initialize UI |
82 | if ( parent ) | 82 | if ( parent ) |
83 | parent->setCaption( caption ); | 83 | parent->setCaption( caption ); |
84 | 84 | ||
85 | QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); | 85 | QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); |
86 | 86 | ||
87 | if ( showDestInfo ) | 87 | if ( showDestInfo ) |
88 | { | 88 | { |
89 | QLabel *label = new QLabel( tr( "Destination" ), this ); | 89 | QLabel *label = new QLabel( tr( "Destination" ), this ); |
90 | layout->addWidget( label, 0, 0 ); | 90 | layout->addWidget( label, 0, 0 ); |
91 | m_destination = new QComboBox( this ); | 91 | m_destination = new QComboBox( this ); |
92 | m_destination->insertStringList( *(m_packman->destinations()) ); | 92 | m_destination->insertStringList( *(m_packman->destinations()) ); |
93 | layout->addWidget( m_destination, 0, 1 ); | 93 | layout->addWidget( m_destination, 0, 1 ); |
94 | connect( m_destination, SIGNAL(highlighted(const QString&)), | 94 | connect( m_destination, SIGNAL(highlighted(const QString&)), |
95 | this, SLOT(slotDisplayAvailSpace(const QString&)) ); | 95 | this, SLOT(slotDisplayAvailSpace(const QString&)) ); |
96 | 96 | ||
97 | label = new QLabel( tr( "Space Avail" ), this ); | 97 | label = new QLabel( tr( "Space Avail" ), this ); |
98 | layout->addWidget( label, 1, 0 ); | 98 | layout->addWidget( label, 1, 0 ); |
99 | m_availSpace = new QLabel( this ); | 99 | m_availSpace = new QLabel( this ); |
100 | layout->addWidget( m_availSpace, 1, 1 ); | 100 | layout->addWidget( m_availSpace, 1, 1 ); |
101 | 101 | ||
102 | // TODO - select correct destination | 102 | // TODO - select correct destination |
103 | slotDisplayAvailSpace( m_destination->currentText() ); | 103 | slotDisplayAvailSpace( m_destination->currentText() ); |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
107 | m_destination = 0x0; | 107 | m_destination = 0x0; |
108 | m_availSpace = 0x0; | 108 | m_availSpace = 0x0; |
109 | } | 109 | } |
110 | 110 | ||
111 | QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); | 111 | QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); |
112 | groupBox->layout()->setSpacing( 0 ); | 112 | groupBox->layout()->setSpacing( 0 ); |
113 | groupBox->layout()->setMargin( 4 ); | 113 | groupBox->layout()->setMargin( 4 ); |
114 | 114 | ||
115 | QVBoxLayout *groupBoxLayout = new QVBoxLayout( groupBox->layout() ); | 115 | QVBoxLayout *groupBoxLayout = new QVBoxLayout( groupBox->layout() ); |
116 | m_output = new QMultiLineEdit( groupBox ); | 116 | m_output = new QMultiLineEdit( groupBox ); |
117 | m_output->setReadOnly( true ); | 117 | m_output->setReadOnly( true ); |
118 | groupBoxLayout->addWidget( m_output ); | 118 | groupBoxLayout->addWidget( m_output ); |
119 | layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 ); | 119 | layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 ); |
120 | 120 | ||
121 | m_btnStart = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Start" ), this ); | 121 | m_btnStart = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Start" ), this ); |
122 | layout->addWidget( m_btnStart, 3, 0 ); | 122 | layout->addWidget( m_btnStart, 3, 0 ); |
123 | connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) ); | 123 | connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) ); |
124 | 124 | ||
125 | m_btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); | 125 | m_btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); |
126 | layout->addWidget( m_btnOptions, 3, 1 ); | 126 | layout->addWidget( m_btnOptions, 3, 1 ); |
127 | connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) ); | 127 | connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) ); |
128 | 128 | ||
129 | // Display packages being acted upon in output widget | 129 | // Display packages being acted upon in output widget |
130 | for( int i = 0; i < m_numCommands; i++ ) | 130 | for( int i = 0; i < m_numCommands; i++ ) |
131 | { | 131 | { |
132 | if ( m_packages[ i ] ) | 132 | if ( m_packages[ i ] ) |
133 | { | 133 | { |
134 | QString lineStr = tr( "Packages to " ); | 134 | QString lineStr = tr( "Packages to " ); |
135 | 135 | ||
136 | switch( m_command[ i ] ) | 136 | switch( m_command[ i ] ) |
137 | { | 137 | { |
138 | case OPackage::Install : lineStr.append( tr( "install" ) ); | 138 | case OPackage::Install : lineStr.append( tr( "install" ) ); |
139 | break; | 139 | break; |
140 | case OPackage::Remove : lineStr.append( tr( "remove" ) ); | 140 | case OPackage::Remove : lineStr.append( tr( "remove" ) ); |
141 | break; | 141 | break; |
142 | case OPackage::Upgrade : lineStr.append( tr( "upgrade" ) ); | 142 | case OPackage::Upgrade : lineStr.append( tr( "upgrade" ) ); |
143 | break; | 143 | break; |
144 | case OPackage::Download : lineStr.append( tr( "download" ) ); | 144 | case OPackage::Download : lineStr.append( tr( "download" ) ); |
@@ -182,120 +182,120 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination ) | |||
182 | // Get destination | 182 | // Get destination |
183 | OConfItem *dest = m_packman->findConfItem( OConfItem::Destination, destination ); | 183 | OConfItem *dest = m_packman->findConfItem( OConfItem::Destination, destination ); |
184 | 184 | ||
185 | if ( dest ) | 185 | if ( dest ) |
186 | { | 186 | { |
187 | // Calculate available space | 187 | // Calculate available space |
188 | struct statfs fs; | 188 | struct statfs fs; |
189 | if ( !statfs( dest->value(), &fs ) ) | 189 | if ( !statfs( dest->value(), &fs ) ) |
190 | { | 190 | { |
191 | long mult = fs.f_bsize / 1024; | 191 | long mult = fs.f_bsize / 1024; |
192 | long div = 1024 / fs.f_bsize; | 192 | long div = 1024 / fs.f_bsize; |
193 | 193 | ||
194 | if ( !mult ) mult = 1; | 194 | if ( !mult ) mult = 1; |
195 | if ( !div ) div = 1; | 195 | if ( !div ) div = 1; |
196 | long avail = fs.f_bavail * mult / div; | 196 | long avail = fs.f_bavail * mult / div; |
197 | 197 | ||
198 | space = tr( "%1 Kb" ).arg( avail ); | 198 | space = tr( "%1 Kb" ).arg( avail ); |
199 | } | 199 | } |
200 | } | 200 | } |
201 | 201 | ||
202 | // Display available space | 202 | // Display available space |
203 | m_availSpace->setText( space ); | 203 | m_availSpace->setText( space ); |
204 | } | 204 | } |
205 | 205 | ||
206 | void InstallDlg::slotBtnStart() | 206 | void InstallDlg::slotBtnStart() |
207 | { | 207 | { |
208 | QString btnText = m_btnStart->text(); | 208 | QString btnText = m_btnStart->text(); |
209 | if ( btnText == tr( "Abort" ) ) | 209 | if ( btnText == tr( "Abort" ) ) |
210 | { | 210 | { |
211 | // Prevent unexecuted commands from executing | 211 | // Prevent unexecuted commands from executing |
212 | m_currCommand = 999; | 212 | m_currCommand = 999; |
213 | 213 | ||
214 | // Allow user to close dialog | 214 | // Allow user to close dialog |
215 | m_btnStart->setText( tr( "Close" ) ); | 215 | m_btnStart->setText( tr( "Close" ) ); |
216 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); | 216 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); |
217 | return; | 217 | return; |
218 | } | 218 | } |
219 | else if ( btnText == tr( "Close" ) ) | 219 | else if ( btnText == tr( "Close" ) ) |
220 | { | 220 | { |
221 | // TODO - force reload of package data | 221 | // TODO - force reload of package data |
222 | emit closeInstallDlg(); | 222 | emit closeInstallDlg(); |
223 | return; | 223 | return; |
224 | } | 224 | } |
225 | 225 | ||
226 | // Start was clicked, start executing | 226 | // Start was clicked, start executing |
227 | m_btnOptions->setEnabled( false ); | 227 | m_btnOptions->setEnabled( false ); |
228 | if ( m_numCommands > 1 ) | 228 | if ( m_numCommands > 1 ) |
229 | { | 229 | { |
230 | m_btnStart->setText( tr( "Abort" ) ); | 230 | m_btnStart->setText( tr( "Abort" ) ); |
231 | m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); | 231 | m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); |
232 | } | 232 | } |
233 | else | 233 | else |
234 | { | 234 | { |
235 | m_btnStart->setEnabled( false ); | 235 | m_btnStart->setEnabled( false ); |
236 | } | 236 | } |
237 | 237 | ||
238 | QString dest; | 238 | QString dest; |
239 | if ( m_destination ) | 239 | if ( m_destination ) |
240 | dest = m_destination->currentText(); | 240 | dest = m_destination->currentText(); |
241 | 241 | ||
242 | for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) | 242 | for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) |
243 | { | 243 | { |
244 | // Execute next command | 244 | // Execute next command |
245 | m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, | 245 | m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, |
246 | this, SLOT(slotOutput(char*)), true ); | 246 | this, SLOT(slotOutput(char*)), true ); |
247 | } | 247 | } |
248 | 248 | ||
249 | // All commands executed, allow user to close dialog | 249 | // All commands executed, allow user to close dialog |
250 | m_btnStart->setEnabled( true ); | 250 | m_btnStart->setEnabled( true ); |
251 | m_btnStart->setText( tr( "Close" ) ); | 251 | m_btnStart->setText( tr( "Close" ) ); |
252 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); | 252 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); |
253 | 253 | ||
254 | m_btnOptions->setEnabled( true ); | 254 | m_btnOptions->setEnabled( true ); |
255 | m_btnOptions->setText( tr( "Save output" ) ); | 255 | m_btnOptions->setText( tr( "Save output" ) ); |
256 | m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); | 256 | m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); |
257 | } | 257 | } |
258 | 258 | ||
259 | void InstallDlg::slotBtnOptions() | 259 | void InstallDlg::slotBtnOptions() |
260 | { | 260 | { |
261 | QString btnText = m_btnOptions->text(); | 261 | QString btnText = m_btnOptions->text(); |
262 | if ( btnText == tr( "Options" ) ) | 262 | if ( btnText == tr( "Options" ) ) |
263 | { | 263 | { |
264 | // Display configuration dialog (only options tab is enabled) | 264 | // Display configuration dialog (only options tab is enabled) |
265 | m_packman->configureDlg( true ); | 265 | m_packman->configureDlg( true ); |
266 | return; | 266 | return; |
267 | } | 267 | } |
268 | 268 | ||
269 | // Save output was clicked | 269 | // Save output was clicked |
270 | QMap<QString, QStringList> map; | 270 | QMap<QString, QStringList> map; |
271 | map.insert( tr( "All" ), QStringList() ); | 271 | map.insert( tr( "All" ), QStringList() ); |
272 | QStringList text; | 272 | QStringList text; |
273 | text << "text/*"; | 273 | text << "text/*"; |
274 | map.insert(tr( "Text" ), text ); | 274 | map.insert(tr( "Text" ), text ); |
275 | text << "*"; | 275 | text << "*"; |
276 | map.insert( tr( "All" ), text ); | 276 | map.insert( tr( "All" ), text ); |
277 | 277 | ||
278 | QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); | 278 | QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); |
279 | if( !filename.isEmpty() ) | 279 | if( !filename.isEmpty() ) |
280 | { | 280 | { |
281 | QString currentFileName = QFileInfo( filename ).fileName(); | 281 | QString currentFileName = QFileInfo( filename ).fileName(); |
282 | DocLnk doc; | 282 | DocLnk doc; |
283 | doc.setType( "text/plain" ); | 283 | doc.setType( "text/plain" ); |
284 | doc.setFile( filename ); | 284 | doc.setFile( filename ); |
285 | doc.setName( currentFileName ); | 285 | doc.setName( currentFileName ); |
286 | FileManager fm; | 286 | FileManager fm; |
287 | fm.saveFile( doc, m_output->text() ); | 287 | fm.saveFile( doc, m_output->text() ); |
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | void InstallDlg::slotOutput( char *msg ) | 291 | void InstallDlg::slotOutput( char *msg ) |
292 | { | 292 | { |
293 | // Allow processing of other events | 293 | // Allow processing of other events |
294 | qApp->processEvents(); | 294 | qApp->processEvents(); |
295 | 295 | ||
296 | QString lineStr = msg; | 296 | QString lineStr = msg; |
297 | if ( lineStr[lineStr.length()-1] == '\n' ) | 297 | if ( lineStr[lineStr.length()-1] == '\n' ) |
298 | lineStr.truncate( lineStr.length() - 1 ); | 298 | lineStr.truncate( lineStr.length() - 1 ); |
299 | m_output->append( lineStr ); | 299 | m_output->append( lineStr ); |
300 | m_output->setCursorPosition( m_output->numLines(), 0 ); | 300 | m_output->setCursorPosition( m_output->numLines(), 0 ); |
301 | } | 301 | } |
diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h index 7efe721..4da9cf6 100644 --- a/noncore/settings/packagemanager/installdlg.h +++ b/noncore/settings/packagemanager/installdlg.h | |||
@@ -1,87 +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) 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 INSTALLDLG_H | 30 | #ifndef INSTALLDLG_H |
31 | #define INSTALLDLG_H | 31 | #define INSTALLDLG_H |
32 | 32 | ||
33 | #include <qwidget.h> | 33 | #include <qwidget.h> |
34 | 34 | ||
35 | #include <opie/oprocess.h> | ||
36 | |||
37 | #include "opackage.h" | 35 | #include "opackage.h" |
38 | 36 | ||
39 | class QComboBox; | 37 | class QComboBox; |
40 | class QLabel; | 38 | class QLabel; |
41 | class QMultiLineEdit; | 39 | class QMultiLineEdit; |
42 | class QPushButton; | 40 | class QPushButton; |
43 | 41 | ||
44 | class OPackageManager; | 42 | class OPackageManager; |
45 | 43 | ||
46 | class InstallDlg : public QWidget | 44 | class InstallDlg : public QWidget |
47 | { | 45 | { |
48 | Q_OBJECT | 46 | Q_OBJECT |
49 | 47 | ||
50 | public: | 48 | public: |
51 | InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &caption = QString::null, | 49 | InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &caption = QString::null, |
52 | bool showDestInfo = true, | 50 | bool showDestInfo = true, |
53 | OPackage::Command command1 = OPackage::NotDefined, QStringList *packages1 = 0x0, | 51 | OPackage::Command command1 = OPackage::NotDefined, QStringList *packages1 = 0x0, |
54 | OPackage::Command command2 = OPackage::NotDefined, QStringList *packages2 = 0x0, | 52 | OPackage::Command command2 = OPackage::NotDefined, QStringList *packages2 = 0x0, |
55 | OPackage::Command command3 = OPackage::NotDefined, QStringList *packages3 = 0x0 ); | 53 | OPackage::Command command3 = OPackage::NotDefined, QStringList *packages3 = 0x0 ); |
56 | ~InstallDlg(); | 54 | ~InstallDlg(); |
57 | 55 | ||
58 | private: | 56 | private: |
59 | OPackageManager *m_packman; // Pointer to application instance of package manager | 57 | OPackageManager *m_packman; // Pointer to application instance of package manager |
60 | 58 | ||
61 | // UI controls | 59 | // UI controls |
62 | QComboBox *m_destination; // Destination selection list | 60 | QComboBox *m_destination; // Destination selection list |
63 | QLabel *m_availSpace; // Text label to display available space on selected destination | 61 | QLabel *m_availSpace; // Text label to display available space on selected destination |
64 | QMultiLineEdit *m_output; // Multi-line edit to display status | 62 | QMultiLineEdit *m_output; // Multi-line edit to display status |
65 | QPushButton *m_btnStart; // Start/abort/close button | 63 | QPushButton *m_btnStart; // Start/abort/close button |
66 | QPushButton *m_btnOptions; // Installation options button | 64 | QPushButton *m_btnOptions; // Installation options button |
67 | 65 | ||
68 | // Commands and packages to execute | 66 | // Commands and packages to execute |
69 | int m_numCommands; // Number of commands to be executed | 67 | int m_numCommands; // Number of commands to be executed |
70 | int m_currCommand; // Number of currently executing command | 68 | int m_currCommand; // Number of currently executing command |
71 | OPackage::Command m_command[3]; // List of commands to be executed | 69 | OPackage::Command m_command[3]; // List of commands to be executed |
72 | QStringList *m_packages[3]; // Lists of package names associated to commands (m_command[]) | 70 | QStringList *m_packages[3]; // Lists of package names associated to commands (m_command[]) |
73 | 71 | ||
74 | private slots: | 72 | private slots: |
75 | // UI control slots | 73 | // UI control slots |
76 | void slotDisplayAvailSpace( const QString &destination ); | 74 | void slotDisplayAvailSpace( const QString &destination ); |
77 | void slotBtnStart(); | 75 | void slotBtnStart(); |
78 | void slotBtnOptions(); | 76 | void slotBtnOptions(); |
79 | 77 | ||
80 | // Execution slots | 78 | // Execution slots |
81 | void slotOutput( char *msg ); | 79 | void slotOutput( char *msg ); |
82 | 80 | ||
83 | signals: | 81 | signals: |
84 | void closeInstallDlg(); | 82 | void closeInstallDlg(); |
85 | }; | 83 | }; |
86 | 84 | ||
87 | #endif | 85 | #endif |
diff --git a/noncore/settings/packagemanager/main.cpp b/noncore/settings/packagemanager/main.cpp index b731695..18ed644 100644 --- a/noncore/settings/packagemanager/main.cpp +++ b/noncore/settings/packagemanager/main.cpp | |||
@@ -1,34 +1,34 @@ | |||
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 "mainwindow.h" | 30 | #include "mainwindow.h" |
31 | 31 | ||
32 | #include <opie/oapplicationfactory.h> | 32 | #include <opie2/oapplicationfactory.h> |
33 | 33 | ||
34 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) | 34 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index ef8c596..88e020a 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h | |||
@@ -1,131 +1,131 @@ | |||
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 | 32 | ||
33 | #ifndef OIPKGCONFIGDLG_H | 33 | #ifndef OIPKGCONFIGDLG_H |
34 | #define OIPKGCONFIGDLG_H | 34 | #define OIPKGCONFIGDLG_H |
35 | 35 | ||
36 | #include <qdialog.h> | 36 | #include <qdialog.h> |
37 | #include <qlayout.h> | 37 | #include <qlayout.h> |
38 | 38 | ||
39 | #include <opie/otabwidget.h> | 39 | #include <opie2/otabwidget.h> |
40 | 40 | ||
41 | #include "oipkg.h" | 41 | #include "oipkg.h" |
42 | 42 | ||
43 | class QCheckBox; | 43 | class QCheckBox; |
44 | class QComboBox; | 44 | class QComboBox; |
45 | class QLineEdit; | 45 | class QLineEdit; |
46 | class QListBox; | 46 | class QListBox; |
47 | 47 | ||
48 | class OIpkgConfigDlg : public QDialog | 48 | class OIpkgConfigDlg : public QDialog |
49 | { | 49 | { |
50 | Q_OBJECT | 50 | Q_OBJECT |
51 | 51 | ||
52 | public: | 52 | public: |
53 | OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 ); | 53 | OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 ); |
54 | 54 | ||
55 | protected slots: | 55 | protected slots: |
56 | void accept(); | 56 | void accept(); |
57 | void reject(); | 57 | void reject(); |
58 | 58 | ||
59 | private: | 59 | private: |
60 | OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options | 60 | OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options |
61 | OConfItemList *m_configs; // Local list of configuration items | 61 | OConfItemList *m_configs; // Local list of configuration items |
62 | 62 | ||
63 | bool m_installOptions; // If true, will only display the Options tab | 63 | bool m_installOptions; // If true, will only display the Options tab |
64 | 64 | ||
65 | // Server cached information | 65 | // Server cached information |
66 | bool m_serverNew; // Indicates if server information is for a new server | 66 | bool m_serverNew; // Indicates if server information is for a new server |
67 | int m_serverCurrent; // Index of currently selected server in m_serverList | 67 | int m_serverCurrent; // Index of currently selected server in m_serverList |
68 | QString m_serverCurrName; // Name of currently selected server in m_serverList | 68 | QString m_serverCurrName; // Name of currently selected server in m_serverList |
69 | 69 | ||
70 | // Destination cached information | 70 | // Destination cached information |
71 | bool m_destNew; // Indicates if destination information is for a new destination | 71 | bool m_destNew; // Indicates if destination information is for a new destination |
72 | int m_destCurrent; // Index of currently selected destination in m_destList | 72 | int m_destCurrent; // Index of currently selected destination in m_destList |
73 | QString m_destCurrName; // Name of currently selected destination in m_destList | 73 | QString m_destCurrName; // Name of currently selected destination in m_destList |
74 | 74 | ||
75 | // UI controls | 75 | // UI controls |
76 | QVBoxLayout m_layout; // Main dialog layout control | 76 | QVBoxLayout m_layout; // Main dialog layout control |
77 | OTabWidget m_tabWidget; // Main tab widget control | 77 | OTabWidget m_tabWidget; // Main tab widget control |
78 | QWidget *m_serverWidget; // Widget containing server configuration controls | 78 | QWidget *m_serverWidget; // Widget containing server configuration controls |
79 | QWidget *m_destWidget; // Widget containing destination configuration controls | 79 | QWidget *m_destWidget; // Widget containing destination configuration controls |
80 | QWidget *m_proxyWidget; // Widget containing proxy configuration controls | 80 | QWidget *m_proxyWidget; // Widget containing proxy configuration controls |
81 | QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls | 81 | QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls |
82 | 82 | ||
83 | // Server configuration UI controls | 83 | // Server configuration UI controls |
84 | QListBox *m_serverList; // Server list selection | 84 | QListBox *m_serverList; // Server list selection |
85 | QLineEdit *m_serverName; // Server name edit box | 85 | QLineEdit *m_serverName; // Server name edit box |
86 | QLineEdit *m_serverLocation; // Server location URL edit box | 86 | QLineEdit *m_serverLocation; // Server location URL edit box |
87 | QCheckBox *m_serverActive; // Activate server check box | 87 | QCheckBox *m_serverActive; // Activate server check box |
88 | 88 | ||
89 | // Destination configuration UI controls | 89 | // Destination configuration UI controls |
90 | QListBox *m_destList; // Destination list selection | 90 | QListBox *m_destList; // Destination list selection |
91 | QLineEdit *m_destName; // Destination name edit box | 91 | QLineEdit *m_destName; // Destination name edit box |
92 | QLineEdit *m_destLocation; // Destination location URL edit box | 92 | QLineEdit *m_destLocation; // Destination location URL edit box |
93 | QCheckBox *m_destActive; // Activate destination check box | 93 | QCheckBox *m_destActive; // Activate destination check box |
94 | 94 | ||
95 | // Proxy server configuration UI controls | 95 | // Proxy server configuration UI controls |
96 | QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box | 96 | QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box |
97 | QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box | 97 | QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box |
98 | QLineEdit *m_proxyFtpServer; // FTP proxy server edit box | 98 | QLineEdit *m_proxyFtpServer; // FTP proxy server edit box |
99 | QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box | 99 | QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box |
100 | QLineEdit *m_proxyUsername; // Proxy server username edit box | 100 | QLineEdit *m_proxyUsername; // Proxy server username edit box |
101 | QLineEdit *m_proxyPassword; // Proxy server password edit box | 101 | QLineEdit *m_proxyPassword; // Proxy server password edit box |
102 | 102 | ||
103 | // Options configuration UI controls | 103 | // Options configuration UI controls |
104 | QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox | 104 | QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox |
105 | QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox | 105 | QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox |
106 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox | 106 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox |
107 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox | 107 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox |
108 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection | 108 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection |
109 | 109 | ||
110 | void initServerWidget(); | 110 | void initServerWidget(); |
111 | void initDestinationWidget(); | 111 | void initDestinationWidget(); |
112 | void initProxyWidget(); | 112 | void initProxyWidget(); |
113 | void initOptionsWidget(); | 113 | void initOptionsWidget(); |
114 | 114 | ||
115 | void initData(); | 115 | void initData(); |
116 | 116 | ||
117 | OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, const QString &name = 0x0 ); | 117 | OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, const QString &name = 0x0 ); |
118 | 118 | ||
119 | private slots: | 119 | private slots: |
120 | void slotServerEdit( int index ); | 120 | void slotServerEdit( int index ); |
121 | void slotServerNew(); | 121 | void slotServerNew(); |
122 | void slotServerDelete(); | 122 | void slotServerDelete(); |
123 | void slotServerUpdate(); | 123 | void slotServerUpdate(); |
124 | 124 | ||
125 | void slotDestEdit( int index ); | 125 | void slotDestEdit( int index ); |
126 | void slotDestNew(); | 126 | void slotDestNew(); |
127 | void slotDestDelete(); | 127 | void slotDestDelete(); |
128 | void slotDestUpdate(); | 128 | void slotDestUpdate(); |
129 | }; | 129 | }; |
130 | 130 | ||
131 | #endif | 131 | #endif |
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control index cad2cdd..3794748 100644 --- a/noncore/settings/packagemanager/opie-packagemanager.control +++ b/noncore/settings/packagemanager/opie-packagemanager.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-packagemanager | 1 | Package: opie-packagemanager |
2 | Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop | 2 | Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Depends: task-opie-minimal | 5 | Depends: task-opie-minimal, libopiecore2, libopieui2 |
6 | Replaces: packagemanager | 6 | Replaces: packagemanager |
7 | Architecture: arm | 7 | Architecture: arm |
8 | Maintainer: Dan Williams (drw@handhelds.org) | 8 | Maintainer: Dan Williams (drw@handhelds.org) |
9 | Description: Opie package management client | 9 | Description: Opie package management client |
10 | Version: 0.3.0$EXTRAVERSION | 10 | Version: 0.3.0$EXTRAVERSION |
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index 7daf336..7abd17e 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp | |||
@@ -1,135 +1,135 @@ | |||
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 "packageinfodlg.h" | 30 | #include "packageinfodlg.h" |
31 | #include "opackage.h" | 31 | #include "opackage.h" |
32 | #include "opackagemanager.h" | 32 | #include "opackagemanager.h" |
33 | 33 | ||
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | 36 | ||
37 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
38 | 38 | ||
39 | #include <opie/otabwidget.h> | 39 | #include <opie2/otabwidget.h> |
40 | 40 | ||
41 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) | 41 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) |
42 | : QWidget( 0x0 ) | 42 | : QWidget( 0x0 ) |
43 | , m_packman( pm ) | 43 | , m_packman( pm ) |
44 | , m_information( this ) | 44 | , m_information( this ) |
45 | , m_files( this ) | 45 | , m_files( this ) |
46 | { | 46 | { |
47 | // Initialize UI | 47 | // Initialize UI |
48 | if ( parent ) | 48 | if ( parent ) |
49 | parent->setCaption( package ); | 49 | parent->setCaption( package ); |
50 | 50 | ||
51 | QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); | 51 | QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); |
52 | 52 | ||
53 | OTabWidget *tabWidget = new OTabWidget( this ); | 53 | OTabWidget *tabWidget = new OTabWidget( this ); |
54 | layout->addWidget( tabWidget ); | 54 | layout->addWidget( tabWidget ); |
55 | 55 | ||
56 | // Information tab | 56 | // Information tab |
57 | m_information.reparent( tabWidget, QPoint( 0, 0 ) ); | 57 | m_information.reparent( tabWidget, QPoint( 0, 0 ) ); |
58 | m_information.setReadOnly( true ); | 58 | m_information.setReadOnly( true ); |
59 | tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); | 59 | tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); |
60 | 60 | ||
61 | // Retrive package information | 61 | // Retrive package information |
62 | m_package = m_packman->findPackage( package ); | 62 | m_package = m_packman->findPackage( package ); |
63 | if ( !m_package ) | 63 | if ( !m_package ) |
64 | { | 64 | { |
65 | m_information.setText( tr( "Unable to retrieve package information." ) ); | 65 | m_information.setText( tr( "Unable to retrieve package information." ) ); |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | 68 | ||
69 | // Display package information | 69 | // Display package information |
70 | if ( !m_package->information().isNull() ) | 70 | if ( !m_package->information().isNull() ) |
71 | m_information.setText( m_package->information() ); | 71 | m_information.setText( m_package->information() ); |
72 | else | 72 | else |
73 | { | 73 | { |
74 | // Package information is not cached, retrieve it | 74 | // Package information is not cached, retrieve it |
75 | QStringList list( package ); | 75 | QStringList list( package ); |
76 | m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true ); | 76 | m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true ); |
77 | } | 77 | } |
78 | 78 | ||
79 | // Files tab (display only if package is installed) | 79 | // Files tab (display only if package is installed) |
80 | if ( !m_package->versionInstalled().isNull() ) | 80 | if ( !m_package->versionInstalled().isNull() ) |
81 | { | 81 | { |
82 | QWidget *filesWidget = new QWidget( tabWidget ); | 82 | QWidget *filesWidget = new QWidget( tabWidget ); |
83 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); | 83 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); |
84 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); | 84 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); |
85 | m_files.setReadOnly( true ); | 85 | m_files.setReadOnly( true ); |
86 | filesLayout->addWidget( &m_files ); | 86 | filesLayout->addWidget( &m_files ); |
87 | 87 | ||
88 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), | 88 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), |
89 | tr( "Retrieve file list" ), filesWidget ); | 89 | tr( "Retrieve file list" ), filesWidget ); |
90 | filesLayout->addWidget( btn ); | 90 | filesLayout->addWidget( btn ); |
91 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); | 91 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); |
92 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); | 92 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); |
93 | 93 | ||
94 | tabWidget->setCurrentTab( tr( "Information" ) ); | 94 | tabWidget->setCurrentTab( tr( "Information" ) ); |
95 | 95 | ||
96 | // If file list is already cached, display | 96 | // If file list is already cached, display |
97 | if ( !m_package->files().isNull() ) | 97 | if ( !m_package->files().isNull() ) |
98 | m_files.setText( m_package->files() ); | 98 | m_files.setText( m_package->files() ); |
99 | } | 99 | } |
100 | else | 100 | else |
101 | m_files.hide(); | 101 | m_files.hide(); |
102 | } | 102 | } |
103 | 103 | ||
104 | PackageInfoDlg::~PackageInfoDlg() | 104 | PackageInfoDlg::~PackageInfoDlg() |
105 | { | 105 | { |
106 | if ( !m_package ) | 106 | if ( !m_package ) |
107 | return; | 107 | return; |
108 | 108 | ||
109 | // Cache package information | 109 | // Cache package information |
110 | if ( !m_information.text().isNull() ) | 110 | if ( !m_information.text().isNull() ) |
111 | m_package->setInformation( m_information.text() ); | 111 | m_package->setInformation( m_information.text() ); |
112 | 112 | ||
113 | // Cache package file list | 113 | // Cache package file list |
114 | if ( !m_files.text().isNull() ) | 114 | if ( !m_files.text().isNull() ) |
115 | m_package->setFiles( m_files.text() ); | 115 | m_package->setFiles( m_files.text() ); |
116 | } | 116 | } |
117 | 117 | ||
118 | void PackageInfoDlg::slotBtnFileScan() | 118 | void PackageInfoDlg::slotBtnFileScan() |
119 | { | 119 | { |
120 | m_files.clear(); | 120 | m_files.clear(); |
121 | 121 | ||
122 | QStringList list( m_package->name() ); | 122 | QStringList list( m_package->name() ); |
123 | m_packman->executeCommand( OPackage::Files, &list, QString::null, this, SLOT(slotFiles(char*)), true ); | 123 | m_packman->executeCommand( OPackage::Files, &list, QString::null, this, SLOT(slotFiles(char*)), true ); |
124 | } | 124 | } |
125 | 125 | ||
126 | void PackageInfoDlg::slotInfo( char *info ) | 126 | void PackageInfoDlg::slotInfo( char *info ) |
127 | { | 127 | { |
128 | m_information.append( info ); | 128 | m_information.append( info ); |
129 | } | 129 | } |
130 | 130 | ||
131 | void PackageInfoDlg::slotFiles( char *filelist ) | 131 | void PackageInfoDlg::slotFiles( char *filelist ) |
132 | { | 132 | { |
133 | QString str = filelist; | 133 | QString str = filelist; |
134 | 134 | ||
135 | // Skip first line of output ("Package xxx is installed...") | 135 | // Skip first line of output ("Package xxx is installed...") |
diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h index 13a15e2..7ed9f0a 100644 --- a/noncore/settings/packagemanager/packageinfodlg.h +++ b/noncore/settings/packagemanager/packageinfodlg.h | |||
@@ -1,67 +1,65 @@ | |||
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 PACKAGEINFODLG_H | 30 | #ifndef PACKAGEINFODLG_H |
31 | #define PACKAGEINFODLG_H | 31 | #define PACKAGEINFODLG_H |
32 | 32 | ||
33 | #include <qmultilineedit.h> | 33 | #include <qmultilineedit.h> |
34 | #include <qwidget.h> | 34 | #include <qwidget.h> |
35 | 35 | ||
36 | #include <opie/oprocess.h> | ||
37 | |||
38 | #include "opackage.h" | 36 | #include "opackage.h" |
39 | 37 | ||
40 | class QPushButton; | 38 | class QPushButton; |
41 | 39 | ||
42 | class OPackage; | 40 | class OPackage; |
43 | class OPackageManager; | 41 | class OPackageManager; |
44 | 42 | ||
45 | class PackageInfoDlg : public QWidget | 43 | class PackageInfoDlg : public QWidget |
46 | { | 44 | { |
47 | Q_OBJECT | 45 | Q_OBJECT |
48 | 46 | ||
49 | public: | 47 | public: |
50 | PackageInfoDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &package = QString::null ); | 48 | PackageInfoDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &package = QString::null ); |
51 | ~PackageInfoDlg(); | 49 | ~PackageInfoDlg(); |
52 | 50 | ||
53 | private: | 51 | private: |
54 | OPackageManager *m_packman; // Pointer to application instance of package manager | 52 | OPackageManager *m_packman; // Pointer to application instance of package manager |
55 | OPackage *m_package; // Pointer to package to display information for | 53 | OPackage *m_package; // Pointer to package to display information for |
56 | 54 | ||
57 | // UI controls | 55 | // UI controls |
58 | QMultiLineEdit m_information; // Multi-line edit to display package information | 56 | QMultiLineEdit m_information; // Multi-line edit to display package information |
59 | QMultiLineEdit m_files; // Multi-line edit to display package file list | 57 | QMultiLineEdit m_files; // Multi-line edit to display package file list |
60 | 58 | ||
61 | private slots: | 59 | private slots: |
62 | void slotBtnFileScan(); | 60 | void slotBtnFileScan(); |
63 | void slotInfo( char *info ); | 61 | void slotInfo( char *info ); |
64 | void slotFiles( char *filelist ); | 62 | void slotFiles( char *filelist ); |
65 | }; | 63 | }; |
66 | 64 | ||
67 | #endif | 65 | #endif |
diff --git a/noncore/settings/packagemanager/packagemanager.pro b/noncore/settings/packagemanager/packagemanager.pro index 9a64322..e05db76 100644 --- a/noncore/settings/packagemanager/packagemanager.pro +++ b/noncore/settings/packagemanager/packagemanager.pro | |||
@@ -1,38 +1,35 @@ | |||
1 | CONFIG = qt warn_on release quick-app | 1 | CONFIG = qt warn_on release quick-app |
2 | //TEMPLATE = app | ||
3 | //CONFIG += qte warn_on debug | ||
4 | //DESTDIR = $(OPIEDIR)/bin | ||
5 | 2 | ||
6 | SOURCES = opackage.cpp \ | 3 | SOURCES = opackage.cpp \ |
7 | oconfitem.cpp \ | 4 | oconfitem.cpp \ |
8 | oipkg.cpp \ | 5 | oipkg.cpp \ |
9 | oipkgconfigdlg.cpp \ | 6 | oipkgconfigdlg.cpp \ |
10 | opackagemanager.cpp \ | 7 | opackagemanager.cpp \ |
11 | mainwindow.cpp \ | 8 | mainwindow.cpp \ |
12 | installdlg.cpp \ | 9 | installdlg.cpp \ |
13 | packageinfodlg.cpp \ | 10 | packageinfodlg.cpp \ |
14 | filterdlg.cpp \ | 11 | filterdlg.cpp \ |
15 | promptdlg.cpp \ | 12 | promptdlg.cpp \ |
16 | entrydlg.cpp \ | 13 | entrydlg.cpp \ |
17 | main.cpp | 14 | main.cpp |
18 | HEADERS = opackage.h \ | 15 | HEADERS = opackage.h \ |
19 | oconfitem.h \ | 16 | oconfitem.h \ |
20 | oipkg.h \ | 17 | oipkg.h \ |
21 | oipkgconfigdlg.h \ | 18 | oipkgconfigdlg.h \ |
22 | opackagemanager.h \ | 19 | opackagemanager.h \ |
23 | mainwindow.h \ | 20 | mainwindow.h \ |
24 | installdlg.h \ | 21 | installdlg.h \ |
25 | packageinfodlg.h \ | 22 | packageinfodlg.h \ |
26 | filterdlg.h \ | 23 | filterdlg.h \ |
27 | promptdlg.h \ | 24 | promptdlg.h \ |
28 | entrydlg.h | 25 | entrydlg.h |
29 | 26 | ||
30 | DEFINES += IPKG_LIB | 27 | DEFINES += IPKG_LIB |
31 | DEFINES += HAVE_MKDTEMP | 28 | DEFINES += HAVE_MKDTEMP |
32 | TARGET = packagemanager | 29 | TARGET = packagemanager |
33 | INCLUDEPATH += $(OPIEDIR)/include $(IPKGDIR) | 30 | INCLUDEPATH += $(OPIEDIR)/include $(IPKGDIR) |
34 | DEPENDPATH += $(OPIEDIR)/include | 31 | DEPENDPATH += $(OPIEDIR)/include |
35 | LIBS += -lqpe -lopie -lipkg | 32 | LIBS += -lqpe -lopiecore2 -lopieui2 -lipkg |
36 | 33 | ||
37 | include ( $(OPIEDIR)/include.pro ) | 34 | include ( $(OPIEDIR)/include.pro ) |
38 | 35 | ||