summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index f0992f5..ecc97b2 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -199,57 +199,57 @@ void PmIpkg::commit( PackageList pl )
199 startDialog(); 199 startDialog();
200 200
201} 201}
202 202
203void PmIpkg::startDialog() 203void PmIpkg::startDialog()
204{ 204{
205 QDialog *d = new QDialog(); 205 installDialog = new QDialog(0,0,true);
206 QGridLayout *RunWindowLayout = new QGridLayout( d ); 206 QGridLayout *RunWindowLayout = new QGridLayout( installDialog );
207 RunWindowLayout->setSpacing( 2 ); 207 RunWindowLayout->setSpacing( 2 );
208 RunWindowLayout->setMargin( 2 ); 208 RunWindowLayout->setMargin( 2 );
209 209
210 QHBoxLayout *buttons = new QHBoxLayout; 210 QHBoxLayout *buttons = new QHBoxLayout;
211 buttons->setSpacing( 6 ); 211 buttons->setSpacing( 6 );
212 buttons->setMargin( 0 ); 212 buttons->setMargin( 0 );
213 213
214 PackageListView *plv = new PackageListView(d, "install",settings); 214 PackageListView *plv = new PackageListView(installDialog, "install",settings);
215 RunWindowLayout->addWidget( plv, 1, 0 ); 215 RunWindowLayout->addWidget( plv, 1, 0 );
216 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) 216 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
217 { 217 {
218 plv->insertItem( new PackageListItem(plv, it,settings) ); 218 plv->insertItem( new PackageListItem(plv, it,settings) );
219 } 219 }
220 for (Package *it=to_install.first(); it != 0; it=to_install.next() ) 220 for (Package *it=to_install.first(); it != 0; it=to_install.next() )
221 { 221 {
222 plv->insertItem( new PackageListItem(plv, it,settings) ); 222 plv->insertItem( new PackageListItem(plv, it,settings) );
223 } 223 }
224 QPushButton *doItButton = new QPushButton( d, "doItButton" ); 224 QPushButton *doItButton = new QPushButton( installDialog, "doItButton" );
225 doItButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, doItButton->sizePolicy().hasHeightForWidth() ) ); 225 doItButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, doItButton->sizePolicy().hasHeightForWidth() ) );
226 QFont doItButton_font( doItButton->font() ); 226 QFont doItButton_font( doItButton->font() );
227 doItButton_font.setPointSize( 8 ); 227 doItButton_font.setPointSize( 8 );
228 doItButton->setFont( doItButton_font ); 228 doItButton->setFont( doItButton_font );
229 doItButton->setText( tr( "Do all " ) ); 229 doItButton->setText( tr( "Do all " ) );
230 doItButton->setAutoResize( FALSE ); 230 doItButton->setAutoResize( FALSE );
231 buttons->addWidget( doItButton ); 231 buttons->addWidget( doItButton );
232 232
233 QPushButton *installButton = new QPushButton( d, "installButton" ); 233 QPushButton *installButton = new QPushButton( installDialog, "installButton" );
234 QFont installButton_font( installButton->font() ); 234 QFont installButton_font( installButton->font() );
235 installButton_font.setPointSize( 8 ); 235 installButton_font.setPointSize( 8 );
236 installButton->setFont( installButton_font ); 236 installButton->setFont( installButton_font );
237 installButton->setText( tr( "Install" ) ); 237 installButton->setText( tr( "Install" ) );
238 installButton->setAutoResize( TRUE ); 238 installButton->setAutoResize( TRUE );
239 buttons->addWidget( installButton ); 239 buttons->addWidget( installButton );
240 240
241 QPushButton *removeButton = new QPushButton( d, "removeButton" ); 241 QPushButton *removeButton = new QPushButton( installDialog, "removeButton" );
242 QFont removeButton_font( removeButton->font() ); 242 QFont removeButton_font( removeButton->font() );
243 removeButton_font.setPointSize( 7 ); 243 removeButton_font.setPointSize( 7 );
244 removeButton->setFont( removeButton_font ); 244 removeButton->setFont( removeButton_font );
245 removeButton->setText( tr( "Remove" ) ); 245 removeButton->setText( tr( "Remove" ) );
246 removeButton->setAutoResize( TRUE ); 246 removeButton->setAutoResize( TRUE );
247 buttons->addWidget( removeButton ); 247 buttons->addWidget( removeButton );
248 248
249 QPushButton *cancelButton = new QPushButton( d, "cancelButton" ); 249 QPushButton *cancelButton = new QPushButton( installDialog, "cancelButton" );
250 QFont cancelButton_font( cancelButton->font() ); 250 QFont cancelButton_font( cancelButton->font() );
251 cancelButton_font.setPointSize( 8 ); 251 cancelButton_font.setPointSize( 8 );
252 cancelButton->setFont( cancelButton_font ); 252 cancelButton->setFont( cancelButton_font );
253 cancelButton->setText( tr( "Cancel" ) ); 253 cancelButton->setText( tr( "Cancel" ) );
254 cancelButton->setAutoResize( TRUE ); 254 cancelButton->setAutoResize( TRUE );
255 buttons->addWidget( cancelButton ); 255 buttons->addWidget( cancelButton );
@@ -260,28 +260,29 @@ void PmIpkg::startDialog()
260 this, SLOT( doIt() ) ); 260 this, SLOT( doIt() ) );
261 connect( installButton, SIGNAL( clicked() ), 261 connect( installButton, SIGNAL( clicked() ),
262 this, SLOT( install() ) ); 262 this, SLOT( install() ) );
263 connect( removeButton, SIGNAL( clicked() ), 263 connect( removeButton, SIGNAL( clicked() ),
264 this, SLOT( remove() ) ); 264 this, SLOT( remove() ) );
265 connect( cancelButton, SIGNAL( clicked() ), 265 connect( cancelButton, SIGNAL( clicked() ),
266 d, SLOT( close() ) ); 266 installDialog, SLOT( close() ) );
267 d->showMaximized(); 267 installDialog->showMaximized();
268 d->exec(); 268 if ( installDialog->exec() ) doIt();
269 // d->close(); 269 installDialog->close();
270} 270}
271 271
272void PmIpkg::doIt() 272void PmIpkg::doIt()
273{ 273{
274 remove(); 274 remove();
275 install(); 275 install();
276} 276}
277 277
278 278
279void PmIpkg::remove() 279void PmIpkg::remove()
280{ 280{
281 if ( to_remove.count() == 0 ) return; 281 if ( to_remove.count() == 0 ) return;
282 installDialog->close();
282 show( true ); 283 show( true );
283 284
284 out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); 285 out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>");
285 286
286 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) 287 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
287 { 288 {
@@ -297,12 +298,13 @@ void PmIpkg::remove()
297} 298}
298 299
299 300
300void PmIpkg::install() 301void PmIpkg::install()
301{ 302{
302 if ( to_install.count() == 0 ) return; 303 if ( to_install.count() == 0 ) return;
304 installDialog->close();
303 show( true ); 305 show( true );
304 out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); 306 out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>");
305 for (Package *it=to_install.first(); it != 0; it=to_install.next() ) 307 for (Package *it=to_install.first(); it != 0; it=to_install.next() )
306 { 308 {
307 309
308 if ( runIpkg("install " + it->getPackageName(), it->dest() ) == 0 ) 310 if ( runIpkg("install " + it->getPackageName(), it->dest() ) == 0 )