summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oipkgconfigdlg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/oipkgconfigdlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp68
1 files changed, 52 insertions, 16 deletions
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index e6d6a81..7ee2d74 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -130,2 +130,9 @@ void OIpkgConfigDlg::accept()
130 130
131 confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" );
132 if ( confItem )
133 confItem->setValue( m_optSourceLists->text() );
134 else
135 m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
136 m_optSourceLists->text(), "name" ) );
137
131 m_ipkg->setConfigItems( m_configs ); 138 m_ipkg->setConfigItems( m_configs );
@@ -299,3 +306,3 @@ void OIpkgConfigDlg::initOptionsWidget()
299 sv->addChild( container ); 306 sv->addChild( container );
300 QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); 307 QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 );
301 308
@@ -303,3 +310,3 @@ void OIpkgConfigDlg::initOptionsWidget()
303 QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); 310 QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) );
304 layout->addWidget( m_optForceDepends ); 311 layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 );
305 312
@@ -307,3 +314,3 @@ void OIpkgConfigDlg::initOptionsWidget()
307 QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); 314 QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) );
308 layout->addWidget( m_optForceReinstall ); 315 layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 );
309 316
@@ -311,3 +318,3 @@ void OIpkgConfigDlg::initOptionsWidget()
311 QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); 318 QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) );
312 layout->addWidget( m_optForceRemove ); 319 layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 );
313 320
@@ -315,7 +322,7 @@ void OIpkgConfigDlg::initOptionsWidget()
315 QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); 322 QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) );
316 layout->addWidget( m_optForceOverwrite ); 323 layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 );
317 324
318 QLabel *l = new QLabel( tr( "Information Level" ), container ); 325 QLabel *l = new QLabel( tr( "Information level:" ), container );
319 QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); 326 QWhatsThis::add( l, tr( "Select information level for Ipkg." ) );
320 layout->addWidget( l ); 327 layout->addMultiCellWidget( l, 4, 4, 0, 1 );
321 328
@@ -327,3 +334,16 @@ void OIpkgConfigDlg::initOptionsWidget()
327 m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); 334 m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) );
328 layout->addWidget( m_optVerboseIpkg ); 335 layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 );
336
337 l = new QLabel( tr( "Package source lists directory:" ), container );
338 QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) );
339 layout->addMultiCellWidget( l, 6, 6, 0, 1 );
340
341 m_optSourceLists = new QLineEdit( container );
342 QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) );
343 layout->addWidget( m_optSourceLists, 7, 0 );
344 QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container );
345 btn->setMaximumWidth( btn->height() );
346 QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) );
347 connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) );
348 layout->addWidget( btn, 7, 1 );
329 349
@@ -347,11 +367,7 @@ void OIpkgConfigDlg::initData()
347 { 367 {
348 if ( config->type() == OConfItem::Source ) 368 switch ( config->type() )
349 {
350 m_serverList->insertItem( config->name() );
351 }
352 else if ( config->type() == OConfItem::Destination )
353 { 369 {
354 m_destList->insertItem( config->name() ); 370 case OConfItem::Source : m_serverList->insertItem( config->name() ); break;
355 } 371 case OConfItem::Destination : m_destList->insertItem( config->name() ); break;
356 else if ( config->type() == OConfItem::Option ) 372 case OConfItem::Option :
357 { 373 {
@@ -376,2 +392,13 @@ void OIpkgConfigDlg::initData()
376 } 392 }
393 break;
394 case OConfItem::Other :
395 {
396 if ( config->name() == "lists_dir" )
397 m_optSourceLists->setText( config->value() );
398 else // TODO - use proper libipkg define
399 m_optSourceLists->setText( "/usr/lib/ipkg/lists" );
400 }
401 break;
402 default : break;
403 };
377 } 404 }
@@ -515,2 +542,11 @@ void OIpkgConfigDlg::slotDestDelete()
515 542
543void OIpkgConfigDlg::slotOptSelectSourceListsPath()
544{
545 QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_optSourceLists->text() );
546 if ( path.at( path.length() - 1 ) == '/' )
547 path.truncate( path.length() - 1 );
548 if ( !path.isNull() )
549 m_optSourceLists->setText( path );
550}
551
516OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) 552OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent )