[Xfce4-commits] <postler:master> Add Progress() signal to DBus service

Christian Dywan noreply at xfce.org
Mon Dec 13 04:28:05 CET 2010


Updating branch refs/heads/master
         to 37240b2c09c2fd2fbce94b3625e6baee28eb0242 (commit)
       from 0da5691791c9808581f4e919a33b611e6629049a (commit)

commit 37240b2c09c2fd2fbce94b3625e6baee28eb0242
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Dec 12 23:34:16 2010 +0100

    Add Progress() signal to DBus service

 postler/postler-client.vala  |    6 ++++++
 postler/postler-service.vala |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/postler/postler-client.vala b/postler/postler-client.vala
index b72f435..9f89efa 100644
--- a/postler/postler-client.vala
+++ b/postler/postler-client.vala
@@ -13,6 +13,7 @@ namespace Postler {
 
     [DBus (name = "org.elementary.Postler")]
     interface PostlerClient : Object {
+        public signal void progress (string text, double fraction);
         public abstract bool receive (string account) throws IOError;
         public abstract bool send (string account, string filename) throws IOError;
     }
@@ -25,6 +26,9 @@ namespace Postler {
                 client = Bus.get_proxy_sync (BusType.SESSION,
                                              "org.elementary.Postler",
                                              "/org/elementary/postler");
+                client.progress.connect ((text, fraction) => {
+                    progress (text != "" ? text : null, fraction);
+                });
                 /* Ensure Postler is running, ignore errors */
                 Process.spawn_async (null,
                     { Postler.App.argv0, "-m", "service" }, null,
@@ -35,6 +39,8 @@ namespace Postler {
             } catch (GLib.Error error) { }
         }
 
+        public signal void progress (string? text, double fraction);
+
         public bool receive (string account="") {
             try {
                 return client.receive (account);
diff --git a/postler/postler-service.vala b/postler/postler-service.vala
index 65b1128..8b9c2d5 100644
--- a/postler/postler-service.vala
+++ b/postler/postler-service.vala
@@ -13,6 +13,8 @@ namespace Postler {
 
     [DBus (name = "org.elementary.Postler")]
     class PostlerService : Object {
+        public signal void progress (string text, double fraction);
+
         public bool receive (string account) {
             var infos = new GLib.List<AccountInfo> ();
             var accounts = new Accounts ();



More information about the Xfce4-commits mailing list