[totem] Fix remote commands not working



commit d53a52a179f4c995d9785cd111441f888e6aff40
Author: Bastien Nocera <hadess hadess net>
Date:   Sat May 16 16:55:06 2009 +0100

    Fix remote commands not working
    
    2009-05-16  Bastien Nocera  <hadess hadess net>
    
    	* src/totem-options.c (totem_options_register_remote_commands):
    	* src/totem-options.h:
    	* src/totem.c (main): Register the remote commands for
    	use by UniqueApp, fixes remote commands not working...
---
 ChangeLog           |    7 +++++++
 src/totem-options.c |   15 +++++++++++++++
 src/totem-options.h |    7 ++++---
 src/totem.c         |    1 +
 4 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 53e1ab9..05d4859 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-05-16  Bastien Nocera  <hadess hadess net>
 
+	* src/totem-options.c (totem_options_register_remote_commands):
+	* src/totem-options.h:
+	* src/totem.c (main): Register the remote commands for
+	use by UniqueApp, fixes remote commands not working...
+
+2009-05-16  Bastien Nocera  <hadess hadess net>
+
 	* src/totem-object.c (totem_remote_command_get_type):
 	Add missing enum values to the GEnumClass
 
diff --git a/src/totem-options.c b/src/totem-options.c
index 365deea..57e3d8b 100644
--- a/src/totem-options.c
+++ b/src/totem-options.c
@@ -83,6 +83,21 @@ totem_options_process_late (Totem *totem, const TotemCmdLineOptions* options)
 }
 
 void
+totem_options_register_remote_commands (Totem *totem)
+{
+	GEnumClass *klass;
+	guint i;
+
+	klass = (GEnumClass *) g_type_class_ref (TOTEM_TYPE_REMOTE_COMMAND);
+	for (i = TOTEM_REMOTE_COMMAND_UNKNOWN + 1; i < klass->n_values; i++) {
+		GEnumValue *val;
+		val = g_enum_get_value (klass, i);
+		unique_app_add_command (totem->app, val->value_name, i);
+	}
+	g_type_class_unref (klass);
+}
+
+void
 totem_options_process_early (Totem *totem, const TotemCmdLineOptions* options)
 {
 	if (options->quit) {
diff --git a/src/totem-options.h b/src/totem-options.h
index 5ce1d2b..33830da 100644
--- a/src/totem-options.h
+++ b/src/totem-options.h
@@ -58,12 +58,13 @@ typedef struct
 extern const GOptionEntry options[];
 extern TotemCmdLineOptions optionstate;
 
+void totem_options_register_remote_commands (Totem *totem);
 void totem_options_process_early (Totem *totem,
-	const TotemCmdLineOptions* options);
+				  const TotemCmdLineOptions* options);
 void totem_options_process_late (Totem *totem, 
-	const TotemCmdLineOptions* options);
+				 const TotemCmdLineOptions* options);
 void totem_options_process_for_server (UniqueApp *app,
-	const TotemCmdLineOptions* options);
+				       const TotemCmdLineOptions* options);
 
 G_END_DECLS
 
diff --git a/src/totem.c b/src/totem.c
index 46bd3ae..0596ff0 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -175,6 +175,7 @@ main (int argc, char **argv)
 	/* IPC stuff */
 	if (optionstate.notconnectexistingsession == FALSE) {
 		totem->app = unique_app_new ("org.gnome.Totem", NULL);
+		totem_options_register_remote_commands (totem);
 		if (unique_app_is_running (totem->app) != FALSE) {
 			totem_options_process_for_server (totem->app, &optionstate);
 			gdk_notify_startup_complete ();



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