[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/network/telepathy-accounts-kcm/src/KCMTelepathyAccounts
From:       Matteo Nardi <91.matteo () gmail ! com>
Date:       2009-08-11 8:08:12
Message-ID: 1249978092.999213.12219.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1009908 by nardi:

Display localized names of protocols. 
BUG: 202502


 M  +19 -1     dictionary.cpp  
 M  +10 -1     protocol-item.cpp  
 M  +2 -0      protocol-item.h  
 M  +1 -1      protocol-list-model.cpp  


--- trunk/playground/network/telepathy-accounts-kcm/src/KCMTelepathyAccounts/dictionary.cpp \
#1009907:1009908 @@ -32,7 +32,7 @@
     // Set up the singleton instance
     s_self = this;
 
-    // TODO: Populate the dictionary
+    // Parameters
     m_strings.insert("password", i18n("Password"));
     m_strings.insert("account", i18n("Account"));
     m_strings.insert("priority", i18n("Priority"));
@@ -54,6 +54,24 @@
     m_strings.insert("https-proxy-server", i18n("HTTPS Proxy Server Address"));
     m_strings.insert("ignore-ssl-errors", i18n("Ignore SSL Errors"));
     m_strings.insert("keepalive-interval", i18n("Keepalive Interval"));
+
+    // Protocols
+    m_strings.insert("aim", i18n("AOL Instant Messenger"));
+    m_strings.insert("gadugadu", i18n("Gadu-Gadu"));
+    m_strings.insert("groupwise", i18n("Novell Groupwise"));
+    m_strings.insert("icq", i18n("ICQ"));
+    m_strings.insert("irc", i18n("Internet Relay Chat"));
+    m_strings.insert("jabber", i18n("Jabber/XMPP/Google Talk"));
+    m_strings.insert("local-xmpp", i18n("Bonjour/Salut"));
+    m_strings.insert("msn", i18n("Windows Live Messenger"));
+    m_strings.insert("myspace", i18n("MySpaceIM"));
+    m_strings.insert("qq", i18n("Tencent QQ"));
+    m_strings.insert("sametime", i18n("IBM Lotus Sametime"));
+    m_strings.insert("silc", i18n("SILC"));
+    m_strings.insert("sip", i18n("Session Initiation Protocol (SIP)"));
+    m_strings.insert("trepia", i18n("Trepia"));
+    m_strings.insert("yahoo", i18n("Yahoo! Messenger"));
+    m_strings.insert("zephyr", i18n("Zephyr"));
 }
 
 Dictionary::~Dictionary()
--- trunk/playground/network/telepathy-accounts-kcm/src/KCMTelepathyAccounts/protocol-item.cpp \
#1009907:1009908 @@ -21,6 +21,7 @@
 #include "protocol-item.h"
 
 #include "connection-manager-item.h"
+#include "dictionary.h"
 
 #include <KDebug>
 
@@ -30,7 +31,10 @@
 {
     kDebug() << "Creating new ProtocolItem with cmItem: " << parent << " and \
protocol;" << protocol;  
-    // TODO: Implement me!
+    m_localizedName = Dictionary::instance()->string(protocol);
+    if(m_localizedName.isEmpty()) {
+        m_localizedName = protocol;
+    }
 }
 
 ProtocolItem::~ProtocolItem()
@@ -45,6 +49,11 @@
     return m_protocol;
 }
 
+QString ProtocolItem::localizedName() const
+{
+    return m_localizedName;
+}
+
 Tp::ProtocolParameterList ProtocolItem::mandatoryParameters() const
 {
     kDebug();
--- trunk/playground/network/telepathy-accounts-kcm/src/KCMTelepathyAccounts/protocol-item.h \
#1009907:1009908 @@ -40,12 +40,14 @@
     virtual ~ProtocolItem();
 
     QString protocol() const;
+    QString localizedName() const;
 
     Tp::ProtocolParameterList mandatoryParameters() const;
     Tp::ProtocolParameterList optionalParameters() const;
 
 private:
     QString m_protocol;
+    QString m_localizedName;
 };
 
 
--- trunk/playground/network/telepathy-accounts-kcm/src/KCMTelepathyAccounts/protocol-list-model.cpp \
#1009907:1009908 @@ -63,7 +63,7 @@
     switch(role)
     {
     case Qt::DisplayRole:
-        data = QVariant(m_protocolItems.at(index.row())->protocol());
+        data = QVariant(m_protocolItems.at(index.row())->localizedName());
         break;
     case Qt::DecorationRole:
         // Look for an icon named im-<protocolname>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic