[Xfce4-commits] <postler:master> Implement Inbox actions, with hotkeys Alt+n

Christian Dywan noreply at xfce.org
Thu Jun 3 03:24:03 CEST 2010


Updating branch refs/heads/master
         to 0b0a8b714d367a837b85de1fe5a196cc38f3e1e7 (commit)
       from 904c55789889341f69f557f0373c605fbe768815 (commit)

commit 0b0a8b714d367a837b85de1fe5a196cc38f3e1e7
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jun 2 21:35:22 2010 +0200

    Implement Inbox actions, with hotkeys Alt+n

 postler/postler-bureau.vala |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 219b62f..ffcea92 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -194,6 +194,25 @@ public class Postler.Bureau : Gtk.Window {
             GLib.error (_("Failed to create window: %s"), error.message);
         }
 
+        var folder_actions = new Gtk.ActionGroup ("Bureau/Folders");
+        for (int i = 1; i < 9; i++) {
+            string name = "Inbox%d".printf (i);
+            var action = new Gtk.Action (name, name, null, null);
+            action.activate.connect ((action) => {
+                int index = (int)action.name[5].digit_value ();
+                Gtk.TreeModel model = folders.get_model ();
+                Gtk.TreeIter iter;
+                if (model.iter_nth_child (out iter, null, index - 1)) {
+                    folders.set_cursor (model.get_path (iter), null, false);
+                    folders.grab_focus ();
+                }
+            });
+            folder_actions.add_action_with_accel (action, "<Alt>%d".printf (i));
+            action.set_accel_group (ui.get_accel_group ());
+            action.connect_accelerator ();
+        }
+        ui.insert_action_group (folder_actions, 0);
+
         shelf = new Gtk.VBox (false, 0);
         add (shelf);
         var menubar = ui.get_widget ("/menubar");



More information about the Xfce4-commits mailing list