[Xfce4-commits] <postler:master> Implement Quit() in service and Ctrl+Q quits service

Christian Dywan noreply at xfce.org
Thu Feb 3 00:34:11 CET 2011


Updating branch refs/heads/master
         to 1f6c53b75d0920251602ede65b5dda99af355ff3 (commit)
       from 268c37618693a795ca89da6c97f513153c9544e5 (commit)

commit 1f6c53b75d0920251602ede65b5dda99af355ff3
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Feb 2 23:32:14 2011 +0100

    Implement Quit() in service and Ctrl+Q quits service

 postler/postler-bureau.vala  |    1 +
 postler/postler-client.vala  |   10 +++++++++-
 postler/postler-service.vala |    6 +++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index eef6e5f..722a05d 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -341,6 +341,7 @@ public class Postler.Bureau : Gtk.Window {
     }
 
     void action_quit () {
+        client.quit ();
         Gtk.main_quit ();
     }
 
diff --git a/postler/postler-client.vala b/postler/postler-client.vala
index 17b36d7..2502799 100644
--- a/postler/postler-client.vala
+++ b/postler/postler-client.vala
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2010 Christian Dywan <christian at twotoasts.de>
+ Copyright (C) 2011 Christian Dywan <christian at twotoasts.de>
 
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
@@ -17,6 +17,7 @@ namespace Postler {
         public abstract bool receive (string account) throws IOError;
         public abstract bool fetch (string account) throws IOError;
         public abstract bool send (string account, string filename) throws IOError;
+        public abstract void quit () throws IOError;
     }
 
     public class Client : Object {
@@ -63,6 +64,13 @@ namespace Postler {
                 return false;
             }
         }
+
+        public void quit () {
+            try {
+                client.quit ();
+            } catch (GLib.Error error) {
+            }
+        }
     }
 }
 
diff --git a/postler/postler-service.vala b/postler/postler-service.vala
index 9890517..023c0b6 100644
--- a/postler/postler-service.vala
+++ b/postler/postler-service.vala
@@ -298,6 +298,10 @@ namespace Postler {
             }
             return false;
         }
+
+        public void quit () {
+            Gtk.main_quit ();
+        }
     }
 
     public class Service {
@@ -322,7 +326,7 @@ namespace Postler {
             Bus.own_name (BusType.SESSION, "org.elementary.Postler",
                           BusNameOwnerFlags.NONE,
                           bus_aquired, name_aquired, name_lost);
-            new MainLoop ().run ();
+            Gtk.main ();
             done (0);
         }
 



More information about the Xfce4-commits mailing list