]> git.0d.be Git - empathy.git/commitdiff
Calendar widget should be disabled if no contact selected (#645582)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 24 Mar 2011 09:41:14 +0000 (10:41 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 24 Mar 2011 15:08:00 +0000 (16:08 +0100)
libempathy-gtk/empathy-log-window.c
libempathy-gtk/empathy-log-window.ui

index 0f91bf9f320eb09c353911fdf188c59acbc4bcaf..fe86cc8cc6e15b340aef6f97527c7a0c609db675 100644 (file)
@@ -771,6 +771,12 @@ static void
 log_window_chats_changed_cb (GtkTreeSelection *selection,
                             EmpathyLogWindow  *window)
 {
+       gboolean selected;
+
+       /* The calendar has to be sensitive only if there is something selected */
+       selected = log_window_chats_get_selected (window, NULL, NULL);
+       gtk_widget_set_sensitive (window->calendar_chats, selected);
+
        /* Use last date by default */
        gtk_calendar_clear_marks (GTK_CALENDAR (window->calendar_chats));
 
@@ -952,6 +958,9 @@ log_window_chats_accounts_changed_cb (GtkWidget       *combobox,
        empathy_chat_view_clear (window->chatview_chats);
 
        log_window_chats_populate (window);
+
+       /* No chat is selected as we just changed the account */
+       gtk_widget_set_sensitive (window->calendar_chats, FALSE);
 }
 
 static void
index 1f99cddf0b78b81b697c83e033004066f8f65d8c..a0cbcdcfa0e25fcbbc27e40a4fba3be6d07c9846 100644 (file)
                   <object class="GtkCalendar" id="calendar_chats">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="sensitive">False</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>