mail-notification

Fork of Jean-Yves Lefort's mail-notification, a tray icon to notify of new mail
git clone https://code.djc.id.au/git/mail-notification/
commit 1775f3635e507f250ea6dddda2fd2dc31f431e64
parent c4f7800b8093c7ea6ab77a29d139172d41eb715c
Author: Jean-Yves Lefort <jylefort@brutele.be>
Date:   Fri, 21 Mar 2008 01:56:45 +1000

mail-notification-5.2

* Core changes:
        * GConf default values were no longer registered:
          fixed
        * The GConf sanity check code (which caused MN to
          refuse to run if some GConf default values are
          missing) was no longer compiled in: fixed

Diffstat:
MNEWS | 9+++++++++
Mhelp/C/mail-notification-C.omf.in | 2+-
Mhelp/C/mail-notification.xml | 17++++++++++++++---
Mjbsrc/jb.c | 12++++++------
Mjbsrc/lib/src/core/jb-group.c | 10+++++-----
Mjbsrc/lib/src/core/jb-resource.c | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mjbsrc/lib/src/core/jb-resource.h | 18++++++++++++++++++
Mpo/es.po | 4++--
Mpo/fr.po | 4++--
Mpo/sr.po | 4++--
Mpo/sr@Latn.po | 4++--
Mpo/sv.po | 4++--
Msrc/mn-conf.c | 4++--
13 files changed, 126 insertions(+), 27 deletions(-)
diff --git a/NEWS b/NEWS
@@ -1,3 +1,12 @@
+5.2					March 20, 2008
+
+	* Core changes:
+		* GConf default values were no longer registered:
+		  fixed
+		* The GConf sanity check code (which caused MN to
+		  refuse to run if some GConf default values are
+		  missing) was no longer compiled in: fixed
+
 5.1					March 20, 2008
 
 	* Core changes:
diff --git a/help/C/mail-notification-C.omf.in b/help/C/mail-notification-C.omf.in
@@ -14,7 +14,7 @@
     <date>
       2008-03-20
     </date>
-    <version identifier="2.22" date="2008-03-20" description="Version 2.22"/>
+    <version identifier="2.23" date="2008-03-20" description="Version 2.23"/>
     <subject category="GNOME|Internet"/>
     <description>
       Mail Notification Manual
diff --git a/help/C/mail-notification.xml b/help/C/mail-notification.xml
@@ -2,8 +2,8 @@
 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
   <!ENTITY app "<application>Mail Notification</application>">
-  <!ENTITY appversion "5.1">
-  <!ENTITY manrevision "2.22">
+  <!ENTITY appversion "5.2">
+  <!ENTITY manrevision "2.23">
   <!ENTITY date "Thursday, March 20, 2008">
 
   <!ENTITY project "The Mail Notification Project">
@@ -26,7 +26,7 @@
   <!ENTITY gnomevfs "<link linkend=&#34;gnomevfs&#34;>GnomeVFS</link>">
 ]>
 
-<!-- $Id: mail-notification.xml,v 1.184 2008-03-19 23:55:47 jylefort Exp $ -->
+<!-- $Id: mail-notification.xml,v 1.185 2008-03-20 15:47:14 jylefort Exp $ -->
 <!-- Mail Notification Manual -->
 
 <!-- Copyright (C) 2003-2008 Jean-Yves Lefort -->
@@ -112,6 +112,17 @@
 	</revdescription>
       </revision>
       <revision>
+	<revnumber>Mail Notification Manual V2.22</revnumber>
+	<date>Thursday, March 20, 2008</date>
+	<revdescription>
+	  <para role="author">
+	    Jean-Yves Lefort
+	    <email>jylefort@brutele.be</email>
+	  </para>
+	  <para role="publisher">&project;</para>
+	</revdescription>
+      </revision>
+      <revision>
 	<revnumber>Mail Notification Manual V2.21</revnumber>
 	<date>Friday, January 4, 2008</date>
 	<revdescription>
diff --git a/jbsrc/jb.c b/jbsrc/jb.c
@@ -153,7 +153,7 @@ jb_package_init (void)
   jb_variable_add_bool("compile-warnings", NULL, NULL, 0, FALSE);
   jb_variable_add_bool("debug", NULL, NULL, 0, FALSE);
   jb_variable_add_bool("regression-tests", NULL, NULL, 0, FALSE);
-  jb_variable_add_bool("gconf-sanity-check", NULL, NULL, 0, TRUE);
+  jb_variable_add_bool("gconf-sanity-check", NULL, NULL, JB_VARIABLE_C_DEFINE, TRUE);
 }
 
 void
