[evolution] Alter UI conditional syntax to be more familiar cpp style, which avoids the need for intltool change



commit 495f8f8003ac98ab63fa68aa89fbe8668c357320
Author: Michael Meeks <michael meeks novell com>
Date:   Tue Mar 23 10:24:31 2010 +0000

    Alter UI conditional syntax to be more familiar cpp style, which
    avoids the need for intltool changes.

 e-util/e-ui-manager.c                              |   27 +++++++++----------
 plugins/bbdb/gaimbuddies.c                         |    1 +
 .../mail-to-task/org-gnome-mail-to-task.eplug.xml  |   10 +++---
 ui/evolution-calendars.ui                          |   20 +++++++-------
 ui/evolution-mail-reader.ui                        |   12 ++++----
 ui/evolution-mail.ui                               |   12 ++++----
 ui/evolution-shell.ui                              |   12 ++++----
 7 files changed, 47 insertions(+), 47 deletions(-)
---
diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c
index 4086707..f108cd3 100644
--- a/e-util/e-ui-manager.c
+++ b/e-util/e-ui-manager.c
@@ -106,24 +106,23 @@ ui_manager_filter_ui (EUIManager *ui_manager,
 	express_mode = e_ui_manager_get_express_mode (ui_manager);
 
 	/*
-	 * Very simple line based pre-processing based on comments:
-	 * <!-- if [!]EXPRESS -->\n ... \n<!-- endif -->\n
+	 * Very simple C style pre-processing in-line in the XML:
+	 * #if [!]EXPRESS\n ... \n#endif\n
 	 */
-
 	lines = g_strsplit (ui_definition, "\n", -1);
 
 	for (ii = 0; lines[ii] != NULL; ii++) {
-		gchar *cp;
-
-		if ((cp = strstr (lines[ii], "<!-- if "))) {
-			gboolean not_express = lines[ii][8] == '!';
-			include = express_mode ^ not_express;
-			lines[ii][0] = '\0';
-			in_conditional = TRUE;
-		} else if ((cp = strstr (lines[ii], "<!-- endif"))) {
-			lines[ii][0] = '\0';
-			include = TRUE;
-			in_conditional = FALSE;
+		if (lines[ii][0] == '#') {
+			if (!strncmp (lines[ii], "#if ", 4)) {
+				gboolean not_express = lines[ii][4] == '!';
+				include = express_mode ^ not_express;
+				lines[ii][0] = '\0';
+				in_conditional = TRUE;
+			} else if (!strncmp (lines[ii], "#endif", 6)) {
+				lines[ii][0] = '\0';
+				include = TRUE;
+				in_conditional = FALSE;
+			}
 		}
 		if (!include)
 			lines[ii][0] = '\0';
diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c
index 184c071..586f508 100644
--- a/plugins/bbdb/gaimbuddies.c
+++ b/plugins/bbdb/gaimbuddies.c
@@ -40,6 +40,7 @@
 #include <string.h>
 
 #include <libebook/e-book.h>
+#undef EDS_DISABLE_DEPRECATED
 #include <libedataserver/md5-utils.h>
 #include <libedataserverui/e-source-combo-box.h>
 
diff --git a/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml b/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
index 9cb3909..d904d29 100644
--- a/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
+++ b/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
@@ -7,7 +7,7 @@
     <hook class="org.gnome.evolution.ui:1.0">
       <ui-manager id="org.gnome.evolution.mail.browser"
                   callback="mail_browser_init">
-<!-- if !EXPRESS -->
+#if !EXPRESS
         <menubar name='main-menu'>
           <placeholder name='custom-menus'>
             <menu action="mail-message-menu">
@@ -28,11 +28,11 @@
             <menuitem action="mail-convert-to-memo"/>
           </placeholder>
         </popup>
-<!-- endif -->
+#endif
       </ui-manager>
       <ui-manager id="org.gnome.evolution.mail"
                   callback="mail_shell_view_init">
-<!-- if !EXPRESS -->
+#if !EXPRESS
         <menubar name='main-menu'>
           <placeholder name='custom-menus'>
             <menu action="mail-message-menu">
@@ -46,7 +46,7 @@
           </placeholder>
         </menubar>
         <popup name="mail-message-popup">
-          <placeholder name="mail-message-popup-actions">
+           <placeholder name="mail-message-popup-actions">
             <menuitem action="mail-convert-to-event"/>
             <menuitem action="mail-convert-to-meeting"/>
             <menuitem action="mail-convert-to-task"/>
@@ -61,8 +61,8 @@
             <menuitem action="mail-convert-to-memo"/>
           </placeholder>
         </popup>
-<!-- endif -->
       </ui-manager>
+#endif
     </hook>
 
   </e-plugin>
diff --git a/ui/evolution-calendars.ui b/ui/evolution-calendars.ui
index d3ef98a..8cc6bf2 100644
--- a/ui/evolution-calendars.ui
+++ b/ui/evolution-calendars.ui
@@ -28,33 +28,33 @@
     </placeholder>
   </menubar>
   <toolbar name='main-toolbar'>
-<!-- if !EXPRESS -->		  
+#if !EXPRESS
     <toolitem action='calendar-print'/>
     <toolitem action='delete-selection'/>
     <separator/>
-<!-- endif -->    
+#endif
     <toolitem action='calendar-go-back'/>
     <toolitem action='calendar-go-today'/>
     <toolitem action='calendar-go-forward'/>
-<!-- if !EXPRESS -->		      
+#if !EXPRESS
     <separator/>
     <toolitem action='calendar-jump-to'/>
-<!-- endif -->        
+#endif
     <separator/>
     <toolitem action='calendar-view-day'/>
     <toolitem action='calendar-view-workweek'/>
-<!-- if !EXPRESS -->		      
+#if !EXPRESS
     <toolitem action='calendar-view-week'/>
-<!-- endif -->    
+#endif
 
     <toolitem action='calendar-view-month'/>
-<!-- if !EXPRESS -->		      
+#if !EXPRESS
     <toolitem action='calendar-view-list'/>
-<!-- endif -->    
-<!-- if EXPRESS -->
+#endif
+#if EXPRESS
     <separator expand="true"/>
     <toolitem action='quit-calendar'/>
-<!-- endif -->    
+#endif
 
   </toolbar>
   <popup name='calendar-popup'>
diff --git a/ui/evolution-mail-reader.ui b/ui/evolution-mail-reader.ui
index 4ca9522..ad0b401 100644
--- a/ui/evolution-mail-reader.ui
+++ b/ui/evolution-mail-reader.ui
@@ -25,10 +25,10 @@
       <separator/>
       <placeholder name='mail-message-view-actions'>
         <menuitem action='mail-load-images'/>
-<!-- if !EXPRESS -->
+#if !EXPRESS
         <menuitem action='mail-show-all-headers'/>
         <menuitem action='mail-caret-mode'/>
-<!-- endif -->
+#endif
         <menuitem action='mail-show-source'/>
         <menu action='mail-zoom-menu'>
           <menuitem action='mail-zoom-in'/>
@@ -122,19 +122,19 @@
         </menu>
       </toolitem>
       <separator/>
-<!-- if !EXPRESS -->
+#if !EXPRESS
       <toolitem action='mail-print'/>
-<!-- endif -->
+#endif
       <toolitem action='mail-delete'/>
       <toolitem action='mail-mark-junk'/>
       <toolitem action='mail-mark-notjunk'/>
     </placeholder>
     <separator/>
     <placeholder name='mail-toolbar-navigation'>
-<!-- if !EXPRESS -->
+#if !EXPRESS
       <toolitem action='mail-previous'/>
       <toolitem action='mail-next'/>
-<!-- endif -->
+#endif
     </placeholder>
   </toolbar>
   <popup name='mail-message-popup'>
diff --git a/ui/evolution-mail.ui b/ui/evolution-mail.ui
index 6110b8d..849d579 100644
--- a/ui/evolution-mail.ui
+++ b/ui/evolution-mail.ui
@@ -61,21 +61,21 @@
     </menu>
   </menubar>
   <toolbar name='main-toolbar'>
-<!-- if EXPRESS -->
+#if EXPRESS
     <placeholder name='toolbar-actions'>
       <toolitem action='new-addressbook-window'/>
     </placeholder>
-<!-- endif -->
+#endif
     <placeholder name='mail-toolbar-common'/>
-<!-- if !EXPRESS -->
+#if !EXPRESS
     <toolitem action='mail-stop'/>
-<!-- endif -->
+#endif
     <separator/>
     <placeholder name='mail-toolbar-navigation'/>
-<!-- if EXPRESS -->
+#if EXPRESS
     <separator/>
     <toolitem action='preferences'/>
-<!-- endif -->
+#endif
   </toolbar>
   <popup name='mail-folder-popup'>
     <placeholder name='mail-folder-popup-actions'/>
diff --git a/ui/evolution-shell.ui b/ui/evolution-shell.ui
index dfa6e76..2407260 100644
--- a/ui/evolution-shell.ui
+++ b/ui/evolution-shell.ui
@@ -2,9 +2,9 @@
   <menubar name='main-menu'>
     <menu action='file-menu'>
       <menu action='new-menu'/>
-<!-- if !EXPRESS -->
+#if !EXPRESS
       <menuitem action='new-window'/>
-<!-- endif -->
+#endif
       <separator/>
       <menuitem action='send-receive'/>
       <placeholder name='file-actions'/>
@@ -45,16 +45,16 @@
         <separator/>
         <menuitem action='gal-define-views'/>
       </menu>
-<!-- if !EXPRESS -->
+#if !EXPRESS
       <menu action='window-menu'/>
-<!-- endif -->
+#endif
       <menu action='layout-menu'>
         <menuitem action='show-toolbar'/>
         <menuitem action='show-taskbar'/>
         <menuitem action='show-sidebar'/>
       </menu>
       <placeholder name='view-custom-menus'/>
-<!-- if !EXPRESS -->
+#if !EXPRESS
       <menu action='switcher-menu'>
         <menuitem action='switcher-style-both'/>
         <menuitem action='switcher-style-icons'/>
@@ -63,7 +63,7 @@
         <separator/>
         <menuitem action='show-switcher'/>
       </menu>
-<!-- endif -->
+#endif
     </menu>
     <placeholder name='custom-menus'/>
     <menu action='search-menu'>



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