[the-board/wip/http-api: 2/5] [ui] Add addThing DBus method to Application
- From: Lucas Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board/wip/http-api: 2/5] [ui] Add addThing DBus method to Application
- Date: Tue, 23 Nov 2010 23:16:43 +0000 (UTC)
commit 5a334f6b75531cb4736be373031f28ce82e746a6
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]