@@ -424,7 +424,7 @@ jb_package_add_resources (void)
     }
 
   jb_compile_options_add_string_defines(object->compile_options,
-					"PACKAGE", "$package", 
+					"PACKAGE", "$package",
 					"VERSION", "$version",
 					"PREFIX", "$prefix",
 					"SYSCONFDIR", "$sysconfdir",
@@ -503,7 +503,7 @@ jb_package_add_resources (void)
 
   if (jb_variable_get_bool("mh"))
     jb_object_add_source(object, "MN:MH:Mailbox:Backend");
-    
+
   if (jb_variable_get_bool("maildir"))
     jb_object_add_sources(object,
 			  "MN:Maildir:Mailbox:Backend",
@@ -615,7 +615,7 @@ jb_package_add_resources (void)
       jb_compile_options_add_package(object->compile_options, "openssl");
       jb_object_add_source(object, "mn-ssl");
     }
-    
+
   if (jb_variable_get_bool("sasl"))
     {
       jb_compile_options_add_package(object->compile_options, "sasl2");
@@ -692,7 +692,7 @@ jb_package_add_resources (void)
 			  "mailbox-properties-dialog.glade", "$pkgdatadir",
 			  "properties-dialog.glade", "$pkgdatadir",
 			  NULL);
-  
+
   jb_group_add(group);
 
   if (jb_variable_get_bool("regression-tests"))
@@ -706,4 +706,4 @@ jb_package_add_resources (void)
     }
 }
 
-JB_MAIN("mail-notification", "5.1", "Mail Notification")
+JB_MAIN("mail-notification", "5.2", "Mail Notification")
diff --git a/jbsrc/lib/src/core/jb-group.c b/jbsrc/lib/src/core/jb-group.c
@@ -275,17 +275,17 @@ jb_group_add_desktop_file (JBGroup *self,
 void
 jb_group_add_gconf_schemas (JBGroup *self, const char *filename)
 {
+  JBGConfSchemas *schemas;
+
   g_return_if_fail(JB_IS_GROUP(self));
   g_return_if_fail(filename != NULL);
   g_return_if_fail(jb_feature_is_enabled(&jb_gconf_feature));
   g_return_if_fail(jb_feature_is_enabled(&jb_intltool_feature));
   g_return_if_fail(jb_intltool_use_xml);
 
-  add_intltool_file(self,
-		    "GConf schemas",
-		    filename,
-		    "-s",
-		    "$gconf-schemas-dir");
+  schemas = jb_gconf_schemas_new(filename);
+
+  jb_group_add_resource(self, JB_GROUP_RESOURCE(schemas));
 }
 
 void
diff --git a/jbsrc/lib/src/core/jb-resource.c b/jbsrc/lib/src/core/jb-resource.c
@@ -1106,6 +1106,67 @@ jb_intltool_file_class_init (JBIntltoolFileClass *class)
   rclass->maintainerclean = intltool_file_maintainerclean;
 }
 
+G_DEFINE_TYPE(JBGConfSchemas, jb_gconf_schemas, JB_TYPE_INTLTOOL_FILE)
+
+JBGConfSchemas *
+jb_gconf_schemas_new (const char *filename)
+{
+  JBGConfSchemas *self;
+  JBIntltoolFile *intltool_file;
+
+  self = g_object_new(JB_TYPE_GCONF_SCHEMAS, NULL);
+
+  intltool_file = JB_INTLTOOL_FILE(self);
+
+  intltool_file->type = g_strdup("GConf schemas");
+  intltool_file->filename = g_strdup(filename);
+  intltool_file->merge_flags = g_strdup("-s");
+
+  return self;
+}
+
+static void
+gconf_schemas_install (JBResource *res)
+{
+  JBIntltoolFile *intltool_file = JB_INTLTOOL_FILE(res);
+
+  JB_RESOURCE_CLASS(jb_gconf_schemas_parent_class)->install(res);
+
+  if (jb_variable_get_bool("install-gconf-schemas"))
+    {
+      char *outfile;
+      char *filename;
+
+      intltool_file_get_files(intltool_file, NULL, &outfile);
+
+      filename = g_path_get_basename(outfile);
+      jb_message("installing GConf schemas %s", filename);
+      g_free(filename);
+
+      jb_action_exec("GCONF_CONFIG_SOURCE=$gconf-config-source $gconftool-2 --makefile-install-rule $outfile",
+		     "outfile", outfile,
+		     NULL);
+
+      g_free(outfile);
+    }
+}
+
+static void
+jb_gconf_schemas_init (JBGConfSchemas *self)
+{
+  JBIntltoolFile *intltool_file = JB_INTLTOOL_FILE(self);
+
+  jb_install_options_set_installdir(intltool_file->install_options, "$gconf-schemas-dir");
+}
+
+static void
+jb_gconf_schemas_class_init (JBGConfSchemasClass *class)
+{
+  JBResourceClass *rclass = JB_RESOURCE_CLASS(class);
+
+  rclass->install = gconf_schemas_install;
+}
+
 G_DEFINE_TYPE(JBGnomeHelp, jb_gnome_help, JB_TYPE_GROUP_RESOURCE)
 
 JBGnomeHelp *
diff --git a/jbsrc/lib/src/core/jb-resource.h b/jbsrc/lib/src/core/jb-resource.h
@@ -214,6 +214,24 @@ JBIntltoolFile *jb_intltool_file_new (const char *type,
 				      const char *filename,
 				      const char *merge_flags);
 
+#define JB_TYPE_GCONF_SCHEMAS		(jb_gconf_schemas_get_type())
+#define JB_GCONF_SCHEMAS(obj)		(G_TYPE_CHECK_INSTANCE_CAST((obj), JB_TYPE_GCONF_SCHEMAS, JBGConfSchemas))
+#define JB_IS_GCONF_SCHEMAS(obj)	(G_TYPE_CHECK_INSTANCE_TYPE((obj), JB_TYPE_GCONF_SCHEMAS))
+
+typedef struct
+{
+  JBIntltoolFile	parent;
+} JBGConfSchemas;
+
+typedef struct
+{
+  JBIntltoolFileClass	parent;
+} JBGConfSchemasClass;
+
+GType jb_gconf_schemas_get_type (void);
+
+JBGConfSchemas *jb_gconf_schemas_new (const char *filename);
+
 #define JB_TYPE_GNOME_HELP		(jb_gnome_help_get_type())
 #define JB_GNOME_HELP(obj)		(G_TYPE_CHECK_INSTANCE_CAST((obj), JB_TYPE_GNOME_HELP, JBGnomeHelp))
 #define JB_IS_GNOME_HELP(obj)		(G_TYPE_CHECK_INSTANCE_TYPE((obj), JB_TYPE_GNOME_HELP))
diff --git a/po/es.po b/po/es.po
@@ -8,10 +8,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: mail-notification 5.1\n"
+"Project-Id-Version: mail-notification 5.2\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-02-28 10:06+0100\n"
-"PO-Revision-Date: 2008-03-20 00:46+0100\n"
+"PO-Revision-Date: 2008-03-20 16:52+0100\n"
 "Last-Translator: Nacho Hermoso de Mendoza <gnacho@gmail.com>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
diff --git a/po/fr.po b/po/fr.po
@@ -8,10 +8,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: mail-notification 5.1\n"
+"Project-Id-Version: mail-notification 5.2\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-02-28 08:21+0100\n"
-"PO-Revision-Date: 2008-03-20 00:47+0100\n"
+"PO-Revision-Date: 2008-03-20 16:52+0100\n"
 "Last-Translator: Jean-Yves Lefort <jylefort@brutele.be>\n"
 "Language-Team: Jean-Yves Lefort <jylefort@brutele.be>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/sr.po b/po/sr.po
@@ -11,10 +11,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: mail-notification 5.1\n"
+"Project-Id-Version: mail-notification 5.2\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-02-28 10:07+0100\n"
-"PO-Revision-Date: 2008-03-20 00:45+0100\n"
+"PO-Revision-Date: 2008-03-20 16:52+0100\n"
 "Last-Translator: Филип Милетић <filmil@gmail.com>\n"
 "Language-Team: Serbian (sr) <gnu@prevod.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/sr@Latn.po b/po/sr@Latn.po
@@ -11,10 +11,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: mail-notification 5.1\n"
+"Project-Id-Version: mail-notification 5.2\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-02-28 10:07+0100\n"
-"PO-Revision-Date: 2008-03-20 00:45+0100\n"
+"PO-Revision-Date: 2008-03-20 16:52+0100\n"
 "Last-Translator: Filip Miletić <filmil@gmail.com>\n"
 "Language-Team: Serbian (sr) <gnu@prevod.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/sv.po b/po/sv.po
@@ -8,10 +8,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: mail-notification 5.1\n"
+"Project-Id-Version: mail-notification 5.2\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-02-28 10:07+0100\n"
-"PO-Revision-Date: 2008-03-20 00:47+0100\n"
+"PO-Revision-Date: 2008-03-20 16:52+0100\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
 "MIME-Version: 1.0\n"
diff --git a/src/mn-conf.c b/src/mn-conf.c
@@ -227,7 +227,7 @@ check_schemas (void)
   GConfClient *client;
   gboolean schema_missing = FALSE;
 
-  client = mn_conf_client_get_global();
+  client = mn_conf_get_client();
   g_assert(client != NULL);
 
   for (i = 0; i < G_N_ELEMENTS(keys); i++)
@@ -251,7 +251,7 @@ check_schemas (void)
     }
 
   if (schema_missing)
-    mn_fatal_error_dialog(NULL, _("The default configuration has not been installed properly. Please check your Mail Notification installation."));
+    mn_show_fatal_error_dialog(NULL, _("The default configuration has not been installed properly. Please check your Mail Notification installation."));
 }
 #endif /* WITH_GCONF_SANITY_CHECK */