summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 31be213..d4f751c 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -1,150 +1,154 @@
1/*************************************************************************** 1/***************************************************************************
2 installdlgimpl.cpp - description 2 installdlgimpl.cpp - description
3 ------------------- 3 -------------------
4 begin : Mon Aug 26 2002 4 begin : Mon Aug 26 2002
5 copyright : (C) 2002 by Andy Qua 5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk 6 email : andy.qua@blueyonder.co.uk
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#ifdef QWS 18#ifdef QWS
19#include <qpe/config.h> 19#include <qpe/config.h>
20#endif 20#endif
21 21
22#include <qmultilineedit.h> 22#include <qmultilineedit.h>
23#include <qdialog.h> 23#include <qdialog.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qcheckbox.h> 25#include <qcheckbox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27 27
28 28
29#include "datamgr.h" 29#include "datamgr.h"
30#include "instoptionsimpl.h" 30#include "instoptionsimpl.h"
31#include "destination.h" 31#include "destination.h"
32#include "installdlgimpl.h" 32#include "installdlgimpl.h"
33#include "global.h" 33#include "global.h"
34 34
35InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) 35InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl )
36 : InstallDlg( parent, name, modal, fl ) 36 : InstallDlg( parent, name, modal, fl )
37{ 37{
38 dataMgr = dataManager; 38 dataMgr = dataManager;
39 vector<Destination>::iterator dit; 39 vector<Destination>::iterator dit;
40 40
41 QString defaultDest = "root"; 41 QString defaultDest = "root";
42#ifdef QWS 42#ifdef QWS
43 Config cfg( "aqpkg" ); 43 Config cfg( "aqpkg" );
44 cfg.setGroup( "settings" ); 44 cfg.setGroup( "settings" );
45 defaultDest = cfg.readEntry( "dest", "root" ); 45 defaultDest = cfg.readEntry( "dest", "root" );
46 46
47 // Grab flags - Turn MAKE_LINKS on by default (if no flags found) 47 // Grab flags - Turn MAKE_LINKS on by default (if no flags found)
48 flags = cfg.readNumEntry( "installFlags", MAKE_LINKS ); 48 flags = cfg.readNumEntry( "installFlags", MAKE_LINKS );
49#else 49#else
50 flags = 0; 50 flags = 0;
51#endif 51#endif
52 52
53 // Output text is read only 53 // Output text is read only
54 output->setReadOnly( true ); 54 output->setReadOnly( true );
55 QFont f( "helvetica" );
56 f.setPointSize( 10 );
57 output->setFont( f );
58
55 59
56 // setup destination data 60 // setup destination data
57 int defIndex = 0; 61 int defIndex = 0;
58 int i; 62 int i;
59 for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i ) 63 for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i )
60 { 64 {
61 destination->insertItem( dit->getDestinationName() ); 65 destination->insertItem( dit->getDestinationName() );
62 if ( dit->getDestinationName() == defaultDest ) 66 if ( dit->getDestinationName() == defaultDest )
63 defIndex = i; 67 defIndex = i;
64 } 68 }
65 69
66 destination->setCurrentItem( defIndex ); 70 destination->setCurrentItem( defIndex );
67 71
68 vector<QString>::iterator it; 72 vector<QString>::iterator it;
69 // setup package data 73 // setup package data
70 QString remove = "Remove\n"; 74 QString remove = "Remove\n";
71 QString install = "\nInstall\n"; 75 QString install = "\nInstall\n";
72 QString upgrade = "\nUpgrade\n"; 76 QString upgrade = "\nUpgrade\n";
73 for ( it = packageList.begin() ; it != packageList.end() ; ++it ) 77 for ( it = packageList.begin() ; it != packageList.end() ; ++it )
74 { 78 {
75 QString name = *it; 79 QString name = *it;
76 if ( name.startsWith( "I" ) ) 80 if ( name.startsWith( "I" ) )
77 { 81 {
78 installList.push_back( name.mid(1) ); 82 installList.push_back( name.mid(1) );
79 install += " " + name.mid(1) + "\n"; 83 install += " " + name.mid(1) + "\n";
80 } 84 }
81 else if ( name.startsWith( "D" ) ) 85 else if ( name.startsWith( "D" ) )
82 { 86 {
83 removeList.push_back( name.mid(1) ); 87 removeList.push_back( name.mid(1) );
84 remove += " " + name.mid(1) + "\n"; 88 remove += " " + name.mid(1) + "\n";
85 } 89 }
86 else if ( name.startsWith( "U" ) ) 90 else if ( name.startsWith( "U" ) )
87 { 91 {
88 updateList.push_back( name.mid(1) ); 92 updateList.push_back( name.mid(1) );
89 upgrade += " " + name.mid(1) + "\n"; 93 upgrade += " " + name.mid(1) + "\n";
90 } 94 }
91 } 95 }
92 96
93 output->setText( remove + install + upgrade ); 97 output->setText( remove + install + upgrade );
94 98
95 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 99 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
96} 100}
97 101
98InstallDlgImpl::~InstallDlgImpl() 102InstallDlgImpl::~InstallDlgImpl()
99{ 103{
100} 104}
101 105
102bool InstallDlgImpl :: showDlg() 106bool InstallDlgImpl :: showDlg()
103{ 107{
104 showMaximized(); 108 showMaximized();
105 bool ret = exec(); 109 bool ret = exec();
106 110
107 return ret; 111 return ret;
108} 112}
109 113
110void InstallDlgImpl :: optionsSelected() 114void InstallDlgImpl :: optionsSelected()
111{ 115{
112 InstallOptionsDlgImpl opt( flags, this, "Option", true ); 116 InstallOptionsDlgImpl opt( flags, this, "Option", true );
113 opt.exec(); 117 opt.exec();
114 118
115 // set options selected from dialog 119 // set options selected from dialog
116 flags = 0; 120 flags = 0;
117 if ( opt.forceDepends->isChecked() ) 121 if ( opt.forceDepends->isChecked() )
118 flags |= FORCE_DEPENDS; 122 flags |= FORCE_DEPENDS;
119 if ( opt.forceReinstall->isChecked() ) 123 if ( opt.forceReinstall->isChecked() )
120 flags |= FORCE_REINSTALL; 124 flags |= FORCE_REINSTALL;
121 if ( opt.forceRemove->isChecked() ) 125 if ( opt.forceRemove->isChecked() )
122 flags |= FORCE_REMOVE; 126 flags |= FORCE_REMOVE;
123 if ( opt.forceOverwrite->isChecked() ) 127 if ( opt.forceOverwrite->isChecked() )
124 flags |= FORCE_OVERWRITE; 128 flags |= FORCE_OVERWRITE;
125 if ( opt.makeLinks->isChecked() ) 129 if ( opt.makeLinks->isChecked() )
126 flags |= MAKE_LINKS; 130 flags |= MAKE_LINKS;
127 131
128#ifdef QWS 132#ifdef QWS
129 Config cfg( "aqpkg" ); 133 Config cfg( "aqpkg" );
130 cfg.setGroup( "settings" ); 134 cfg.setGroup( "settings" );
131 cfg.writeEntry( "installFlags", flags ); 135 cfg.writeEntry( "installFlags", flags );
132#endif 136#endif
133} 137}
134 138
135void InstallDlgImpl :: installSelected() 139void InstallDlgImpl :: installSelected()
136{ 140{
137 if ( btnInstall->text() == "Close" ) 141 if ( btnInstall->text() == "Close" )
138 { 142 {
139 done( 1 ); 143 done( 1 );
140 return; 144 return;
141 } 145 }
142 146
143 btnInstall->setEnabled( false ); 147 btnInstall->setEnabled( false );
144 148
145 output->setText( "" ); 149 output->setText( "" );
146 Destination *d = dataMgr->getDestination( destination->currentText() ); 150 Destination *d = dataMgr->getDestination( destination->currentText() );
147 QString dest = d->getDestinationName(); 151 QString dest = d->getDestinationName();
148 QString destDir = d->getDestinationPath(); 152 QString destDir = d->getDestinationPath();
149 153
150#ifdef QWS 154#ifdef QWS