[monkey-bubble: 676/753] include gnome-i18nP.h



commit 1f1f3ad4193f6160a43cc50f4f24888938451575
Author: George Lebl <jirka 5z com>
Date:   Mon Aug 27 07:33:20 2001 +0000

    include gnome-i18nP.h
    
    Mon Aug 27 00:32:57 2001  George Lebl <jirka 5z com>
    
    	* gnome-gconf.c: include gnome-i18nP.h
    
    	* gnome-init.[ch], gnome-program.[ch]: Fix include stuff foo,
    	  declare the externs in the header file, initialize triggers again,
    	  and put back the sound stuff so that we're at 1.0 level on that.
    	  Also added a few descriptions of GnomeProgram properties.

 libgnome/ChangeLog       |    9 +++++
 libgnome/gnome-gconf.c   |    2 +
 libgnome/gnome-init.c    |   74 +++++++++++++++++++++++++++++++++++++++++-----
 libgnome/gnome-init.h    |    4 ++
 libgnome/gnome-program.c |   51 +++++++++++++++++++++++++++++--
 libgnome/gnome-program.h |    3 +-
 6 files changed, 130 insertions(+), 13 deletions(-)
---
diff --git a/libgnome/ChangeLog b/libgnome/ChangeLog
index f1575dd..9dd862e 100644
--- a/libgnome/ChangeLog
+++ b/libgnome/ChangeLog
@@ -1,3 +1,12 @@
+Mon Aug 27 00:32:57 2001  George Lebl <jirka 5z com>
+
+	* gnome-gconf.c: include gnome-i18nP.h
+
+	* gnome-init.[ch], gnome-program.[ch]: Fix include stuff foo, 
+	  declare the externs in the header file, initialize triggers again,
+	  and put back the sound stuff so that we're at 1.0 level on that.
+	  Also added a few descriptions of GnomeProgram properties.
+
 Sun Aug 26 22:54:57 2001  George Lebl <jirka 5z com>
 
 	* libgnome.h, Makefile.am, gnome-gconf.c: Getting confused a bit,
diff --git a/libgnome/gnome-gconf.c b/libgnome/gnome-gconf.c
index bc17b86..2a882e1 100644
--- a/libgnome/gnome-gconf.c
+++ b/libgnome/gnome-gconf.c
@@ -32,6 +32,8 @@
 #include <gconf/gconf-client.h>
 extern struct poptOption gconf_options[];
 
+#include "gnome-i18nP.h"
+
 #include <libgnome/libgnome.h>
 #include "gnome-gconf.h"
 
diff --git a/libgnome/gnome-init.c b/libgnome/gnome-init.c
index 639599d..7ac2f48 100644
--- a/libgnome/gnome-init.c
+++ b/libgnome/gnome-init.c
@@ -39,9 +39,11 @@
 #include <glib.h>
 #include "gnome-i18nP.h"
 
-#include <libgnome/gnome-init.h>
-#include <libgnome/gnome-gconf.h>
-#include <libgnome/gnome-util.h>
+#include "gnome-init.h"
+#include "gnome-gconf.h"
+#include "gnome-util.h"
+#include "gnome-sound.h"
+#include "gnome-triggers.h"
 
 #include <errno.h>
 
