author | drw <drw> | 2005-02-22 22:25:39 (UTC) |
---|---|---|
committer | drw <drw> | 2005-02-22 22:25:39 (UTC) |
commit | 504c5f59c082106028e3dbc9126d7b655908224f (patch) (unidiff) | |
tree | 2cf4465cb2a46b0d13f909d073225585ad4e5092 /noncore | |
parent | a2eea1c6273acd16fed2406493923c52fba19ebc (diff) | |
download | opie-504c5f59c082106028e3dbc9126d7b655908224f.zip opie-504c5f59c082106028e3dbc9126d7b655908224f.tar.gz opie-504c5f59c082106028e3dbc9126d7b655908224f.tar.bz2 |
Add support for lists_dir ipkg configuration option, optimize ipkg configuration file read routine, update version to 0.6.2
-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 7 | ||||
-rw-r--r-- | noncore/settings/packagemanager/README | 6 | ||||
-rw-r--r-- | noncore/settings/packagemanager/TODO | 6 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oconfitem.h | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 117 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 138 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.h | 7 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opie-packagemanager.control | 2 |
8 files changed, 177 insertions, 108 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index 38756b1..92b542c 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog | |||
@@ -1,3 +1,10 @@ | |||
1 | 2005-02-22 Dan Williams <drw@handhelds.org> | ||
2 | |||
3 | * Released version 0.6.2 | ||
4 | * Added support for ipkg configuration option, 'lists_dir' | ||
5 | * Make app depend on libipkg-0.99.143, or greater | ||
6 | * Optimize ipkg configuration file read routine | ||
7 | |||
1 | 2005-02-16 Dan Williams <drw@handhelds.org> | 8 | 2005-02-16 Dan Williams <drw@handhelds.org> |
2 | 9 | ||
3 | * Fixed stupid bug where last package in status file was not shown as installed when it should be | 10 | * Fixed stupid bug where last package in status file was not shown as installed when it should be |
diff --git a/noncore/settings/packagemanager/README b/noncore/settings/packagemanager/README index ff6d113..9720cb4 100644 --- a/noncore/settings/packagemanager/README +++ b/noncore/settings/packagemanager/README | |||
@@ -2,14 +2,14 @@ | |||
2 | /* | 2 | /* |
3 | /* Opie - Package Manager | 3 | /* Opie - Package Manager |
4 | /* ======================== | 4 | /* ======================== |
5 | /* Version 0.6.0 | 5 | /* Version 0.6.2 |
6 | /* | 6 | /* |
7 | /* A package management client for Opie | 7 | /* A package management client for Opie |
8 | /* | 8 | /* |
9 | /************************************************************************ | 9 | /************************************************************************ |
10 | 10 | ||
11 | ------------------------------------------------------- | 11 | ------------------------------------------------------- |
12 | Release Notes for Opie-PackageManager - January, 2004 | 12 | Release Notes for Opie-PackageManager - February, 2004 |
13 | ------------------------------------------------------- | 13 | ------------------------------------------------------- |
14 | 14 | ||
15 | ====================== | 15 | ====================== |
@@ -44,7 +44,7 @@ the build system along with the appropriate headers. | |||
44 | = Credits = | 44 | = Credits = |
45 | ====================== | 45 | ====================== |
46 | 46 | ||
47 | - Opie-PackageManager is (C) 2003-2004 Dan Williams | 47 | - Opie-PackageManager is (C) 2003-2005 Dan Williams |
48 | 48 | ||
49 | ====================== | 49 | ====================== |
50 | = Links = | 50 | = Links = |
diff --git a/noncore/settings/packagemanager/TODO b/noncore/settings/packagemanager/TODO index 2512624..dd70b11 100644 --- a/noncore/settings/packagemanager/TODO +++ b/noncore/settings/packagemanager/TODO | |||
@@ -2,14 +2,12 @@ | |||
2 | /* | 2 | /* |
3 | /* Opie - Package Manager | 3 | /* Opie - Package Manager |
4 | /* ======================== | 4 | /* ======================== |
5 | /* Version 0.6.1 | 5 | /* Version 0.6.2 |
6 | /* | 6 | /* |
7 | /* A package management client for Opie | 7 | /* A package management client for Opie |
8 | /* | 8 | /* |
9 | /************************************************************************ | 9 | /************************************************************************ |
10 | 10 | ||
11 | ----------------------------------------------- | 11 | ----------------------------------------------- |
12 | To-do for Opie-PackageManager - January, 2005 | 12 | To-do for Opie-PackageManager - February, 2005 |
13 | ----------------------------------------------- | 13 | ----------------------------------------------- |
14 | |||
15 | 1. Re-work package download dialog | ||
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index 9972c00..b306e93 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h | |||
@@ -38,7 +38,7 @@ _;:, .> :=|. This program is free software; you can | |||
38 | class OConfItem | 38 | class OConfItem |
39 | { | 39 | { |
40 | public: | 40 | public: |
41 | enum Type { Source, Destination, Option, Arch, NotDefined }; | 41 | enum Type { Source, Destination, Option, Arch, Other, NotDefined }; |
42 | 42 | ||
43 | OConfItem( Type type = NotDefined, const QString &name = QString::null, | 43 | OConfItem( Type type = NotDefined, const QString &name = QString::null, |
44 | const QString &value = QString::null, const QString &features = QString::null, | 44 | const QString &value = QString::null, const QString &features = QString::null, |
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index e7e292e..3d2c621 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp | |||
@@ -152,6 +152,7 @@ void OIpkg::setConfigItems( OConfItemList *configList ) | |||
152 | if ( item->type() != OConfItem::NotDefined ) | 152 | if ( item->type() != OConfItem::NotDefined ) |
153 | { | 153 | { |
154 | QString confLine; | 154 | QString confLine; |
155 | QString name = item->name(); | ||
155 | if ( !item->active() ) | 156 | if ( !item->active() ) |
156 | confLine = "#"; | 157 | confLine = "#"; |
157 | 158 | ||
@@ -160,18 +161,28 @@ void OIpkg::setConfigItems( OConfItemList *configList ) | |||
160 | case OConfItem::Source : | 161 | case OConfItem::Source : |
161 | { | 162 | { |
162 | if ( item->features().contains( "Compressed" ) ) | 163 | if ( item->features().contains( "Compressed" ) ) |
163 | confLine.append( "src/gz " ); | 164 | confLine.append( "src/gz" ); |
164 | else | 165 | else |
165 | confLine.append( "src " ); | 166 | confLine.append( "src" ); |
167 | } | ||
168 | break; | ||
169 | case OConfItem::Destination : confLine.append( "dest" ); break; | ||
170 | case OConfItem::Option : confLine.append( "option" ); break; | ||
171 | case OConfItem::Arch : confLine.append( "arch" ); break; | ||
172 | case OConfItem::Other : | ||
173 | { | ||
174 | // For options w/type = Other, the mapping is as follows: | ||
175 | // name = typeStr (e.g. "lists_dir") | ||
176 | // value = value | ||
177 | // features = name (from configuration file) | ||
178 | confLine.append( item->name() ); | ||
179 | name = item->features(); | ||
166 | } | 180 | } |
167 | break; | 181 | break; |
168 | case OConfItem::Destination : confLine.append( "dest " ); break; | ||
169 | case OConfItem::Option : confLine.append( "option " ); break; | ||
170 | case OConfItem::Arch : confLine.append( "arch " ); break; | ||
171 | default : break; | 182 | default : break; |
172 | }; | 183 | }; |
173 | 184 | ||
174 | confStream << confLine << " " << item->name() << " " << item->value() << "\n"; | 185 | confStream << confLine << " " << name << " " << item->value() << "\n"; |
175 | } | 186 | } |
176 | } | 187 | } |
177 | 188 | ||
@@ -545,50 +556,64 @@ void OIpkg::loadConfiguration() | |||
545 | // Parse line and save info to the conf options list | 556 | // Parse line and save info to the conf options list |
546 | if ( !line.isEmpty() ) | 557 | if ( !line.isEmpty() ) |
547 | { | 558 | { |
548 | if ( !line.startsWith( "#" ) || | 559 | // Strip leading comment marker if exists |
549 | line.startsWith( "#src" ) || | 560 | bool comment = false; |
550 | line.startsWith( "#dest" ) || | 561 | if ( line.startsWith( "#" ) ) |
551 | line.startsWith( "#arch" ) || | ||
552 | line.startsWith( "#option" ) ) | ||
553 | { | 562 | { |
554 | int pos = line.find( ' ', 1 ); | 563 | line.remove( 0, 1 ); |
555 | 564 | line = line.simplifyWhiteSpace(); | |
556 | // Type | 565 | comment = true; |
557 | QString typeStr = line.left( pos ); | 566 | } |
558 | OConfItem::Type type; | ||
559 | QString features; | ||
560 | if ( typeStr == "src" || typeStr == "#src" ) | ||
561 | type = OConfItem::Source; | ||
562 | else if ( typeStr == "src/gz" || typeStr == "#src/gz" ) | ||
563 | { | ||
564 | type = OConfItem::Source; | ||
565 | features = "Compressed"; | ||
566 | } | ||
567 | else if ( typeStr == "dest" || typeStr == "#dest" ) | ||
568 | type = OConfItem::Destination; | ||
569 | else if ( typeStr == "option" || typeStr == "#option" ) | ||
570 | type = OConfItem::Option; | ||
571 | else if ( typeStr == "arch" || typeStr == "#arch" ) | ||
572 | type = OConfItem::Arch; | ||
573 | else | ||
574 | type = OConfItem::NotDefined; | ||
575 | ++pos; | ||
576 | int endpos = line.find( ' ', pos ); | ||
577 | |||
578 | // Name | ||
579 | QString name = line.mid( pos, endpos - pos ); | ||
580 | |||
581 | // Value | ||
582 | QString value = ""; | ||
583 | if ( endpos > -1 ) | ||
584 | value = line.right( line.length() - endpos - 1 ); | ||
585 | 567 | ||
586 | // Active | 568 | bool recognizedOption = true; |
587 | bool active = !line.startsWith( "#" ); | 569 | int pos = line.find( ' ', 1 ) + 1; |
570 | int endpos = line.find( ' ', pos ); | ||
571 | |||
572 | // Name | ||
573 | QString name = line.mid( pos, endpos - pos ); | ||
574 | |||
575 | // Value | ||
576 | QString value = ""; | ||
577 | if ( endpos > -1 ) | ||
578 | value = line.right( line.length() - endpos - 1 ); | ||
579 | |||
580 | // Active | ||
581 | bool active = !comment; | ||
582 | |||
583 | // Type | ||
584 | // For options w/type = Other, the mapping is as follows: | ||
585 | // name = typeStr (e.g. "lists_dir") | ||
586 | // value = value | ||
587 | // features = name (from configuration file) | ||
588 | |||
589 | QString typeStr = line.left( pos - 1 ); | ||
590 | OConfItem::Type type; | ||
591 | QString features; | ||
592 | if ( typeStr == "src" ) | ||
593 | type = OConfItem::Source; | ||
594 | else if ( typeStr == "src/gz" ) | ||
595 | { | ||
596 | type = OConfItem::Source; | ||
597 | features = "Compressed"; | ||
598 | } | ||
599 | else if ( typeStr == "dest" ) | ||
600 | type = OConfItem::Destination; | ||
601 | else if ( typeStr == "option" ) | ||
602 | type = OConfItem::Option; | ||
603 | else if ( typeStr == "arch" ) | ||
604 | type = OConfItem::Arch; | ||
605 | else if ( typeStr == "lists_dir" ) | ||
606 | { | ||
607 | type = OConfItem::Other; | ||
608 | features = name; | ||
609 | name = typeStr; | ||
610 | } | ||
611 | else | ||
612 | recognizedOption = false; | ||
588 | 613 | ||
589 | // Add to list | 614 | // Add to list |
615 | if ( recognizedOption ) | ||
590 | m_confInfo->append( new OConfItem( type, name, value, features, active ) ); | 616 | m_confInfo->append( new OConfItem( type, name, value, features, active ) ); |
591 | } | ||
592 | } | 617 | } |
593 | } | 618 | } |
594 | 619 | ||
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 | |||
@@ -128,6 +128,13 @@ void OIpkgConfigDlg::accept() | |||
128 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", | 128 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", |
129 | m_proxyPassword->text() ) ); | 129 | m_proxyPassword->text() ) ); |
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 ); |
132 | } | 139 | } |
133 | 140 | ||
@@ -183,7 +190,7 @@ void OIpkgConfigDlg::initServerWidget() | |||
183 | QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); | 190 | QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); |
184 | connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); | 191 | connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); |
185 | layout->addWidget( m_serverEditBtn, 1, 1 ); | 192 | layout->addWidget( m_serverEditBtn, 1, 1 ); |
186 | 193 | ||
187 | m_serverDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 194 | m_serverDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
188 | m_serverDeleteBtn->setEnabled( false ); | 195 | m_serverDeleteBtn->setEnabled( false ); |
189 | QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); | 196 | QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); |
@@ -221,7 +228,7 @@ void OIpkgConfigDlg::initDestinationWidget() | |||
221 | QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); | 228 | QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); |
222 | connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); | 229 | connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); |
223 | layout->addWidget( m_destEditBtn, 1, 1 ); | 230 | layout->addWidget( m_destEditBtn, 1, 1 ); |
224 | 231 | ||
225 | m_destDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 232 | m_destDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
226 | m_destDeleteBtn->setEnabled( false ); | 233 | m_destDeleteBtn->setEnabled( false ); |
227 | QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); | 234 | QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); |
@@ -297,27 +304,27 @@ void OIpkgConfigDlg::initOptionsWidget() | |||
297 | sv->setFrameStyle( QFrame::NoFrame ); | 304 | sv->setFrameStyle( QFrame::NoFrame ); |
298 | QWidget *container = new QWidget( sv->viewport() ); | 305 | QWidget *container = new QWidget( sv->viewport() ); |
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 | ||
302 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); | 309 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); |
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 | ||
306 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); | 313 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); |
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 | ||
310 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); | 317 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); |
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 | ||
314 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); | 321 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); |
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 | ||
322 | m_optVerboseIpkg = new QComboBox( container ); | 329 | m_optVerboseIpkg = new QComboBox( container ); |
323 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); | 330 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); |
@@ -325,7 +332,20 @@ void OIpkgConfigDlg::initOptionsWidget() | |||
325 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); | 332 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); |
326 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); | 333 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); |
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 | ||
330 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 350 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
331 | } | 351 | } |
@@ -345,35 +365,42 @@ void OIpkgConfigDlg::initData() | |||
345 | // Add configuration item to the appropriate dialog controls | 365 | // Add configuration item to the appropriate dialog controls |
346 | if ( config ) | 366 | if ( config ) |
347 | { | 367 | { |
348 | if ( config->type() == OConfItem::Source ) | 368 | switch ( config->type() ) |
349 | { | 369 | { |
350 | m_serverList->insertItem( config->name() ); | 370 | case OConfItem::Source : m_serverList->insertItem( config->name() ); break; |
351 | } | 371 | case OConfItem::Destination : m_destList->insertItem( config->name() ); break; |
352 | else if ( config->type() == OConfItem::Destination ) | 372 | case OConfItem::Option : |
353 | { | 373 | { |
354 | m_destList->insertItem( config->name() ); | 374 | if ( config->name() == "http_proxy" ) |
355 | } | 375 | { |
356 | else if ( config->type() == OConfItem::Option ) | 376 | m_proxyHttpServer->setText( config->value() ); |
357 | { | 377 | m_proxyHttpActive->setChecked( config->active() ); |
358 | if ( config->name() == "http_proxy" ) | 378 | } |
359 | { | 379 | else if ( config->name() == "ftp_proxy" ) |
360 | m_proxyHttpServer->setText( config->value() ); | 380 | { |
361 | m_proxyHttpActive->setChecked( config->active() ); | 381 | m_proxyFtpServer->setText( config->value() ); |
362 | } | 382 | m_proxyFtpActive->setChecked( config->active() ); |
363 | else if ( config->name() == "ftp_proxy" ) | 383 | } |
364 | { | 384 | else if ( config->name() == "proxy_username" ) |
365 | m_proxyFtpServer->setText( config->value() ); | 385 | { |
366 | m_proxyFtpActive->setChecked( config->active() ); | 386 | m_proxyUsername->setText( config->value() ); |
367 | } | 387 | } |
368 | else if ( config->name() == "proxy_username" ) | 388 | else if ( config->name() == "proxy_password" ) |
369 | { | 389 | { |
370 | m_proxyUsername->setText( config->value() ); | 390 | m_proxyPassword->setText( config->value() ); |
371 | } | 391 | } |
372 | else if ( config->name() == "proxy_password" ) | 392 | } |
373 | { | 393 | break; |
374 | m_proxyPassword->setText( config->value() ); | 394 | case OConfItem::Other : |
375 | } | 395 | { |
376 | } | 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 | } |
378 | } | 405 | } |
379 | } | 406 | } |
@@ -396,7 +423,7 @@ void OIpkgConfigDlg::initData() | |||
396 | void OIpkgConfigDlg::slotServerSelected( int index ) | 423 | void OIpkgConfigDlg::slotServerSelected( int index ) |
397 | { | 424 | { |
398 | m_serverCurrent = index; | 425 | m_serverCurrent = index; |
399 | 426 | ||
400 | // Enable Edit and Delete buttons | 427 | // Enable Edit and Delete buttons |
401 | m_serverEditBtn->setEnabled( true ); | 428 | m_serverEditBtn->setEnabled( true ); |
402 | m_serverDeleteBtn->setEnabled( true ); | 429 | m_serverDeleteBtn->setEnabled( true ); |
@@ -405,7 +432,7 @@ void OIpkgConfigDlg::slotServerSelected( int index ) | |||
405 | void OIpkgConfigDlg::slotServerNew() | 432 | void OIpkgConfigDlg::slotServerNew() |
406 | { | 433 | { |
407 | OConfItem *server = new OConfItem( OConfItem::Source ); | 434 | OConfItem *server = new OConfItem( OConfItem::Source ); |
408 | 435 | ||
409 | OIpkgServerDlg dlg( server, this ); | 436 | OIpkgServerDlg dlg( server, this ); |
410 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) | 437 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) |
411 | { | 438 | { |
@@ -456,7 +483,7 @@ void OIpkgConfigDlg::slotServerDelete() | |||
456 | void OIpkgConfigDlg::slotDestSelected( int index ) | 483 | void OIpkgConfigDlg::slotDestSelected( int index ) |
457 | { | 484 | { |
458 | m_destCurrent = index; | 485 | m_destCurrent = index; |
459 | 486 | ||
460 | // Enable Edit and Delete buttons | 487 | // Enable Edit and Delete buttons |
461 | m_destEditBtn->setEnabled( true ); | 488 | m_destEditBtn->setEnabled( true ); |
462 | m_destDeleteBtn->setEnabled( true ); | 489 | m_destDeleteBtn->setEnabled( true ); |
@@ -465,7 +492,7 @@ void OIpkgConfigDlg::slotDestSelected( int index ) | |||
465 | void OIpkgConfigDlg::slotDestNew() | 492 | void OIpkgConfigDlg::slotDestNew() |
466 | { | 493 | { |
467 | OConfItem *dest = new OConfItem( OConfItem::Destination ); | 494 | OConfItem *dest = new OConfItem( OConfItem::Destination ); |
468 | 495 | ||
469 | OIpkgDestDlg dlg( dest, this ); | 496 | OIpkgDestDlg dlg( dest, this ); |
470 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) | 497 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) |
471 | { | 498 | { |
@@ -513,13 +540,22 @@ void OIpkgConfigDlg::slotDestDelete() | |||
513 | } | 540 | } |
514 | } | 541 | } |
515 | 542 | ||
543 | void 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 | |||
516 | OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) | 552 | OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) |
517 | : QDialog( parent, QString::null, true, WStyle_ContextHelp ) | 553 | : QDialog( parent, QString::null, true, WStyle_ContextHelp ) |
518 | , m_server( server ) | 554 | , m_server( server ) |
519 | { | 555 | { |
520 | setCaption( tr( "Edit Server" ) ); | 556 | setCaption( tr( "Edit Server" ) ); |
521 | 557 | ||
522 | // Initialize UI | 558 | // Initialize UI |
523 | QVBoxLayout *layout = new QVBoxLayout( this, 2, 4 ); | 559 | QVBoxLayout *layout = new QVBoxLayout( this, 2, 4 ); |
524 | 560 | ||
525 | m_active = new QCheckBox( tr( "Active" ), this ); | 561 | m_active = new QCheckBox( tr( "Active" ), this ); |
@@ -527,7 +563,7 @@ OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) | |||
527 | layout->addWidget( m_active ); | 563 | layout->addWidget( m_active ); |
528 | 564 | ||
529 | layout->addStretch(); | 565 | layout->addStretch(); |
530 | 566 | ||
531 | QLabel *label = new QLabel( tr( "Name:" ), this ); | 567 | QLabel *label = new QLabel( tr( "Name:" ), this ); |
532 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | 568 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); |
533 | layout->addWidget( label ); | 569 | layout->addWidget( label ); |
@@ -536,7 +572,7 @@ OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) | |||
536 | layout->addWidget( m_name ); | 572 | layout->addWidget( m_name ); |
537 | 573 | ||
538 | layout->addStretch(); | 574 | layout->addStretch(); |
539 | 575 | ||
540 | label = new QLabel( tr( "Address:" ), this ); | 576 | label = new QLabel( tr( "Address:" ), this ); |
541 | QWhatsThis::add( label, tr( "Enter the URL address of this entry here." ) ); | 577 | QWhatsThis::add( label, tr( "Enter the URL address of this entry here." ) ); |
542 | layout->addWidget( label ); | 578 | layout->addWidget( label ); |
@@ -549,7 +585,7 @@ OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) | |||
549 | m_compressed = new QCheckBox( tr( "Compressed server feed" ), this ); | 585 | m_compressed = new QCheckBox( tr( "Compressed server feed" ), this ); |
550 | QWhatsThis::add( m_compressed, tr( "Tap here to indicate whether the server support compressed archives or not." ) ); | 586 | QWhatsThis::add( m_compressed, tr( "Tap here to indicate whether the server support compressed archives or not." ) ); |
551 | layout->addWidget( m_compressed ); | 587 | layout->addWidget( m_compressed ); |
552 | 588 | ||
553 | // Populate initial information | 589 | // Populate initial information |
554 | if ( m_server ) | 590 | if ( m_server ) |
555 | { | 591 | { |
@@ -580,7 +616,7 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent ) | |||
580 | { | 616 | { |
581 | setCaption( tr( "Edit Destination" ) ); | 617 | setCaption( tr( "Edit Destination" ) ); |
582 | 618 | ||
583 | // Initialize UI | 619 | // Initialize UI |
584 | QVBoxLayout *layout = new QVBoxLayout( this, 2, 4 ); | 620 | QVBoxLayout *layout = new QVBoxLayout( this, 2, 4 ); |
585 | 621 | ||
586 | m_active = new QCheckBox( tr( "Active" ), this ); | 622 | m_active = new QCheckBox( tr( "Active" ), this ); |
@@ -588,7 +624,7 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent ) | |||
588 | layout->addWidget( m_active ); | 624 | layout->addWidget( m_active ); |
589 | 625 | ||
590 | layout->addStretch(); | 626 | layout->addStretch(); |
591 | 627 | ||
592 | QLabel *label = new QLabel( tr( "Name:" ), this ); | 628 | QLabel *label = new QLabel( tr( "Name:" ), this ); |
593 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | 629 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); |
594 | layout->addWidget( label ); | 630 | layout->addWidget( label ); |
@@ -597,14 +633,14 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent ) | |||
597 | layout->addWidget( m_name ); | 633 | layout->addWidget( m_name ); |
598 | 634 | ||
599 | layout->addStretch(); | 635 | layout->addStretch(); |
600 | 636 | ||
601 | label = new QLabel( tr( "Location:" ), this ); | 637 | label = new QLabel( tr( "Location:" ), this ); |
602 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); | 638 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); |
603 | layout->addWidget( label ); | 639 | layout->addWidget( label ); |
604 | 640 | ||
605 | QHBoxLayout *layout2 = new QHBoxLayout( this, 2, 4 ); | 641 | QHBoxLayout *layout2 = new QHBoxLayout( this, 2, 4 ); |
606 | layout->addLayout( layout2 ); | 642 | layout->addLayout( layout2 ); |
607 | 643 | ||
608 | m_location = new QLineEdit( this ); | 644 | m_location = new QLineEdit( this ); |
609 | QWhatsThis::add( m_location, tr( "Enter the absolute directory path of this entry here." ) ); | 645 | QWhatsThis::add( m_location, tr( "Enter the absolute directory path of this entry here." ) ); |
610 | layout2->addWidget( m_location ); | 646 | layout2->addWidget( m_location ); |
@@ -613,7 +649,7 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent ) | |||
613 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); | 649 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); |
614 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); | 650 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); |
615 | layout2->addWidget( btn ); | 651 | layout2->addWidget( btn ); |
616 | 652 | ||
617 | // Populate initial information | 653 | // Populate initial information |
618 | if ( m_dest ) | 654 | if ( m_dest ) |
619 | { | 655 | { |
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index 0fb2e16..9e23b62 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h | |||
@@ -99,6 +99,7 @@ private: | |||
99 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox | 99 | QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox |
100 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox | 100 | QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox |
101 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection | 101 | QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection |
102 | QLineEdit *m_optSourceLists; // Ipkg source lists destination directory | ||
102 | 103 | ||
103 | void initServerWidget(); | 104 | void initServerWidget(); |
104 | void initDestinationWidget(); | 105 | void initDestinationWidget(); |
@@ -117,6 +118,8 @@ private slots: | |||
117 | void slotDestNew(); | 118 | void slotDestNew(); |
118 | void slotDestEdit(); | 119 | void slotDestEdit(); |
119 | void slotDestDelete(); | 120 | void slotDestDelete(); |
121 | |||
122 | void slotOptSelectSourceListsPath(); | ||
120 | }; | 123 | }; |
121 | 124 | ||
122 | class OIpkgServerDlg : public QDialog | 125 | class OIpkgServerDlg : public QDialog |
@@ -128,7 +131,7 @@ public: | |||
128 | 131 | ||
129 | protected slots: | 132 | protected slots: |
130 | void accept(); | 133 | void accept(); |
131 | 134 | ||
132 | private: | 135 | private: |
133 | OConfItem *m_server; | 136 | OConfItem *m_server; |
134 | 137 | ||
@@ -148,7 +151,7 @@ public: | |||
148 | 151 | ||
149 | protected slots: | 152 | protected slots: |
150 | void accept(); | 153 | void accept(); |
151 | 154 | ||
152 | private: | 155 | private: |
153 | OConfItem *m_dest; | 156 | OConfItem *m_dest; |
154 | 157 | ||
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control index 5da7a84..94348dd 100644 --- a/noncore/settings/packagemanager/opie-packagemanager.control +++ b/noncore/settings/packagemanager/opie-packagemanager.control | |||
@@ -7,4 +7,4 @@ Replaces: packagemanager | |||
7 | Architecture: arm | 7 | Architecture: arm |
8 | Maintainer: Dan Williams (drw@handhelds.org) | 8 | Maintainer: Dan Williams (drw@handhelds.org) |
9 | Description: Opie package management client | 9 | Description: Opie package management client |
10 | Version: 0.6.1$EXTRAVERSION | 10 | Version: 0.6.2$EXTRAVERSION |