[the-board] [ui] Add getUserDirs to Application's DBUs/HTTP api
- From: Lucas Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board] [ui] Add getUserDirs to Application's DBUs/HTTP api
- Date: Tue, 30 Nov 2010 18:26:33 +0000 (UTC)
commit 8ec6e99f76f96b4fe79813f9617fb37a87a842e3
Author: Lucas Rocha <lucasr gnome org>
Date: Tue Nov 30 16:07:39 2010 +0000
[ui] Add getUserDirs to Application's DBUs/HTTP api
Returns the directories to which files should be downloaded to by
browser extensions.
src/js/ui/application.js | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/js/ui/application.js b/src/js/ui/application.js
index d7d613f..c6dce3c 100644
--- a/src/js/ui/application.js
+++ b/src/js/ui/application.js
@@ -12,6 +12,7 @@ if (Features.HAVE_LIBSOUP) {
}
// gi imports
+const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Mx = imports.gi.Mx;
@@ -34,7 +35,8 @@ const TheBoardIface = {
{ name: "addThing" },
{ name: "addThings",
inSignature: 'aa{sv}',
- outSignature: '' } ],
+ outSignature: '' },
+ { name: "getUserDirs" } ],
signals: [],
@@ -165,6 +167,19 @@ Application.prototype = {
this._showNotification(Gettext.gettext("Added to The Board"));
},
+ // DBus method
+ getUserDirs : function(args) {
+ let userDirs = {};
+
+ let picsDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES);
+ userDirs.pictures = picsDir + "/The Board";
+
+ let videosDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_VIDEOS);
+ userDirs.videos = videosDir + "/The Board";
+
+ return userDirs;
+ },
+
quit : function() {
Gtk.main_quit();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]