ekiga r6630 - in trunk: . lib/engine/addressbook/ldap



Author: dsandras
Date: Sun Aug 17 17:52:21 2008
New Revision: 6630
URL: http://svn.gnome.org/viewvc/ekiga?rev=6630&view=rev

Log:
If the list of books is empty, automatically add the Ekiga.net
directory. Added a menu entry to automatically add the Ekiga.net
directory using the menu.


Modified:
   trunk/ChangeLog
   trunk/ekiga.schemas.in.in
   trunk/lib/engine/addressbook/ldap/ldap-source.cpp
   trunk/lib/engine/addressbook/ldap/ldap-source.h

Modified: trunk/ekiga.schemas.in.in
==============================================================================
--- trunk/ekiga.schemas.in.in	(original)
+++ trunk/ekiga.schemas.in.in	Sun Aug 17 17:52:21 2008
@@ -1076,15 +1076,14 @@
       </locale>
     </schema>
     <schema>		
-      <key>/schemas/apps/@PACKAGE_NAME@/contacts/remote_addressbooks_list</key>
-      <applyto>/apps/@PACKAGE_NAME@/contacts/remote_addressbooks_list</applyto>
+      <key>/schemas/apps/@PACKAGE_NAME@/contacts/ldap_servers</key>
+      <applyto>/apps/@PACKAGE_NAME@/contacts/ldap_servers</applyto>
       <owner>Ekiga</owner>
-      <type>list</type>
-      <list_type>string</list_type>
-      <default>[1086549787 11023 35 golgoth01|Ekiga White Pages|ldap://ldap.ekiga.net:389/dc=ekiga\,dc=net??sub|telephoneNumber,1086536533 479 17 golgoth01]</default>
+      <type>string</type>
+      <default></default>
       <locale name="C">
-	<short>User directory</short>
-	<long></long>
+	<short>LDAP servers</short>
+	<long>List of configured LDAP servers</long>
       </locale>
     </schema>
     <schema>

Modified: trunk/lib/engine/addressbook/ldap/ldap-source.cpp
==============================================================================
--- trunk/lib/engine/addressbook/ldap/ldap-source.cpp	(original)
+++ trunk/lib/engine/addressbook/ldap/ldap-source.cpp	Sun Aug 17 17:52:21 2008
@@ -37,6 +37,7 @@
 
 #include <cstdlib>
 #include <iostream>
+#include <string.h>
 
 #include "config.h"
 
@@ -52,7 +53,7 @@
   xmlNodePtr root;
   gchar *c_raw = gm_conf_get_string (KEY);
 
-  if (c_raw != NULL) {
+  if (c_raw != NULL && strcmp (c_raw, "")) {
 
     const std::string raw = c_raw;
 
@@ -82,6 +83,8 @@
     doc = xmlNewDoc (BAD_CAST "1.0");
     root = xmlNewNode (NULL, BAD_CAST "list");
     xmlDocSetRootElement (doc, root);
+
+    new_ekiga_net_book ();
   }
 }
 
@@ -133,9 +136,12 @@
 bool
 OPENLDAP::Source::populate_menu (Ekiga::MenuBuilder &builder)
 {
-  builder.add_action ("add", _("Add an LDAP addressbook"),
+  builder.add_action ("add", _("Add an LDAP Address Book"),
 		      sigc::mem_fun (this,
 				     &OPENLDAP::Source::new_book));
+  builder.add_action ("add", _("Add the Ekiga.net Directory"),
+		      sigc::mem_fun (this,
+				     &OPENLDAP::Source::new_ekiga_net_book));
   return true;
 }
 
@@ -177,6 +183,18 @@
 }
 
 void
+OPENLDAP::Source::new_ekiga_net_book ()
+{
+  add (_("Ekiga.net Directory"),
+       "ekiga.net", 389,
+       "dc=ekiga,dc=net",
+       "sub",
+       "telephoneNumber", 
+       "");
+  save ();
+}
+
+void
 OPENLDAP::Source::on_new_book_form_submitted (Ekiga::Form &result)
 {
   try {

Modified: trunk/lib/engine/addressbook/ldap/ldap-source.h
==============================================================================
--- trunk/lib/engine/addressbook/ldap/ldap-source.h	(original)
+++ trunk/lib/engine/addressbook/ldap/ldap-source.h	Sun Aug 17 17:52:21 2008
@@ -94,6 +94,9 @@
     void save ();
 
     void new_book ();
+    
+    void new_ekiga_net_book ();
+
     void on_new_book_form_submitted (Ekiga::Form &result);
   };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]