]> git.0d.be Git - empathy.git/commitdiff
presence-chooser: make the entry not editable when we are offline
authorJonny Lamb <jonnylamb@gnome.org>
Fri, 16 Oct 2009 12:00:05 +0000 (13:00 +0100)
committerJonny Lamb <jonnylamb@gnome.org>
Fri, 16 Oct 2009 12:21:39 +0000 (13:21 +0100)
The idea behind this is that you can't set a custom status when you
are offline. It just doesn't make sense.

Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
libempathy-gtk/empathy-presence-chooser.c

index cca7a21ef814ec48e587f30288e6d7442fada23f..fa8864984c3a44d54b35963db953859c4d380127 100644 (file)
@@ -908,6 +908,7 @@ presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser)
        GtkTreeModel               *model;
        GtkTreeIter                 iter;
        gboolean valid, match_state = FALSE, match = FALSE;
+       GtkWidget                  *entry;
 
        priv = GET_PRIV (chooser);
 
@@ -977,6 +978,10 @@ presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser)
        else {
                presence_chooser_flash_stop (chooser, state);
        }
+
+       entry = gtk_bin_get_child (GTK_BIN (chooser));
+       gtk_editable_set_editable (GTK_EDITABLE (entry),
+           state != TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
 }
 
 static gboolean