[Xfce4-commits] <postler:master> Implement account editing of account properties

Christian Dywan noreply at xfce.org
Sun Jul 18 15:40:18 CEST 2010


Updating branch refs/heads/master
         to 83ce45266315d2eb0223d576799ce7fc3eb2a309 (commit)
       from 05a94279f92794b2ee843f31ef77ac5121e9e437 (commit)

commit 83ce45266315d2eb0223d576799ce7fc3eb2a309
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Jul 17 16:59:21 2010 +0200

    Implement account editing of account properties

 postler/postler-accountsetup.vala |   18 ++++++++++++++----
 postler/postler-folders.vala      |   15 +++++++++++++++
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/postler/postler-accountsetup.vala b/postler/postler-accountsetup.vala
index 9f00e76..ba213b2 100644
--- a/postler/postler-accountsetup.vala
+++ b/postler/postler-accountsetup.vala
@@ -28,18 +28,18 @@ public class Postler.AccountSetup : Gtk.Dialog {
         content_area = get_content_area () as Gtk.Box;
 
         realname = new Gtk.Entry ();
+        realname.text = info.realname ?? "";
         add_label_entry (_("Full Name"), realname);
         address = new Gtk.Entry ();
+        address.text = info.address ?? "";
         add_label_entry (_("Electronic Mail Address"), address);
         password = new Gtk.Entry ();
         password.visibility = false;
+        password.text = info.password ?? "";
         add_label_entry (_("Password"), password);
         content_area.show_all ();
 
-        add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
-                     _("_Create Account"), Gtk.ResponseType.APPLY);
-        set_default_response (Gtk.ResponseType.APPLY);
-
+        add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL);
         response.connect (responded);
     }
 
@@ -71,6 +71,16 @@ public class Postler.AccountSetup : Gtk.Dialog {
         info.type = AccountType.IMAP;
 
         var setup = new AccountSetup (info);
+        setup.add_button (_("_Create Account"), Gtk.ResponseType.APPLY);
+        setup.set_default_response (Gtk.ResponseType.APPLY);
+        setup.show ();
+        return setup;
+    }
+
+    public static AccountSetup edit_account (AccountInfo info) {
+        var setup = new AccountSetup (info);
+        setup.add_button (_("_Save Account"), Gtk.ResponseType.APPLY);
+        setup.set_default_response (Gtk.ResponseType.APPLY);
         setup.show ();
         return setup;
     }
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index b4e5134..ebd8494 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -369,6 +369,21 @@ public class Postler.Folders : Gtk.TreeView {
                  }
             });
             menu.append (menuitem);
+            menuitem = new Gtk.MenuItem.with_mnemonic (_("Account _Properties"));
+            menuitem.activate.connect ((menuitem) => {
+                Gtk.TreeIter iter;
+                 if (get_selection ().get_selected (null, out iter)) {
+                     AccountInfo? account_info;
+                     store.get (iter, Columns.INFO, out account_info);
+                     AccountSetup.edit_account (account_info).done.connect (
+                         (setup, info) => {
+                         accounts.remove_info (info);
+                         accounts.add_info (info);
+                         populate ();
+                     } );
+                 }
+            });
+            menu.append (menuitem);
         }
 
         menu.show_all ();



More information about the Xfce4-commits mailing list