diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-03-24 17:41:14 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-03-24 23:08:00 +0800 |
commit | 2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6 (patch) | |
tree | 182cfc0fffe9a11aa61a3dce15dde87e377fe40f | |
parent | 17df132d41f12c7003dbeda74a7de2cb598b64f9 (diff) | |
download | gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.tar gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.tar.gz gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.tar.bz2 gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.tar.lz gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.tar.xz gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.tar.zst gsoc2013-empathy-2ba5f4fdf1d4ab286da84d9f442eb714be1dafd6.zip |
Calendar widget should be disabled if no contact selected (#645582)
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 9 | ||||
-rw-r--r-- | libempathy-gtk/empathy-log-window.ui | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 0f91bf9f3..fe86cc8cc 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -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 diff --git a/libempathy-gtk/empathy-log-window.ui b/libempathy-gtk/empathy-log-window.ui index 1f99cddf0..a0cbcdcfa 100644 --- a/libempathy-gtk/empathy-log-window.ui +++ b/libempathy-gtk/empathy-log-window.ui @@ -272,6 +272,7 @@ <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> |