[the-board] [ui] Add addThing DBus method to Application



commit e380c4bf7fe5b5abb2fd3f29e7912ca900088eaf
Author: Lucas Rocha <lucasr gnome org>
Date:   Mon Nov 22 23:19:37 2010 +0000

    [ui] Add addThing DBus method to Application

 src/js/ui/application.js |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/src/js/ui/application.js b/src/js/ui/application.js
index aea033f..6fda56b 100644
--- a/src/js/ui/application.js
+++ b/src/js/ui/application.js
@@ -19,7 +19,8 @@ const TheBoardIface = {
 
     methods: [ { name: "activate",
                  inSignature: '',
-                 outSignature: '' } ],
+                 outSignature: '' },
+               { name: "addThing" } ],
 
     signals: [],
 
@@ -98,6 +99,28 @@ Application.prototype = {
         this._mainWindow.present();
     },
 
+    // DBus method
+    addThing : function(args) {
+        log('Application: addThing via DBus');
+
+        if (!('thingId' in args)) {
+            log('Application: addThing needs a thingId argument');
+            return;
+        }
+
+        let thingId = args.thingId;
+
+        // Any extra values in args are considered as
+        // thing-specific arguments
+        delete args.thingId;
+        let thingArgs = args;
+
+        if (this._mainWindow.currentPage) {
+            this._mainWindow.currentPage.addThingFromId(thingId,
+                                                        thingArgs);
+        }
+    },
+
     quit : function() {
         Gtk.main_quit();
     }



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