author | tille <tille> | 2002-07-17 10:59:08 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-17 10:59:08 (UTC) |
commit | 1a6f157f6a83a73907dcd4c4da1d7b24cb19dc5c (patch) (unidiff) | |
tree | 3acd973e7c21d98aae401134aaa7fb1b8c84aa30 | |
parent | 3fed427aa17245af52574795a62249607f90b0bf (diff) | |
download | opie-1a6f157f6a83a73907dcd4c4da1d7b24cb19dc5c.zip opie-1a6f157f6a83a73907dcd4c4da1d7b24cb19dc5c.tar.gz opie-1a6f157f6a83a73907dcd4c4da1d7b24cb19dc5c.tar.bz2 |
added destination toolbar
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 24 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettingsbase.ui | 4 |
5 files changed, 35 insertions, 23 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index d1be8d0..11fc91b 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -122,13 +122,13 @@ void MainWindow::makeMenu() | |||
122 | 122 | ||
123 | QAction *cfgact; | 123 | QAction *cfgact; |
124 | 124 | ||
125 | cfgact = new QAction( tr( "Setups" ), | 125 | cfgact = new QAction( tr( "Setups" ), |
126 | QString::null, 0, this, 0 ); | 126 | QString::null, 0, this, 0 ); |
127 | connect( cfgact, SIGNAL( activated() ), | 127 | connect( cfgact, SIGNAL( activated() ), |
128 | SLOT( showSettings() ) ); | 128 | SLOT( showSettingsSetup() ) ); |
129 | cfgact->addTo( cfgMenu ); | 129 | cfgact->addTo( cfgMenu ); |
130 | 130 | ||
131 | cfgact = new QAction( tr( "Servers" ), | 131 | cfgact = new QAction( tr( "Servers" ), |
132 | QString::null, 0, this, 0 ); | 132 | QString::null, 0, this, 0 ); |
133 | connect( cfgact, SIGNAL( activated() ), | 133 | connect( cfgact, SIGNAL( activated() ), |
134 | SLOT( showSettingsSrv() ) ); | 134 | SLOT( showSettingsSrv() ) ); |
@@ -221,13 +221,13 @@ void MainWindow::makeMenu() | |||
221 | destBar->setHorizontalStretchable( TRUE ); | 221 | destBar->setHorizontalStretchable( TRUE ); |
222 | destination = new QComboBox( false, destBar ); | 222 | destination = new QComboBox( false, destBar ); |
223 | destination->insertStringList( settings->getDestinationNames() ); | 223 | destination->insertStringList( settings->getDestinationNames() ); |
224 | setComboName(destination,settings->getDestinationName()); | 224 | setComboName(destination,settings->getDestinationName()); |
225 | connect( destination, SIGNAL(activated(int)), | 225 | connect( destination, SIGNAL(activated(int)), |
226 | settings, SLOT(activeDestinationChange(int)) ); | 226 | settings, SLOT(activeDestinationChange(int)) ); |
227 | spacer = new QLabel( " ", destBar ); | 227 | // spacer = new QLabel( " ", destBar ); |
228 | // spacer->setBackgroundMode( PaletteForeground ); | 228 | // spacer->setBackgroundMode( PaletteForeground ); |
229 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 229 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
230 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); | 230 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); |
231 | CheckBoxLink->setChecked( settings->createLinks() ); | 231 | CheckBoxLink->setChecked( settings->createLinks() ); |
232 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 232 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
233 | settings, SLOT(linkEnabled(bool)) ); | 233 | settings, SLOT(linkEnabled(bool)) ); |
@@ -235,13 +235,13 @@ void MainWindow::makeMenu() | |||
235 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 235 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
236 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 236 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
237 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 237 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
238 | a->addTo( destBar ); | 238 | a->addTo( destBar ); |
239 | destBar->setStretchableWidget( CheckBoxLink ); | 239 | destBar->setStretchableWidget( CheckBoxLink ); |
240 | destAction->setToggleAction( true ); | 240 | destAction->setToggleAction( true ); |
241 | // destAction->addTo( viewMenu ); | 241 | destAction->addTo( viewMenu ); |
242 | 242 | ||
243 | // helpMenu | 243 | // helpMenu |
244 | helpMenu->insertSeparator(); | 244 | helpMenu->insertSeparator(); |
245 | a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); | 245 | a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); |
246 | a->addTo( helpMenu ); | 246 | a->addTo( helpMenu ); |
247 | helpMenu->insertSeparator(); | 247 | helpMenu->insertSeparator(); |
@@ -382,26 +382,32 @@ void MainWindow::setSubSections() | |||
382 | { | 382 | { |
383 | subsection->clear(); | 383 | subsection->clear(); |
384 | subsection->insertStringList( packageListServers.getSubSections() ); | 384 | subsection->insertStringList( packageListServers.getSubSections() ); |
385 | } | 385 | } |
386 | 386 | ||
387 | 387 | ||
388 | void MainWindow::showSettings() | 388 | void MainWindow::showSettings(int i) |
389 | { | ||
390 | if ( settings->showDialog( i ) ) | ||
389 | { | 391 | { |
390 | if ( settings->showDialog( 0 ) ) | ||
391 | updateList(); | 392 | updateList(); |
392 | } | 393 | } |
394 | setComboName(destination,settings->getDestinationName()); | ||
395 | CheckBoxLink->setChecked( settings->createLinks() ); | ||
396 | } | ||
397 | void MainWindow::showSettingsSetup() | ||
398 | { | ||
399 | showSettings(0); | ||
400 | } | ||
393 | void MainWindow::showSettingsSrv() | 401 | void MainWindow::showSettingsSrv() |
394 | { | 402 | { |
395 | if ( settings->showDialog( 1 ) ) | 403 | showSettings(1); |
396 | updateList(); | ||
397 | } | 404 | } |
398 | void MainWindow::showSettingsDst() | 405 | void MainWindow::showSettingsDst() |
399 | { | 406 | { |
400 | if ( settings->showDialog( 2 ) ) | 407 | showSettings(2); |
401 | updateList(); | ||
402 | } | 408 | } |
403 | 409 | ||
404 | void MainWindow::sectionShow(bool b) | 410 | void MainWindow::sectionShow(bool b) |
405 | { | 411 | { |
406 | if (b) sectionBar->show(); | 412 | if (b) sectionBar->show(); |
407 | else sectionBar->hide(); | 413 | else sectionBar->hide(); |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 090ddd3..354c585 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -49,13 +49,14 @@ public: | |||
49 | protected slots: | 49 | protected slots: |
50 | void runIpkg(); | 50 | void runIpkg(); |
51 | void updateList(); | 51 | void updateList(); |
52 | void displayList(); | 52 | void displayList(); |
53 | void subSectionChanged(); | 53 | void subSectionChanged(); |
54 | void sectionChanged(); | 54 | void sectionChanged(); |
55 | void showSettings(); | 55 | void showSettings(int); |
56 | void showSettingsSetup(); | ||
56 | void showSettingsSrv(); | 57 | void showSettingsSrv(); |
57 | void showSettingsDst(); | 58 | void showSettingsDst(); |
58 | 59 | ||
59 | public slots: | 60 | public slots: |
60 | void sectionClose(); | 61 | void sectionClose(); |
61 | void sectionShow(bool); | 62 | void sectionShow(bool); |
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 59d5a3e..14c1944 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -56,12 +56,19 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na | |||
56 | destinationname->setEnabled(FALSE); | 56 | destinationname->setEnabled(FALSE); |
57 | destinationurl->setEnabled(FALSE); | 57 | destinationurl->setEnabled(FALSE); |
58 | destinationurlDic.setAutoDelete(TRUE); | 58 | destinationurlDic.setAutoDelete(TRUE); |
59 | readSettings(); | 59 | readSettings(); |
60 | activeLinkDestination->hide(); | 60 | activeLinkDestination->hide(); |
61 | serverChanged = false; | 61 | serverChanged = false; |
62 | |||
63 | // get rid of setups | ||
64 | // Settings->hide(); | ||
65 | settingName->hide(); | ||
66 | newsetting->hide(); | ||
67 | renamesetting->hide(); | ||
68 | removesetting->hide(); | ||
62 | } | 69 | } |
63 | 70 | ||
64 | PackageManagerSettings::~PackageManagerSettings() | 71 | PackageManagerSettings::~PackageManagerSettings() |
65 | { | 72 | { |
66 | } | 73 | } |
67 | 74 | ||
@@ -535,24 +542,20 @@ QStringList PackageManagerSettings::getDestinationNames() | |||
535 | 542 | ||
536 | 543 | ||
537 | void PackageManagerSettings::linkEnabled( bool b ) | 544 | void PackageManagerSettings::linkEnabled( bool b ) |
538 | { | 545 | { |
539 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); | 546 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); |
540 | activeLinkDestination->setEnabled( b ); | 547 | activeLinkDestination->setEnabled( b ); |
548 | CheckBoxLink->setChecked( b ); | ||
541 | } | 549 | } |
542 | 550 | ||
543 | void PackageManagerSettings::activeServerChanged() | 551 | void PackageManagerSettings::activeServerChanged() |
544 | { | 552 | { |
545 | changed = true; | 553 | changed = true; |
546 | } | 554 | } |
547 | 555 | ||
548 | QComboBox* PackageManagerSettings::getDestCombo() | ||
549 | { | ||
550 | return new QComboBox(activeDestination); | ||
551 | } | ||
552 | |||
553 | void PackageManagerSettings::createLinksToDest() | 556 | void PackageManagerSettings::createLinksToDest() |
554 | { | 557 | { |
555 | pvDebug(2,"creating links..."); | 558 | pvDebug(2,"creating links..."); |
556 | // emit doCreateLinks( destinationurl->text() ); | 559 | // emit doCreateLinks( destinationurl->text() ); |
557 | //ipkg->createLinks( destinationurl ); | 560 | //ipkg->createLinks( destinationurl ); |
558 | } | 561 | } |
@@ -561,10 +564,13 @@ void PackageManagerSettings::removeLinksToDest() | |||
561 | { | 564 | { |
562 | pvDebug(2,"removing links..."); | 565 | pvDebug(2,"removing links..."); |
563 | // emit doRemoveLinks( destinationurl->text() ); | 566 | // emit doRemoveLinks( destinationurl->text() ); |
564 | //ipkg->removeLinks( destinationurl ); | 567 | //ipkg->removeLinks( destinationurl ); |
565 | } | 568 | } |
566 | 569 | ||
567 | //void PackageManagerSettings::setIpkg( PmIpkg* i ) | 570 | void PackageManagerSettings::activeDestinationChange(int i) |
568 | //{ | 571 | { |
569 | //ipkg = i; | 572 | pvDebug(5,"activeDestinationChange "+QString::number(i)); |
570 | //} | 573 | if (i > activeDestination->count()) return; |
574 | activeDestination->setCurrentItem(i); | ||
575 | pvDebug(5,"dest name "+ activeDestination->currentText()); | ||
576 | } | ||
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h index 8f9fe62..d66c4e8 100644 --- a/noncore/unsupported/oipkg/pksettings.h +++ b/noncore/unsupported/oipkg/pksettings.h | |||
@@ -21,14 +21,12 @@ public: | |||
21 | bool createLinks(); | 21 | bool createLinks(); |
22 | QStringList getServers(); | 22 | QStringList getServers(); |
23 | QStringList getActiveServers(); | 23 | QStringList getActiveServers(); |
24 | QStringList getDestinationUrls(); | 24 | QStringList getDestinationUrls(); |
25 | QStringList getDestinationNames(); | 25 | QStringList getDestinationNames(); |
26 | QString getDestinationUrlByName(QString); | 26 | QString getDestinationUrlByName(QString); |
27 | QComboBox* getDestCombo(); | ||
28 | // void setIpkg( PmIpkg* ); | ||
29 | 27 | ||
30 | public slots: | 28 | public slots: |
31 | void writeInstallationSettings(); | 29 | void writeInstallationSettings(); |
32 | void readInstallationSettings(); | 30 | void readInstallationSettings(); |
33 | void writeCurrentInstallationSetting(); | 31 | void writeCurrentInstallationSetting(); |
34 | void readInstallationSetting(int); | 32 | void readInstallationSetting(int); |
@@ -48,12 +46,13 @@ public slots: | |||
48 | void destUrlChanged(const QString&); | 46 | void destUrlChanged(const QString&); |
49 | void installationSettingChange(int); | 47 | void installationSettingChange(int); |
50 | void newInstallationSetting(); | 48 | void newInstallationSetting(); |
51 | void removeInstallationSetting(); | 49 | void removeInstallationSetting(); |
52 | void renameInstallationSetting(); | 50 | void renameInstallationSetting(); |
53 | void activeServerChanged(); | 51 | void activeServerChanged(); |
52 | void activeDestinationChange(int); | ||
54 | signals: | 53 | signals: |
55 | // void doCreateLinks( QString dest ); | 54 | // void doCreateLinks( QString dest ); |
56 | // void doRemoveLinks( QString dest ); | 55 | // void doRemoveLinks( QString dest ); |
57 | 56 | ||
58 | private: | 57 | private: |
59 | QIntDict<QString> serverurlDic; | 58 | QIntDict<QString> serverurlDic; |
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui index 5b83248..e95ed83 100644 --- a/noncore/unsupported/oipkg/pksettingsbase.ui +++ b/noncore/unsupported/oipkg/pksettingsbase.ui | |||
@@ -8,13 +8,13 @@ | |||
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>337</width> | 14 | <width>333</width> |
15 | <height>454</height> | 15 | <height>454</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Package Servers</string> | 20 | <string>Package Servers</string> |
@@ -212,13 +212,13 @@ | |||
212 | <property stdset="1"> | 212 | <property stdset="1"> |
213 | <name>name</name> | 213 | <name>name</name> |
214 | <cstring>TextLabel1_2</cstring> | 214 | <cstring>TextLabel1_2</cstring> |
215 | </property> | 215 | </property> |
216 | <property stdset="1"> | 216 | <property stdset="1"> |
217 | <name>text</name> | 217 | <name>text</name> |
218 | <string>Used servers:</string> | 218 | <string>Used servers: (Highlighted feeds are active)</string> |
219 | </property> | 219 | </property> |
220 | </widget> | 220 | </widget> |
221 | <spacer> | 221 | <spacer> |
222 | <property> | 222 | <property> |
223 | <name>name</name> | 223 | <name>name</name> |
224 | <cstring>Spacer4</cstring> | 224 | <cstring>Spacer4</cstring> |