[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: groupwise_in_anger: kdenetwork/kopete/protocols/groupwise/ui
From: Will Stephenson <lists () stevello ! free-online ! co ! uk>
Date: 2004-09-07 19:59:20
Message-ID: 20040907195920.D8D81175D () office ! kde ! org
[Download RAW message or body]
CVS commit by wstephens:
Fix defect #7 - Properties are shown raw.
M +37 -17 gwcontactproperties.cpp 1.1.2.4
M +2 -0 gwcontactproperties.h 1.1.2.3
--- kdenetwork/kopete/protocols/groupwise/ui/gwcontactproperties.cpp \
#1.1.2.3:1.1.2.4 @@ -40,14 +40,7 @@ GroupWiseContactProperties::GroupWiseCon
m_propsWidget->m_firstName->setText( contact->property( \
Kopete::Global::Properties::self()->firstName() ).value().toString() \
);
m_propsWidget->m_lastName->setText( contact->property( \
Kopete::Global::Properties::self()->lastName() ).value().toString() \
);
- // now do the properties
- m_propsWidget->m_propsView->header()->hide();
- m_propsWidget->m_propsView->setAllColumnsShowFocus( true );
- QMap< QString, QString > serverProps = contact->serverProperties();
- QMap< QString, QString >::Iterator it;
- QMap< QString, QString >::Iterator end = serverProps.end();
- for ( it = serverProps.begin(); it != end; ++it )
- {
- new QListViewItem( m_propsWidget->m_propsView, it.key(), it.data() \
);
- }
+
+ setupProperties( contact->serverProperties() );
+
// insert the props widget into the dialog
m_dialog->setMainWidget( m_propsWidget );
@@ -66,14 +59,42 @@ GroupWiseContactProperties::GroupWiseCon
m_propsWidget->m_firstName->setText( cd.givenName );
m_propsWidget->m_lastName->setText( cd.surname );
+
+ setupProperties( cd.properties );
+
+ // insert the props widget into the dialog
+ m_dialog->setMainWidget( m_propsWidget );
+ m_dialog->show();
+}
+
+void GroupWiseContactProperties::setupProperties( QMap< QString, QString > \
serverProps ) +{
+ // now do the properties
m_propsWidget->m_propsView->header()->hide();
+ m_propsWidget->m_propsView->setAllColumnsShowFocus( true );
QMap< QString, QString >::Iterator it;
- QMap< QString, QString >::Iterator end = cd.properties.end();
- for ( it = cd.properties.begin(); it != end; ++it )
+ QMap< QString, QString >::Iterator end = serverProps.end();
+ for ( it = serverProps.begin(); it != end; ++it )
{
- new QListViewItem( m_propsWidget->m_propsView, it.key(), it.data() \
); + QString key = it.key();
+ QString localised;
+ if ( key == "telephoneNumber" )
+ localised = i18n( "Telephone Number" );
+ else if ( key == "OU" )
+ localised = i18n( "Department" );
+ else if ( key == "L" )
+ localised = i18n( "Location" );
+ else if ( key == "mailstop" )
+ localised = i18n( "Mailstop" );
+ else if ( key == "personalTitle" )
+ localised = i18n( "Personal Title" );
+ else if ( key == "title" )
+ localised = i18n( "Title" );
+ else if ( key == "Internet EMail Address" )
+ localised = i18n( "EMail Address" );
+ else
+ localised = key;
+
+ new QListViewItem( m_propsWidget->m_propsView, localised, it.data() \
); }
- // insert the props widget into the dialog
- m_dialog->setMainWidget( m_propsWidget );
- m_dialog->show();
}
--- kdenetwork/kopete/protocols/groupwise/ui/gwcontactproperties.h #1.1.2.2:1.1.2.3
@@ -38,4 +38,6 @@ public:
~GroupWiseContactProperties();
+ void setupProperties( QMap< QString, QString > serverProps );
+
private:
GroupWiseContactPropsWidget * m_propsWidget;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic