author | tille <tille> | 2002-07-17 10:59:08 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-17 10:59:08 (UTC) |
commit | 1a6f157f6a83a73907dcd4c4da1d7b24cb19dc5c (patch) (side-by-side diff) | |
tree | 3acd973e7c21d98aae401134aaa7fb1b8c84aa30 /noncore | |
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 | 26 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettingsbase.ui | 4 |
5 files changed, 36 insertions, 24 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() QAction *cfgact; cfgact = new QAction( tr( "Setups" ), QString::null, 0, this, 0 ); connect( cfgact, SIGNAL( activated() ), - SLOT( showSettings() ) ); + SLOT( showSettingsSetup() ) ); cfgact->addTo( cfgMenu ); cfgact = new QAction( tr( "Servers" ), QString::null, 0, this, 0 ); connect( cfgact, SIGNAL( activated() ), SLOT( showSettingsSrv() ) ); @@ -221,13 +221,13 @@ void MainWindow::makeMenu() destBar->setHorizontalStretchable( TRUE ); destination = new QComboBox( false, destBar ); destination->insertStringList( settings->getDestinationNames() ); setComboName(destination,settings->getDestinationName()); connect( destination, SIGNAL(activated(int)), settings, SLOT(activeDestinationChange(int)) ); - spacer = new QLabel( " ", destBar ); +// spacer = new QLabel( " ", destBar ); // spacer->setBackgroundMode( PaletteForeground ); CheckBoxLink = new QCheckBox( tr("Link"), destBar); // CheckBoxLink->setBackgroundMode( PaletteForeground ); CheckBoxLink->setChecked( settings->createLinks() ); connect( CheckBoxLink, SIGNAL(toggled(bool)), settings, SLOT(linkEnabled(bool)) ); @@ -235,13 +235,13 @@ void MainWindow::makeMenu() connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); a->addTo( destBar ); destBar->setStretchableWidget( CheckBoxLink ); destAction->setToggleAction( true ); - // destAction->addTo( viewMenu ); + destAction->addTo( viewMenu ); // helpMenu helpMenu->insertSeparator(); a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); a->addTo( helpMenu ); helpMenu->insertSeparator(); @@ -382,26 +382,32 @@ void MainWindow::setSubSections() { subsection->clear(); subsection->insertStringList( packageListServers.getSubSections() ); } -void MainWindow::showSettings() +void MainWindow::showSettings(int i) { - if ( settings->showDialog( 0 ) ) + if ( settings->showDialog( i ) ) + { updateList(); + } + setComboName(destination,settings->getDestinationName()); + CheckBoxLink->setChecked( settings->createLinks() ); +} +void MainWindow::showSettingsSetup() +{ + showSettings(0); } void MainWindow::showSettingsSrv() { - if ( settings->showDialog( 1 ) ) - updateList(); + showSettings(1); } void MainWindow::showSettingsDst() { - if ( settings->showDialog( 2 ) ) - updateList(); + showSettings(2); } void MainWindow::sectionShow(bool b) { if (b) sectionBar->show(); 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: protected slots: void runIpkg(); void updateList(); void displayList(); void subSectionChanged(); void sectionChanged(); - void showSettings(); + void showSettings(int); + void showSettingsSetup(); void showSettingsSrv(); void showSettingsDst(); public slots: void sectionClose(); 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 destinationname->setEnabled(FALSE); destinationurl->setEnabled(FALSE); destinationurlDic.setAutoDelete(TRUE); readSettings(); activeLinkDestination->hide(); serverChanged = false; + + // get rid of setups +// Settings->hide(); + settingName->hide(); + newsetting->hide(); + renamesetting->hide(); + removesetting->hide(); } PackageManagerSettings::~PackageManagerSettings() { } @@ -529,30 +536,26 @@ QStringList PackageManagerSettings::getDestinationNames() for (int i=0; i<(int)destinations->count(); i++) { sl += destinations->text(i); } return sl; } - + void PackageManagerSettings::linkEnabled( bool b ) { pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); activeLinkDestination->setEnabled( b ); + CheckBoxLink->setChecked( b ); } void PackageManagerSettings::activeServerChanged() { changed = true; } -QComboBox* PackageManagerSettings::getDestCombo() -{ - return new QComboBox(activeDestination); -} - void PackageManagerSettings::createLinksToDest() { pvDebug(2,"creating links..."); // emit doCreateLinks( destinationurl->text() ); // ipkg->createLinks( destinationurl ); } @@ -561,10 +564,13 @@ void PackageManagerSettings::removeLinksToDest() { pvDebug(2,"removing links..."); // emit doRemoveLinks( destinationurl->text() ); // ipkg->removeLinks( destinationurl ); } -//void PackageManagerSettings::setIpkg( PmIpkg* i ) -//{ -// ipkg = i; -//} +void PackageManagerSettings::activeDestinationChange(int i) +{ + pvDebug(5,"activeDestinationChange "+QString::number(i)); + if (i > activeDestination->count()) return; + activeDestination->setCurrentItem(i); + pvDebug(5,"dest name "+ activeDestination->currentText()); +} 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: bool createLinks(); QStringList getServers(); QStringList getActiveServers(); QStringList getDestinationUrls(); QStringList getDestinationNames(); QString getDestinationUrlByName(QString); - QComboBox* getDestCombo(); -// void setIpkg( PmIpkg* ); public slots: void writeInstallationSettings(); void readInstallationSettings(); void writeCurrentInstallationSetting(); void readInstallationSetting(int); @@ -48,12 +46,13 @@ public slots: void destUrlChanged(const QString&); void installationSettingChange(int); void newInstallationSetting(); void removeInstallationSetting(); void renameInstallationSetting(); void activeServerChanged(); + void activeDestinationChange(int); signals: // void doCreateLinks( QString dest ); // void doRemoveLinks( QString dest ); private: 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 @@ </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>337</width> + <width>333</width> <height>454</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Package Servers</string> @@ -212,13 +212,13 @@ <property stdset="1"> <name>name</name> <cstring>TextLabel1_2</cstring> </property> <property stdset="1"> <name>text</name> - <string>Used servers:</string> + <string>Used servers: (Highlighted feeds are active)</string> </property> </widget> <spacer> <property> <name>name</name> <cstring>Spacer4</cstring> |