summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/configpage.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kresources/configpage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configpage.cpp75
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
@@ -22,4 +22,11 @@
*/
+/*
+Enhanced Version of the file for platform independent KDE tools.
+Copyright (c) 2004 Ulf Schenk
+
+$Id$
+*/
+
#include <qgroupbox.h>
#include <qinputdialog.h>
@@ -51,4 +58,7 @@
using namespace KRES;
+const QString ConfigPage::syncfamily = "syncprofiles";
+
+
class ConfigViewItem : public QCheckListItem
{
@@ -165,11 +175,13 @@ void ConfigPage::load()
//US QString family = tmp.toString();
QStringList families;
- families << "contact" << "sync-contacts";
+ families << "contact" << syncfamily;
+
+
for ( QStringList::Iterator it = families.begin(); it != families.end(); ++it )
- {
+ {
QString family = (*it);
if ( !family.isEmpty() ) {
if ( !mFamilyMap.contains( family ) ) {
- mCurrentManager = new Manager<Resource>( family );
+ mCurrentManager = new Manager<Resource>( family, (family == syncfamily) );
if ( mCurrentManager ) {
mFamilyMap.append( family );
@@ -229,5 +241,5 @@ void ConfigPage::slotFamilyChanged( int pos )
//US qDebug("ConfigPage::slotFamilyChanged 4 family=%s", mFamily.latin1());
-
+
mCurrentManager = mInfoMap[ pos ].mManager;
mCurrentConfig = mInfoMap[ pos ].mConfig;
@@ -240,13 +252,13 @@ void ConfigPage::slotFamilyChanged( int pos )
if ( mCurrentManager->isEmpty() ) {
//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;
for ( it = mCurrentManager->begin(); it != mCurrentManager->end(); ++it ) {
@@ -255,5 +267,5 @@ void ConfigPage::slotFamilyChanged( int pos )
item->setStandard( true );
}
-
+
if ( mListView->childCount() == 0 ) {
//US qDebug("ConfigPage::slotFamilyChanged 4.5 ");
@@ -264,10 +276,10 @@ void ConfigPage::slotFamilyChanged( int pos )
} else {
//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" );
-
+
}
@@ -284,7 +296,20 @@ void ConfigPage::slotAdd()
QStringList descs = mCurrentManager->resourceTypeDescriptions();
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 )
return;
@@ -381,5 +406,5 @@ 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 );
}
@@ -400,10 +425,10 @@ 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;
}
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;
}
@@ -465,5 +490,5 @@ 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 );
return;
@@ -480,5 +505,5 @@ void ConfigPage::saveResourceSettings()
if ( mCurrentManager ) {
-
+
QListViewItem *item = mListView->firstChild();
while ( item ) {
@@ -488,8 +513,8 @@ void ConfigPage::saveResourceSettings()
if ( configItem->standard() && !configItem->readOnly() &&
configItem->isOn() ) {
-
+
mCurrentManager->setStandardResource( configItem->resource() );
}
-
+
// check if active or passive resource
configItem->resource()->setActive( configItem->isOn() );
@@ -500,9 +525,9 @@ 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");
-
+
}