Diffstat (limited to 'microkde/kresources/configpage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kresources/configpage.cpp | 75 |
1 files changed, 50 insertions, 25 deletions
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp index 8782ffd..912c62e 100644 --- a/microkde/kresources/configpage.cpp +++ b/microkde/kresources/configpage.cpp @@ -23,2 +23,9 @@ +/* +Enhanced Version of the file for platform independent KDE tools. +Copyright (c) 2004 Ulf Schenk + +$Id$ +*/ + #include <qgroupbox.h> @@ -52,2 +59,5 @@ using namespace KRES; +const QString ConfigPage::syncfamily = "syncprofiles"; + + class ConfigViewItem : public QCheckListItem @@ -166,5 +176,7 @@ void ConfigPage::load() QStringList families; - families << "contact" << "sync-contacts"; + families << "contact" << syncfamily; + + for ( QStringList::Iterator it = families.begin(); it != families.end(); ++it ) - { + { QString family = (*it); @@ -172,3 +184,3 @@ void ConfigPage::load() if ( !mFamilyMap.contains( family ) ) { - mCurrentManager = new Manager<Resource>( family ); + mCurrentManager = new Manager<Resource>( family, (family == syncfamily) ); if ( mCurrentManager ) { @@ -230,3 +242,3 @@ void ConfigPage::slotFamilyChanged( int pos ) //US qDebug("ConfigPage::slotFamilyChanged 4 family=%s", mFamily.latin1()); - + mCurrentManager = mInfoMap[ pos ].mManager; @@ -241,11 +253,11 @@ void ConfigPage::slotFamilyChanged( int pos ) //US qDebug("ConfigPage::slotFamilyChanged 4.1 mCurrentManager=%ul", mCurrentManager ); - + defaults(); } - + Resource *standardResource = mCurrentManager->standardResource(); - + //US qDebug("ConfigPage::slotFamilyChanged 4.4 resourcename=%s", standardResource->resourceName().latin1()); - + Manager<Resource>::Iterator it; @@ -256,3 +268,3 @@ void ConfigPage::slotFamilyChanged( int pos ) } - + if ( mListView->childCount() == 0 ) { @@ -265,8 +277,8 @@ void ConfigPage::slotFamilyChanged( int pos ) //US qDebug("ConfigPage::slotFamilyChanged 4.6 "); - + if ( !standardResource ) { - KMessageBox::sorry( this, i18n( "There is no standard resource! Please select one." ) ); - + KMessageBox::sorry( this, i18n( "There is no standard resource!<br> Please select one." ) ); + //US qDebug("ConfigPage::slotFamilyChanged 4.7" ); - + } @@ -285,5 +297,18 @@ void ConfigPage::slotAdd() bool ok = false; - QString desc = QInputDialog::getItem( i18n( "Resource Configuration" ), - i18n( "Please select type of the new resource:" ), descs, 0, + + QString desc; + + if (mFamily == syncfamily) + { + desc = QInputDialog::getItem( i18n( "Sync Configuration" ), + i18n( "Please select resource type for new sync profile:" ), descs, 0, + false, &ok, this ); + } + else + { + desc = QInputDialog::getItem( i18n( "Resource Configuration" ), + i18n( "Please select type of the new resource:" ), descs, 0, false, &ok, this ); + } + if ( !ok ) @@ -382,3 +407,3 @@ void ConfigPage::slotEdit() if ( configItem->standard() && configItem->readOnly() ) { - KMessageBox::sorry( this, i18n( "You cannot use a read-only resource as standard!" ) ); + KMessageBox::sorry( this, i18n( "You cannot use a read-only<br> resource as standard!" ) ); configItem->setStandard( false ); @@ -401,3 +426,3 @@ void ConfigPage::slotStandard() if ( item->readOnly() ) { - KMessageBox::sorry( this, i18n( "You cannot use a read-only resource as standard!" ) ); + KMessageBox::sorry( this, i18n( "You cannot use a read-only<br>resource as standard!" ) ); return; @@ -406,3 +431,3 @@ void ConfigPage::slotStandard() if ( !item->isOn() ) { - KMessageBox::sorry( this, i18n( "You cannot use an inactive resource as standard!" ) ); + KMessageBox::sorry( this, i18n( "You cannot use an inactive<br>resource as standard!" ) ); return; @@ -466,3 +491,3 @@ void ConfigPage::slotItemClicked( QListViewItem *item ) if ( configItem->standard() && !configItem->isOn() ) { - KMessageBox::sorry( this, i18n( "You cannot deactivate the standard resource. Choose another standard resource first." ) ); + KMessageBox::sorry( this, i18n( "You cannot deactivate the<br>standard resource. Choose<br>another standard resource first." ) ); configItem->setOn( true ); @@ -481,3 +506,3 @@ void ConfigPage::saveResourceSettings() if ( mCurrentManager ) { - + QListViewItem *item = mListView->firstChild(); @@ -489,6 +514,6 @@ void ConfigPage::saveResourceSettings() configItem->isOn() ) { - + mCurrentManager->setStandardResource( configItem->resource() ); } - + // check if active or passive resource @@ -501,7 +526,7 @@ void ConfigPage::saveResourceSettings() if ( !mCurrentManager->standardResource() ) - KMessageBox::sorry( this, i18n( "There is no valid standard resource! Please select one which is neither read-only nor inactive." ) ); + KMessageBox::sorry( this, i18n( "There is no valid standard resource!<br>Please select one which is neither read-only nor inactive." ) ); } - + qDebug("ConfigPage::saveResourceSettings() end"); - + } |