summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/installdlg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/installdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 4a55c10..0cb30e2 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -8,69 +8,68 @@
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "installdlg.h" 30#include "installdlg.h"
31 31
32#include <sys/vfs.h> 32#include <opie2/ofiledialog.h>
33
34#include <qpe/fileselector.h>
35#include <qpe/resource.h>
36#include <qpe/storage.h>
33 37
34#include <qapplication.h> 38#include <qapplication.h>
35#include <qcombobox.h> 39#include <qcombobox.h>
36#include <qfileinfo.h> 40#include <qfileinfo.h>
37#include <qgroupbox.h> 41#include <qgroupbox.h>
38#include <qlabel.h> 42#include <qlabel.h>
39#include <qlayout.h> 43#include <qlayout.h>
40#include <qmap.h> 44#include <qmap.h>
41#include <qmultilineedit.h> 45#include <qmultilineedit.h>
42#include <qpushbutton.h> 46#include <qpushbutton.h>
43 47
44#include <qpe/fileselector.h> 48#include <sys/vfs.h>
45#include <qpe/resource.h>
46#include <qpe/storage.h>
47
48#include <opie2/ofiledialog.h>
49 49
50#include "opackagemanager.h" 50#include "opackagemanager.h"
51 51
52using namespace Opie::Ui;
53InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, 52InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo,
54 OPackage::Command command1, QStringList *packages1, 53 OPackage::Command command1, QStringList *packages1,
55 OPackage::Command command2, QStringList *packages2, 54 OPackage::Command command2, QStringList *packages2,
56 OPackage::Command command3, QStringList *packages3 ) 55 OPackage::Command command3, QStringList *packages3 )
57 : QWidget( 0x0 ) 56 : QWidget( 0x0 )
58 , m_packman( pm ) 57 , m_packman( pm )
59 , m_numCommands( 0 ) 58 , m_numCommands( 0 )
60 , m_currCommand( 0 ) 59 , m_currCommand( 0 )
61{ 60{
62 // Save command/package list information 61 // Save command/package list information
63 if ( command1 != OPackage::NotDefined ) 62 if ( command1 != OPackage::NotDefined )
64 { 63 {
65 m_command[ m_numCommands ] = command1; 64 m_command[ m_numCommands ] = command1;
66 m_packages[ m_numCommands ] = packages1; 65 m_packages[ m_numCommands ] = packages1;
67 ++m_numCommands; 66 ++m_numCommands;
68 } 67 }
69 if ( command2 != OPackage::NotDefined ) 68 if ( command2 != OPackage::NotDefined )
70 { 69 {
71 m_command[ m_numCommands ] = command2; 70 m_command[ m_numCommands ] = command2;
72 m_packages[ m_numCommands ] = packages2; 71 m_packages[ m_numCommands ] = packages2;
73 ++m_numCommands; 72 ++m_numCommands;
74 } 73 }
75 if ( command3 != OPackage::NotDefined ) 74 if ( command3 != OPackage::NotDefined )
76 { 75 {
@@ -255,48 +254,48 @@ void InstallDlg::slotBtnStart()
255 m_btnOptions->setEnabled( true ); 254 m_btnOptions->setEnabled( true );
256 m_btnOptions->setText( tr( "Save output" ) ); 255 m_btnOptions->setText( tr( "Save output" ) );
257 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); 256 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
258} 257}
259 258
260void InstallDlg::slotBtnOptions() 259void InstallDlg::slotBtnOptions()
261{ 260{
262 QString btnText = m_btnOptions->text(); 261 QString btnText = m_btnOptions->text();
263 if ( btnText == tr( "Options" ) ) 262 if ( btnText == tr( "Options" ) )
264 { 263 {
265 // Display configuration dialog (only options tab is enabled) 264 // Display configuration dialog (only options tab is enabled)
266 m_packman->configureDlg( true ); 265 m_packman->configureDlg( true );
267 return; 266 return;
268 } 267 }
269 268
270 // Save output was clicked 269 // Save output was clicked
271 QMap<QString, QStringList> map; 270 QMap<QString, QStringList> map;
272 map.insert( tr( "All" ), QStringList() ); 271 map.insert( tr( "All" ), QStringList() );
273 QStringList text; 272 QStringList text;
274 text << "text/*"; 273 text << "text/*";
275 map.insert(tr( "Text" ), text ); 274 map.insert(tr( "Text" ), text );
276 text << "*"; 275 text << "*";
277 map.insert( tr( "All" ), text ); 276 map.insert( tr( "All" ), text );
278 277
279 QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); 278 QString filename = Opie::Ui::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
280 if( !filename.isEmpty() ) 279 if( !filename.isEmpty() )
281 { 280 {
282 QString currentFileName = QFileInfo( filename ).fileName(); 281 QString currentFileName = QFileInfo( filename ).fileName();
283 DocLnk doc; 282 DocLnk doc;
284 doc.setType( "text/plain" ); 283 doc.setType( "text/plain" );
285 doc.setFile( filename ); 284 doc.setFile( filename );
286 doc.setName( currentFileName ); 285 doc.setName( currentFileName );
287 FileManager fm; 286 FileManager fm;
288 fm.saveFile( doc, m_output->text() ); 287 fm.saveFile( doc, m_output->text() );
289 } 288 }
290} 289}
291 290
292void InstallDlg::slotOutput( char *msg ) 291void InstallDlg::slotOutput( char *msg )
293{ 292{
294 // Allow processing of other events 293 // Allow processing of other events
295 qApp->processEvents(); 294 qApp->processEvents();
296 295
297 QString lineStr = msg; 296 QString lineStr = msg;
298 if ( lineStr[lineStr.length()-1] == '\n' ) 297 if ( lineStr[lineStr.length()-1] == '\n' )
299 lineStr.truncate( lineStr.length() - 1 ); 298 lineStr.truncate( lineStr.length() - 1 );
300 m_output->append( lineStr ); 299 m_output->append( lineStr );
301 m_output->setCursorPosition( m_output->numLines(), 0 ); 300 m_output->setCursorPosition( m_output->numLines(), 0 );
302} 301}