[Xfce4-commits] <postler:master> Show label and red background if typing pop3 server
Christian Dywan
noreply at xfce.org
Mon Mar 7 00:26:01 CET 2011
Updating branch refs/heads/master
to 2b05d05b700142d5d7518e04d86a9dc32bad4fcd (commit)
from b829c4979ea0d1a80a5d7fc82cb30a1eda7b848b (commit)
commit 2b05d05b700142d5d7518e04d86a9dc32bad4fcd
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Mar 6 22:25:51 2011 +0100
Show label and red background if typing pop3 server
postler/postler-accountsetup.vala | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/postler/postler-accountsetup.vala b/postler/postler-accountsetup.vala
index 4ad5009..65f92bc 100644
--- a/postler/postler-accountsetup.vala
+++ b/postler/postler-accountsetup.vala
@@ -106,9 +106,27 @@ public class Postler.AccountWidget : Gtk.VBox {
expander.add (advanced_area);
receiver = new Elementary.Entry (_("imap.example.com"));
+ var pop3_label = new Gtk.Label (_("POP3 is not supported."));
+ pop3_label.set_no_show_all (true);
+ receiver.changed.connect ((editable) => {
+ Gtk.Entry entry = editable as Gtk.Entry;
+ Gdk.Color? background = null;
+ Gdk.Color? foreground = null;
+ /* pop3 is not supported */
+ if (entry.text.has_prefix ("pop3.")
+ || entry.text.has_prefix ("pop.")) {
+ Gdk.Color.parse ("#ef7070", out background);
+ Gdk.Color.parse ("#000", out foreground);
+ }
+ Gtk.Widget widget = editable as Gtk.Widget;
+ widget.modify_base (widget.get_state (), background);
+ widget.modify_text (widget.get_state (), foreground);
+ pop3_label.visible = background != null;
+ });
if (info.receive != null)
receiver.set_text (info.receive);
add_label_entry (_("_Receiving Server:"), receiver, true);
+ advanced_area.pack_start (pop3_label, false, false, 4);
username = new Elementary.Entry (_("Username"));
if (info.username != null)
username.set_text (info.username);
More information about the Xfce4-commits
mailing list