[tasks] Add an enum of unique commands



commit ced23a9b17ef784799c9d3108036b3059ab897cf
Author: Ross Burton <ross linux intel com>
Date:   Fri Mar 20 16:05:34 2009 +0000

    Add an enum of unique commands
---
 src/gtk/main.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gtk/main.c b/src/gtk/main.c
index 56b085a..c8eece1 100644
--- a/src/gtk/main.c
+++ b/src/gtk/main.c
@@ -48,6 +48,11 @@
 
 #if WITH_UNIQUE
 #include <unique/unique.h>
+
+enum {
+  COMMAND_ACTIVATE = UNIQUE_ACTIVATE,
+  COMMAND_EDIT = 1
+};
 #endif
 
 #include "ui.h"
@@ -540,7 +545,7 @@ do_message_received (UniqueApp         *app,
                      gpointer           user_data)
 {
   switch (command) {
-  case UNIQUE_ACTIVATE:
+  case COMMAND_ACTIVATE:
     gtk_window_set_screen (GTK_WINDOW (window),
 			   unique_message_data_get_screen (message));
     gtk_window_present_with_time (GTK_WINDOW (window), time_);
@@ -591,12 +596,13 @@ main (int argc, char **argv)
   }
 
 #if WITH_UNIQUE
-  app = unique_app_new ("org.pimlico-project.Tasks", NULL);
-
+  app = unique_app_new_with_commands ("org.pimlico-project.Tasks", NULL,
+                                      "edit", COMMAND_EDIT,
+                                      NULL);
   if (unique_app_is_running (app)) {
     UniqueResponse response;
 
-    response = unique_app_send_message (app, UNIQUE_ACTIVATE, NULL);
+    response = unique_app_send_message (app, COMMAND_ACTIVATE, NULL);
 
     gdk_notify_startup_complete ();
 



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