[Xfce4-commits] <postler:master> Welcome the new user with an embedded account form
Christian Dywan
noreply at xfce.org
Wed Dec 15 11:22:03 CET 2010
Updating branch refs/heads/master
to afb8640f61ac77fe6157b5024f92320a3cd4195a (commit)
from d27d2e3a1c59931db1d033ce72501b935a3855fa (commit)
commit afb8640f61ac77fe6157b5024f92320a3cd4195a
Author: Christian Dywan <christian at twotoasts.de>
Date: Wed Dec 15 01:52:14 2010 +0100
Welcome the new user with an embedded account form
Fixes: https://bugs.launchpad.net/postler/+bug/671994
postler/postler-bureau.vala | 44 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 8fa3b66..93b8494 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -606,6 +606,50 @@ public class Postler.Bureau : Gtk.Window {
});
scrolled = new Postler.ScrolledWindow (messages);
messages_box.pack_start (scrolled, true, true, 0);
+
+ /* Welcome the new user with an account form embedded in the window */
+ if (accounts.get_infos ().length () == 0) {
+ var welcome = new AccountWidget ();
+ var label = new Gtk.Label (null);
+ label.set_markup ("<span size=\"x-large\" weight=\"bold\">%s</span>"
+ .printf (_("Set up your account.")));
+ welcome.pack_start (label, true, false, 4);
+ label = new Gtk.Label (
+ _("Postler needs some basic information to get your mail."));
+ label.sensitive = false;
+ welcome.pack_start (label, true, false, 4);
+ var welcome_box = new Gtk.HBox (false, 0);
+ welcome_box.pack_start (welcome, true, false, 0);
+ welcome_box.show_all ();
+ messages_box.pack_start (welcome_box, true, false, 0);
+ messages_box.show ();
+ welcome.address.grab_focus ();
+ messages.parent.set_no_show_all (true);
+ var continue_box = new Gtk.HButtonBox ();
+ continue_box.set_border_width (16);
+ continue_box.layout_style = Gtk.ButtonBoxStyle.END;
+ var continue_button = new Gtk.Button.with_mnemonic (_("_Continue"));
+ continue_button.sensitive = false;
+ welcome.address.changed.connect (() => {
+ continue_button.sensitive = welcome.address.text.chr (-1, '@') != null;
+ });
+ continue_button.clicked.connect (() => {
+ welcome.apply ();
+ });
+ continue_box.pack_end (continue_button, false, false, 0);
+ messages_box.pack_end (continue_box, false, false, 0);
+ welcome.done.connect ((info) => {
+ if (welcome.address.text.chr (-1, '@') == null)
+ return;
+ welcome_box.hide ();
+ continue_box.hide ();
+ messages.parent.set_no_show_all (false);
+ messages.parent.show_all ();
+ accounts.add_info (info);
+ folders.populate ();
+ });
+ }
+
content = new Postler.Content ();
actions.get_action ("MessageReply").sensitive = false;
actions.get_action ("MessageReplyAll").sensitive = false;
More information about the Xfce4-commits
mailing list