[Xfce4-commits] <postler:master> Disable From combo button for only one account
Christian Dywan
noreply at xfce.org
Wed Dec 1 03:24:02 CET 2010
Updating branch refs/heads/master
to 17e864403a38e95a998d75008e356bfa50af156f (commit)
from ff9502d79b6be724f9d74ee0384825f283ed5de9 (commit)
commit 17e864403a38e95a998d75008e356bfa50af156f
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Nov 30 23:19:44 2010 +0100
Disable From combo button for only one account
postler/postler-composer.vala | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index b91f7cc..695bb56 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -398,19 +398,15 @@ public class Postler.Composer : Gtk.Window {
actions.get_action ("MessageSend").sensitive = state;
});
- unowned GLib.List<AccountInfo> infos = accounts.get_infos ();
- /* foreach (unowned AccountInfo account_info in infos) { */
- for (unowned GLib.List<AccountInfo> info_iter = infos;
- info_iter != null; info_iter = info_iter.next) {
- AccountInfo account_info = info_iter.data;
-
+ foreach (var account_info in accounts.get_infos ()) {
if (account_info.address != null) {
string[] addresses = account_info.address.split (",");
if (addresses[0] != null) {
foreach (string address in addresses) {
- if (account_info.realname != null)
+ unowned string realname = account_info.realname;
+ if (realname != null && realname != "")
combo_from.append_text ("%s <%s>".printf (
- account_info.realname, address));
+ realname, address));
else
combo_from.append_text (address);
}
@@ -419,8 +415,14 @@ public class Postler.Composer : Gtk.Window {
combo_from.append_text (account_info.address);
}
}
+
combo_from.set_active (0);
- combo_from.grab_focus ();
+ if (combo_from.model.iter_n_children (null) > 1)
+ combo_from.grab_focus ();
+ else {
+ combo_from.button_sensitivity = Gtk.SensitivityType.OFF;
+ entry_to.grab_focus ();
+ }
content.editable = true;
var settings = content.settings;
More information about the Xfce4-commits
mailing list