@@ -390,7 +392,7 @@ GnomeModuleInfo libbonobo_module_info = {
  * libgnome
  *****************************************************************************/
 
-enum { ARG_VERSION = 1 };
+enum { ARG_DISABLE_SOUND = 1, ARG_ENABLE_SOUND, ARG_ESPEAKER, ARG_VERSION };
 
 char *gnome_user_dir = NULL, *gnome_user_private_dir = NULL, *gnome_user_accels_dir = NULL;
 
@@ -400,12 +402,37 @@ libgnome_option_cb (poptContext ctx, enum poptCallbackReason reason,
 		    void *data)
 {
 	GnomeProgram *program;
+	GValue value = { 0 };
 
 	program = gnome_program_get ();
 	
 	switch(reason) {
 	case POPT_CALLBACK_REASON_OPTION:
 		switch(opt->val) {
+		case ARG_ESPEAKER:
+			g_value_init (&value, G_TYPE_STRING);
+			g_value_set_string (&value, opt->arg);
+			g_object_set (G_OBJECT (program),
+				      GNOME_PARAM_ESPEAKER, &value);
+			g_value_unset (&value);
+			break;
+
+		case ARG_DISABLE_SOUND:
+			g_value_init (&value, G_TYPE_BOOLEAN);
+			g_value_set_boolean (&value, FALSE);
+			g_object_set (G_OBJECT (program),
+				      GNOME_PARAM_ENABLE_SOUND, &value);
+			g_value_unset (&value);
+			break;
+
+		case ARG_ENABLE_SOUND:
+			g_value_init (&value, G_TYPE_BOOLEAN);
+			g_value_set_boolean (&value, TRUE);
+			g_object_set (G_OBJECT (program),
+				      GNOME_PARAM_ENABLE_SOUND, &value);
+			g_value_unset (&value);
+			break;
+
 		case ARG_VERSION:
 			g_print ("Gnome %s %s\n",
 				 gnome_program_get_name (program),
@@ -476,15 +503,35 @@ static void
 libgnome_post_args_parse (GnomeProgram *program,
 			  GnomeModuleInfo *mod_info)
 {
-	GValue value = { 0, };
-	gboolean create_dirs_val;
+	GValue value = { 0 };
+	gboolean enable_val = TRUE, create_dirs_val = TRUE;                           
+	char *espeaker_val = NULL;                                                    
 
 	g_value_init (&value, G_TYPE_BOOLEAN);
-	g_object_get_property (G_OBJECT (program), "create-directories", &value);
+	g_object_get_property (G_OBJECT (program),
+			       GNOME_PARAM_CREATE_DIRECTORIES,
+			       &value);
 	create_dirs_val = g_value_get_boolean (&value);
 	g_value_unset (&value);
 
-	// gnome_triggers_init ();
+	g_value_init (&value, G_TYPE_BOOLEAN);
+	g_object_get_property (G_OBJECT (program), 
+			       GNOME_PARAM_ENABLE_SOUND, &value);
+	enable_val = g_value_get_boolean (&value);
+	g_value_unset (&value);
+
+	g_value_init (&value, G_TYPE_STRING);
+	g_object_get_property (G_OBJECT (program), 
+			       GNOME_PARAM_ESPEAKER, &value);
+	espeaker_val = g_value_dup_string (&value);
+	g_value_unset (&value);
+
+
+	if (enable_val) {
+		gnome_sound_init(espeaker_val);
+	}
+
+	gnome_triggers_init ();
 
 	libgnome_userdir_setup (create_dirs_val);
 
@@ -498,6 +545,17 @@ static struct poptOption gnomelib_options [] = {
 
 	{ NULL, '\0', POPT_ARG_CALLBACK, (void *) libgnome_option_cb, 0, NULL, NULL},
 
+	{ "disable-sound", '\0', POPT_ARG_NONE,                                 
+	  NULL, ARG_DISABLE_SOUND, N_("Disable sound server usage"), NULL},     
+
+	{ "enable-sound", '\0', POPT_ARG_NONE,                                  
+	  NULL, ARG_ENABLE_SOUND, N_("Enable sound server usage"), NULL},       
+
+	{ "espeaker", '\0', POPT_ARG_STRING,                                    
+	  NULL, ARG_ESPEAKER, N_("Host:port on which the sound server to use is 
+				 running"),
+	  N_("HOSTNAME:PORT")},                                                 
+
 	{"version", '\0', POPT_ARG_NONE, NULL, },
 
 	{ NULL, '\0', 0, NULL, 0 }
diff --git a/libgnome/gnome-init.h b/libgnome/gnome-init.h
index 1c15c06..425ec1d 100644
--- a/libgnome/gnome-init.h
+++ b/libgnome/gnome-init.h
@@ -61,6 +61,10 @@ extern GnomeModuleInfo gnome_bonobo_activation_module_info;
 extern GnomeModuleInfo gnome_vfs_module_info;
 extern GnomeModuleInfo libgnome_module_info;
 
+extern char *gnome_user_dir;
+extern char *gnome_user_private_dir;
+extern char *gnome_user_accels_dir;
+
 G_END_DECLS
 
 #endif /* LIBGNOMEINIT_H */
diff --git a/libgnome/gnome-program.c b/libgnome/gnome-program.c
index 5a1bbd6..eb2af8c 100644
--- a/libgnome/gnome-program.c
+++ b/libgnome/gnome-program.c
@@ -66,6 +66,8 @@ struct _GnomeProgramPrivate {
     gchar *prop_app_sysconfdir;
     gchar *prop_app_datadir;
     gboolean prop_create_directories;
+    gboolean prop_enable_sound;
+    gchar *prop_espeaker;
 
     gchar **gnome_path;
 
@@ -101,6 +103,8 @@ enum {
     PROP_APP_DATADIR,
     PROP_APP_SYSCONFDIR,
     PROP_CREATE_DIRECTORIES,
+    PROP_ENABLE_SOUND,
+    PROP_ESPEAKER,
     PROP_POPT_TABLE,
     PROP_POPT_FLAGS,
     PROP_POPT_CONTEXT,
@@ -166,6 +170,7 @@ gnome_program_set_property (GObject *object, guint param_id,
 	program->_priv->prop_module_info = g_value_dup_boxed ((GValue *) value);
 	break;
     case PROP_MODULES:
+	g_free (program->_priv->prop_module_list);
 	program->_priv->prop_module_list = g_value_dup_string (value);
 	break;
     case PROP_POPT_TABLE:
@@ -175,6 +180,7 @@ gnome_program_set_property (GObject *object, guint param_id,
 	program->_priv->prop_popt_flags = g_value_get_int (value);
 	break;
     case PROP_HUMAN_READABLE_NAME:
+	g_free (program->_priv->prop_human_readable_name);
 	program->_priv->prop_human_readable_name = g_value_dup_string (value);
 	break;
     case PROP_GNOME_PATH:
@@ -187,20 +193,31 @@ gnome_program_set_property (GObject *object, guint param_id,
 		(g_value_get_string (value), ":", -1);
 	break;
     case PROP_APP_PREFIX:
+	g_free (program->_priv->prop_app_prefix);
 	program->_priv->prop_app_prefix = g_value_dup_string (value);
 	break;
     case PROP_APP_SYSCONFDIR:
+	g_free (program->_priv->prop_app_sysconfdir);
 	program->_priv->prop_app_sysconfdir = g_value_dup_string (value);
 	break;
     case PROP_APP_DATADIR:
+	g_free (program->_priv->prop_app_datadir);
 	program->_priv->prop_app_datadir = g_value_dup_string (value);
 	break;
     case PROP_APP_LIBDIR:
+	g_free (program->_priv->prop_app_libdir);
 	program->_priv->prop_app_libdir = g_value_dup_string (value);
 	break;
     case PROP_CREATE_DIRECTORIES:
 	program->_priv->prop_create_directories = g_value_get_boolean (value);
 	break;
+    case PROP_ENABLE_SOUND:
+	program->_priv->prop_enable_sound = g_value_get_boolean (value);
+	break;
+    case PROP_ESPEAKER:
+	g_free (program->_priv->prop_espeaker);
+	program->_priv->prop_espeaker = g_value_dup_string (value);
+	break;
     default: {
 	    GObjectSetPropertyFunc set_func;
 
@@ -260,6 +277,12 @@ gnome_program_get_property (GObject *object, guint param_id, GValue *value,
     case PROP_CREATE_DIRECTORIES:
 	g_value_set_boolean (value, program->_priv->prop_create_directories);
 	break;
+    case PROP_ENABLE_SOUND:
+	g_value_set_boolean (value, program->_priv->prop_enable_sound);
+	break;
+    case PROP_ESPEAKER:
+	g_value_set_string (value, program->_priv->prop_espeaker);
+	break;
     default: {
 	    GObjectSetPropertyFunc get_func;
 
@@ -431,7 +454,9 @@ gnome_program_class_init (GnomeProgramClass *class)
     g_object_class_install_property
 	(object_class,
 	 PROP_HUMAN_READABLE_NAME,
-	 g_param_spec_string (GNOME_PARAM_HUMAN_READABLE_NAME, NULL, NULL,
+	 g_param_spec_string (GNOME_PARAM_HUMAN_READABLE_NAME,
+			      _("Human readable name"), 
+			      _("Human readable name of this application"),
 			      NULL,
 			      (G_PARAM_READABLE | G_PARAM_WRITABLE |
 			       G_PARAM_CONSTRUCT_ONLY)));
@@ -439,7 +464,9 @@ gnome_program_class_init (GnomeProgramClass *class)
     g_object_class_install_property
 	(object_class,
 	 PROP_GNOME_PATH,
-	 g_param_spec_string (GNOME_PARAM_GNOME_PATH, NULL, NULL,
+	 g_param_spec_string (GNOME_PARAM_GNOME_PATH, 
+			      _("GNOME path"), 
+			      _("Path in which to look for installed files"),
 			      g_getenv ("GNOME2_PATH"),
 			      (G_PARAM_READABLE | G_PARAM_WRITABLE |
 			       G_PARAM_CONSTRUCT_ONLY)));
@@ -453,7 +480,9 @@ gnome_program_class_init (GnomeProgramClass *class)
     g_object_class_install_property
 	(object_class,
 	 PROP_APP_VERSION,
-	 g_param_spec_string (GNOME_PARAM_APP_VERSION, NULL, NULL,
+	 g_param_spec_string (GNOME_PARAM_APP_VERSION, 
+			      _("App version"), 
+			      _("Version of this application"),
 			      NULL, G_PARAM_READABLE));
 
     g_object_class_install_property
@@ -496,6 +525,22 @@ gnome_program_class_init (GnomeProgramClass *class)
 			       (G_PARAM_READABLE | G_PARAM_WRITABLE |
 				G_PARAM_CONSTRUCT_ONLY)));
 
+    g_object_class_install_property
+	(object_class,
+	 PROP_ENABLE_SOUND,
+	 g_param_spec_boolean (GNOME_PARAM_ENABLE_SOUND, NULL, NULL,
+			       TRUE,
+			       (G_PARAM_READABLE | G_PARAM_WRITABLE |
+				G_PARAM_CONSTRUCT_ONLY)));
+
+    g_object_class_install_property
+	(object_class,
+	 PROP_ESPEAKER,
+	 g_param_spec_string (GNOME_PARAM_ESPEAKER, NULL, NULL,
+			      NULL,
+			      (G_PARAM_READABLE | G_PARAM_WRITABLE |
+			       G_PARAM_CONSTRUCT_ONLY)));
+
     object_class->finalize  = gnome_program_finalize;
 }
 
diff --git a/libgnome/gnome-program.h b/libgnome/gnome-program.h
index 319d7cf..f907b6c 100644
--- a/libgnome/gnome-program.h
+++ b/libgnome/gnome-program.h
@@ -101,9 +101,8 @@ gnome_program_locate_file               (GnomeProgram    *program,
 #define GNOME_PARAM_POPT_FLAGS          "popt-flags"
 #define GNOME_PARAM_POPT_CONTEXT        "popt-context"
 #define GNOME_PARAM_CREATE_DIRECTORIES  "create-directories"
-#define GNOME_PARAM_SOUND_DRIVER	"sound-driver"
 #define GNOME_PARAM_ENABLE_SOUND        "enable-sound"
-#define GNOME_PARAM_FILE_LOCATOR        "file-locator"
+#define GNOME_PARAM_ESPEAKER            "espeaker"
 #define GNOME_PARAM_APP_ID              "app-id"
 #define GNOME_PARAM_APP_VERSION         "app-version"
 #define GNOME_PARAM_APP_PREFIX          "app-prefix"



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