Diffstat (limited to 'noncore/settings/packagemanager/oipkgconfigdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 886430f..d9a67f3 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp | |||
@@ -80,59 +80,61 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren | |||
80 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); | 80 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); |
81 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 81 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
82 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); | 82 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); |
83 | } | 83 | } |
84 | else | 84 | else |
85 | { | 85 | { |
86 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 86 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void OIpkgConfigDlg::accept() | 90 | void OIpkgConfigDlg::accept() |
91 | { | 91 | { |
92 | // Save server, destination and proxy configuration | 92 | // Save server, destination and proxy configuration |
93 | if ( !m_installOptions ) | 93 | if ( !m_installOptions ) |
94 | { | 94 | { |
95 | // Update proxy information before saving settings | 95 | // Update proxy information before saving settings |
96 | OConfItem *confItem = findConfItem( OConfItem::Option, "http_proxy" ); | 96 | OConfItem *confItem = findConfItem( OConfItem::Option, "http_proxy" ); |
97 | if ( confItem ) | 97 | if ( confItem ) |
98 | { | 98 | { |
99 | confItem->setValue( m_proxyHttpServer->text() ); | 99 | confItem->setValue( m_proxyHttpServer->text() ); |
100 | confItem->setActive( m_proxyHttpActive->isChecked() ); | 100 | confItem->setActive( m_proxyHttpActive->isChecked() ); |
101 | } | 101 | } |
102 | else | 102 | else |
103 | m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", | 103 | m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", |
104 | m_proxyHttpServer->text(), m_proxyHttpActive->isChecked() ) ); | 104 | m_proxyHttpServer->text(), QString::null, |
105 | m_proxyHttpActive->isChecked() ) ); | ||
105 | 106 | ||
106 | confItem = findConfItem( OConfItem::Option, "ftp_proxy" ); | 107 | confItem = findConfItem( OConfItem::Option, "ftp_proxy" ); |
107 | if ( confItem ) | 108 | if ( confItem ) |
108 | { | 109 | { |
109 | confItem->setValue( m_proxyFtpServer->text() ); | 110 | confItem->setValue( m_proxyFtpServer->text() ); |
110 | confItem->setActive( m_proxyFtpActive->isChecked() ); | 111 | confItem->setActive( m_proxyFtpActive->isChecked() ); |
111 | } | 112 | } |
112 | else | 113 | else |
113 | m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", | 114 | m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", |
114 | m_proxyFtpServer->text(), m_proxyFtpActive->isChecked() ) ); | 115 | m_proxyFtpServer->text(), QString::null, |
116 | m_proxyFtpActive->isChecked() ) ); | ||
115 | 117 | ||
116 | confItem = findConfItem( OConfItem::Option, "proxy_username" ); | 118 | confItem = findConfItem( OConfItem::Option, "proxy_username" ); |
117 | if ( confItem ) | 119 | if ( confItem ) |
118 | confItem->setValue( m_proxyUsername->text() ); | 120 | confItem->setValue( m_proxyUsername->text() ); |
119 | else | 121 | else |
120 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", | 122 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", |
121 | m_proxyUsername->text() ) ); | 123 | m_proxyUsername->text() ) ); |
122 | 124 | ||
123 | confItem = findConfItem( OConfItem::Option, "proxy_password" ); | 125 | confItem = findConfItem( OConfItem::Option, "proxy_password" ); |
124 | if ( confItem ) | 126 | if ( confItem ) |
125 | confItem->setValue( m_proxyPassword->text() ); | 127 | confItem->setValue( m_proxyPassword->text() ); |
126 | else | 128 | else |
127 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", | 129 | m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", |
128 | m_proxyPassword->text() ) ); | 130 | m_proxyPassword->text() ) ); |
129 | 131 | ||
130 | m_ipkg->setConfigItems( m_configs ); | 132 | m_ipkg->setConfigItems( m_configs ); |
131 | } | 133 | } |
132 | 134 | ||
133 | // Save options configuration | 135 | // Save options configuration |
134 | int options = 0; | 136 | int options = 0; |
135 | if ( m_optForceDepends->isChecked() ) | 137 | if ( m_optForceDepends->isChecked() ) |
136 | options |= FORCE_DEPENDS; | 138 | options |= FORCE_DEPENDS; |
137 | if ( m_optForceReinstall->isChecked() ) | 139 | if ( m_optForceReinstall->isChecked() ) |
138 | options |= FORCE_REINSTALL; | 140 | options |= FORCE_REINSTALL; |
@@ -514,51 +516,52 @@ void OIpkgConfigDlg::slotServerUpdate() | |||
514 | { | 516 | { |
515 | // Find selected server in list | 517 | // Find selected server in list |
516 | OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName ); | 518 | OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName ); |
517 | 519 | ||
518 | // Delete server | 520 | // Delete server |
519 | if ( server ) | 521 | if ( server ) |
520 | { | 522 | { |
521 | // Update url | 523 | // Update url |
522 | server->setValue( m_serverLocation->text() ); | 524 | server->setValue( m_serverLocation->text() ); |
523 | server->setActive( m_serverActive->isChecked() ); | 525 | server->setActive( m_serverActive->isChecked() ); |
524 | 526 | ||
525 | // Check if server name has changed, if it has then we need to replace the key in the map | 527 | // Check if server name has changed, if it has then we need to replace the key in the map |
526 | if ( m_serverCurrName != newName ) | 528 | if ( m_serverCurrName != newName ) |
527 | { | 529 | { |
528 | // Update server name | 530 | // Update server name |
529 | server->setName( newName ); | 531 | server->setName( newName ); |
530 | 532 | ||
531 | // Update list box | 533 | // Update list box |
532 | m_serverList->changeItem( newName, m_serverCurrent ); | 534 | m_serverList->changeItem( newName, m_serverCurrent ); |
533 | } | 535 | } |
534 | } | 536 | } |
535 | } | 537 | } |
536 | else | 538 | else |
537 | { | 539 | { |
538 | // Add new destination to configuration list | 540 | // Add new server to configuration list |
539 | m_configs->append( new OConfItem( OConfItem::Source, newName, | 541 | // TODO - support src/gz |
540 | m_serverLocation->text(), m_serverActive->isChecked() ) ); | 542 | m_configs->append( new OConfItem( OConfItem::Source, newName, m_serverLocation->text(), |
543 | QString::null, m_serverActive->isChecked() ) ); | ||
541 | m_configs->sort(); | 544 | m_configs->sort(); |
542 | 545 | ||
543 | m_serverList->insertItem( newName ); | 546 | m_serverList->insertItem( newName ); |
544 | m_serverList->setCurrentItem( m_serverList->count() ); | 547 | m_serverList->setCurrentItem( m_serverList->count() ); |
545 | m_serverNew = false; | 548 | m_serverNew = false; |
546 | } | 549 | } |
547 | } | 550 | } |
548 | 551 | ||
549 | void OIpkgConfigDlg::slotDestEdit( int index ) | 552 | void OIpkgConfigDlg::slotDestEdit( int index ) |
550 | { | 553 | { |
551 | m_destNew = false; | 554 | m_destNew = false; |
552 | m_destCurrent = index; | 555 | m_destCurrent = index; |
553 | 556 | ||
554 | // Find selected destination in list | 557 | // Find selected destination in list |
555 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); | 558 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); |
556 | 559 | ||
557 | // Display destination details | 560 | // Display destination details |
558 | if ( destination ) | 561 | if ( destination ) |
559 | { | 562 | { |
560 | m_destCurrName = destination->name(); | 563 | m_destCurrName = destination->name(); |
561 | m_destName->setText( destination->name() ); | 564 | m_destName->setText( destination->name() ); |
562 | m_destLocation->setText( destination->value() ); | 565 | m_destLocation->setText( destination->value() ); |
563 | m_destActive->setChecked( destination->active() ); | 566 | m_destActive->setChecked( destination->active() ); |
564 | m_destName->setFocus(); | 567 | m_destName->setFocus(); |
@@ -609,32 +612,32 @@ void OIpkgConfigDlg::slotDestUpdate() | |||
609 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName ); | 612 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName ); |
610 | 613 | ||
611 | // Display destination details | 614 | // Display destination details |
612 | if ( destination ) | 615 | if ( destination ) |
613 | { | 616 | { |
614 | // Update url | 617 | // Update url |
615 | destination->setValue( m_destLocation->text() ); | 618 | destination->setValue( m_destLocation->text() ); |
616 | destination->setActive( m_destActive->isChecked() ); | 619 | destination->setActive( m_destActive->isChecked() ); |
617 | 620 | ||
618 | // Check if destination name has changed, if it has then we need to replace the key in the map | 621 | // Check if destination name has changed, if it has then we need to replace the key in the map |
619 | if ( m_destCurrName != newName ) | 622 | if ( m_destCurrName != newName ) |
620 | { | 623 | { |
621 | // Update destination name | 624 | // Update destination name |
622 | destination->setName( newName ); | 625 | destination->setName( newName ); |
623 | 626 | ||
624 | // Update list box | 627 | // Update list box |
625 | m_destList->changeItem( newName, m_destCurrent ); | 628 | m_destList->changeItem( newName, m_destCurrent ); |
626 | } | 629 | } |
627 | } | 630 | } |
628 | } | 631 | } |
629 | else | 632 | else |
630 | { | 633 | { |
631 | // Add new destination to configuration list | 634 | // Add new destination to configuration list |
632 | m_configs->append( new OConfItem( OConfItem::Destination, newName, | 635 | m_configs->append( new OConfItem( OConfItem::Destination, newName, |
633 | m_destLocation->text(), m_destActive->isChecked() ) ); | 636 | m_destLocation->text(), QString::null, m_destActive->isChecked() ) ); |
634 | m_configs->sort(); | 637 | m_configs->sort(); |
635 | 638 | ||
636 | m_destList->insertItem( newName ); | 639 | m_destList->insertItem( newName ); |
637 | m_destList->setCurrentItem( m_destList->count() ); | 640 | m_destList->setCurrentItem( m_destList->count() ); |
638 | m_destNew = false; | 641 | m_destNew = false; |
639 | } | 642 | } |
640 | } | 643 | } |