summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/installdlgimpl.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 1f0bb5f..2bb8b4d 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -138,143 +138,144 @@ InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, const char *tit
138} 138}
139 139
140 140
141InstallDlgImpl::~InstallDlgImpl() 141InstallDlgImpl::~InstallDlgImpl()
142{ 142{
143 if ( pIpkg ) 143 if ( pIpkg )
144 delete pIpkg; 144 delete pIpkg;
145} 145}
146 146
147void InstallDlgImpl :: init( bool displayextrainfo ) 147void InstallDlgImpl :: init( bool displayextrainfo )
148{ 148{
149 QGridLayout *layout = new QGridLayout( this ); 149 QGridLayout *layout = new QGridLayout( this );
150 layout->setSpacing( 4 ); 150 layout->setSpacing( 4 );
151 layout->setMargin( 4 ); 151 layout->setMargin( 4 );
152 152
153 if ( displayextrainfo ) 153 if ( displayextrainfo )
154 { 154 {
155 QLabel *label = new QLabel( tr( "Destination" ), this ); 155 QLabel *label = new QLabel( tr( "Destination" ), this );
156 layout->addWidget( label, 0, 0 ); 156 layout->addWidget( label, 0, 0 );
157 destination = new QComboBox( FALSE, this ); 157 destination = new QComboBox( FALSE, this );
158 layout->addWidget( destination, 0, 1 ); 158 layout->addWidget( destination, 0, 1 );
159 connect( destination, SIGNAL( highlighted( const QString & ) ), 159 connect( destination, SIGNAL( highlighted( const QString & ) ),
160 this, SLOT( displayAvailableSpace( const QString & ) ) ); 160 this, SLOT( displayAvailableSpace( const QString & ) ) );
161 161
162 QLabel *label2 = new QLabel( tr( "Space Avail" ), this ); 162 QLabel *label2 = new QLabel( tr( "Space Avail" ), this );
163 layout->addWidget( label2, 1, 0 ); 163 layout->addWidget( label2, 1, 0 );
164 txtAvailableSpace = new QLabel( "", this ); 164 txtAvailableSpace = new QLabel( "", this );
165 layout->addWidget( txtAvailableSpace, 1, 1 ); 165 layout->addWidget( txtAvailableSpace, 1, 1 );
166 } 166 }
167 else 167 else
168 { 168 {
169 destination = 0x0; 169 destination = 0x0;
170 txtAvailableSpace = 0x0; 170 txtAvailableSpace = 0x0;
171 } 171 }
172 172
173 QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); 173 QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this );
174 GroupBox2->layout()->setSpacing( 0 ); 174 GroupBox2->layout()->setSpacing( 0 );
175 GroupBox2->layout()->setMargin( 4 ); 175 GroupBox2->layout()->setMargin( 4 );
176 176
177 QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() ); 177 QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() );
178 output = new QMultiLineEdit( GroupBox2 ); 178 output = new QMultiLineEdit( GroupBox2 );
179 GroupBox2Layout->addWidget( output ); 179 GroupBox2Layout->addWidget( output );
180 layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 ); 180 layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 );
181 181
182 btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this ); 182 btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this );
183 layout->addWidget( btnInstall, 3, 0 ); 183 layout->addWidget( btnInstall, 3, 0 );
184 connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); 184 connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) );
185 185
186 btnOptions = new QPushButton( Resource::loadPixmap( "aqpkg/config" ), tr( "Options" ), this ); 186 btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this );
187 layout->addWidget( btnOptions, 3, 1 ); 187 layout->addWidget( btnOptions, 3, 1 );
188 connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) ); 188 connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) );
189} 189}
190 190
191void InstallDlgImpl :: optionsSelected() 191void InstallDlgImpl :: optionsSelected()
192{ 192{
193 InstallOptionsDlgImpl opt( flags, this, "Option", true ); 193 InstallOptionsDlgImpl opt( flags, this, "Option", true );
194 opt.exec(); 194 opt.exec();
195 195
196 // set options selected from dialog 196 // set options selected from dialog
197 flags = opt.getFlags(); 197 flags = opt.getFlags();
198 198
199#ifdef QWS 199#ifdef QWS
200 Config cfg( "aqpkg" ); 200 Config cfg( "aqpkg" );
201 cfg.setGroup( "settings" ); 201 cfg.setGroup( "settings" );
202 cfg.writeEntry( "installFlags", flags ); 202 cfg.writeEntry( "installFlags", flags );
203#endif 203#endif
204} 204}
205 205
206void InstallDlgImpl :: installSelected() 206void InstallDlgImpl :: installSelected()
207{ 207{
208 if ( btnInstall->text() == tr( "Abort" ) ) 208 if ( btnInstall->text() == tr( "Abort" ) )
209 { 209 {
210 if ( pIpkg ) 210 if ( pIpkg )
211 { 211 {
212 displayText( tr( "\n**** User Clicked ABORT ***" ) ); 212 displayText( tr( "\n**** User Clicked ABORT ***" ) );
213 pIpkg->abort(); 213 pIpkg->abort();
214 displayText( tr( "**** Process Aborted ****" ) ); 214 displayText( tr( "**** Process Aborted ****" ) );
215 } 215 }
216 216
217 btnInstall->setText( tr( "Close" ) ); 217 btnInstall->setText( tr( "Close" ) );
218 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); 218 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
219 return; 219 return;
220 } 220 }
221 else if ( btnInstall->text() == tr( "Close" ) ) 221 else if ( btnInstall->text() == tr( "Close" ) )
222 { 222 {
223 emit reloadData( this ); 223 emit reloadData( this );
224 return; 224 return;
225 } 225 }
226 226
227 // Disable buttons 227 // Disable buttons
228 btnOptions->setEnabled( false ); 228 btnOptions->setEnabled( false );
229// btnInstall->setEnabled( false ); 229// btnInstall->setEnabled( false );
230 230
231 btnInstall->setText( tr( "Abort" ) ); 231 btnInstall->setText( tr( "Abort" ) );
232 btnInstall->setIconSet( Resource::loadPixmap( "close" ) ); 232 btnInstall->setIconSet( Resource::loadPixmap( "close" ) );
233
233 if ( pIpkg ) 234 if ( pIpkg )
234 { 235 {
235 output->setText( "" ); 236 output->setText( "" );
236 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 237 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
237 pIpkg->runIpkg(); 238 pIpkg->runIpkg();
238 } 239 }
239 else 240 else
240 { 241 {
241 output->setText( "" ); 242 output->setText( "" );
242 Destination *d = dataMgr->getDestination( destination->currentText() ); 243 Destination *d = dataMgr->getDestination( destination->currentText() );
243 QString dest = d->getDestinationName(); 244 QString dest = d->getDestinationName();
244 QString destDir = d->getDestinationPath(); 245 QString destDir = d->getDestinationPath();
245 int instFlags = flags; 246 int instFlags = flags;
246 if ( d->linkToRoot() ) 247 if ( d->linkToRoot() )
247 instFlags |= MAKE_LINKS; 248 instFlags |= MAKE_LINKS;
248 249
249#ifdef QWS 250#ifdef QWS
250 // Save settings 251 // Save settings
251 Config cfg( "aqpkg" ); 252 Config cfg( "aqpkg" );
252 cfg.setGroup( "settings" ); 253 cfg.setGroup( "settings" );
253 cfg.writeEntry( "dest", dest ); 254 cfg.writeEntry( "dest", dest );
254#endif 255#endif
255 256
256 pIpkg = new Ipkg; 257 pIpkg = new Ipkg;
257 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 258 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
258 259
259 // First run through the remove list, then the install list then the upgrade list 260 // First run through the remove list, then the install list then the upgrade list
260 pIpkg->setOption( "remove" ); 261 pIpkg->setOption( "remove" );
261 QListIterator<InstallData> it( removeList ); 262 QListIterator<InstallData> it( removeList );
262 InstallData *idata; 263 InstallData *idata;
263 for ( ; it.current(); ++it ) 264 for ( ; it.current(); ++it )
264 { 265 {
265 idata = it.current(); 266 idata = it.current();
266 pIpkg->setDestination( idata->destination->getDestinationName() ); 267 pIpkg->setDestination( idata->destination->getDestinationName() );
267 pIpkg->setDestinationDir( idata->destination->getDestinationPath() ); 268 pIpkg->setDestinationDir( idata->destination->getDestinationPath() );
268 pIpkg->setPackage( idata->packageName ); 269 pIpkg->setPackage( idata->packageName );
269 270
270 int tmpFlags = flags; 271 int tmpFlags = flags;
271 if ( idata->destination->linkToRoot() ) 272 if ( idata->destination->linkToRoot() )
272 tmpFlags |= MAKE_LINKS; 273 tmpFlags |= MAKE_LINKS;
273 274
274 pIpkg->setFlags( tmpFlags ); 275 pIpkg->setFlags( tmpFlags );
275 pIpkg->runIpkg(); 276 pIpkg->runIpkg();
276 } 277 }
277 278
278 pIpkg->setOption( "install" ); 279 pIpkg->setOption( "install" );
279 pIpkg->setDestination( dest ); 280 pIpkg->setDestination( dest );
280 pIpkg->setDestinationDir( destDir ); 281 pIpkg->setDestinationDir( destDir );