[Xfce4-commits] <postler:master> Edit header and keywords in search properties

Christian Dywan noreply at xfce.org
Fri Jan 14 17:12:01 CET 2011


Updating branch refs/heads/master
         to 89b6f8c728e3e0b7ba5d7d5c28dd39f31fa26a06 (commit)
       from 777aa36ca6b44b2e5530f94684c89f14e3f0a0f4 (commit)

commit 89b6f8c728e3e0b7ba5d7d5c28dd39f31fa26a06
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jan 12 00:40:33 2011 +0100

    Edit header and keywords in search properties

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

diff --git a/postler/postler-accountsetup.vala b/postler/postler-accountsetup.vala
index 50025ae..3e4075a 100644
--- a/postler/postler-accountsetup.vala
+++ b/postler/postler-accountsetup.vala
@@ -14,6 +14,9 @@ public class Postler.AccountWidget : Gtk.VBox {
     Gtk.Box content_area;
     Gtk.Box advanced_area;
 
+    Gtk.Entry header;
+    Gtk.Entry filter;
+
     Gtk.Entry realname;
     public Gtk.Entry address;
     Gtk.Entry password;
@@ -47,6 +50,26 @@ public class Postler.AccountWidget : Gtk.VBox {
         sizegroup = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);
         content_area = new Gtk.VBox (false, 0);
 
+        if (info.type == AccountType.SEARCH) {
+            string? query = info.path.substring (7);
+            return_if_fail (query != null);
+            string[] parts = query.split ("/", 2);
+            return_if_fail (parts[0] != null && parts[1] != null);
+
+            header = new Gtk.Entry ();
+            header.text = parts[0];
+            add_label_entry (_("_Header"), header);
+            filter = new Gtk.Entry ();
+            filter.text = parts[1];
+            add_label_entry (_("_Keywords"), filter);
+
+            content_area.show_all ();
+            pack_end (content_area, true, true, 0);
+
+            address = new Gtk.Entry ();
+            return;
+        }
+
         realname = new Gtk.Entry ();
         realname.text = info.realname ?? "";
         add_label_entry (_("_Full Name:"), realname);
@@ -112,6 +135,12 @@ public class Postler.AccountWidget : Gtk.VBox {
     }
 
     public void apply () {
+        if (info.type == AccountType.SEARCH) {
+            info.path = "search:" + header.text + "/" + filter.text;
+            done (info);
+            return;
+        }
+
         if (info.name == null)
             info.name = address.text;
 



More information about the Xfce4-commits mailing list