Commit 077c7326 authored by Michael Meeks's avatar Michael Meeks

Alter UI conditional syntax to be more familiar cpp style, which

avoids the need for intltool changes.
parent 214456fd
......@@ -97,24 +97,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';
......
......@@ -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>
......
......@@ -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'>
......
......@@ -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'/>
......
......@@ -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'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment