Empathy Hard code freeze exception request: Calendar widget should be disabled if no contact selected (#645582)



Hey,

I just fixed this bug polishing a bit the log viewer:
https://bugzilla.gnome.org/show_bug.cgi?id=645582


	G.

-- 
Guillaume Desmottes <gdesmott gnome org>
Jabber <cassidy jabber belnet be>
GPG 1024D/711E31B1 | 1B5A 1BA8 11AA F0F1 2169  E28A AC55 8671 711E 31B1
>From d847c1cb47f6615c84cb0b9d75e0cb51c3dd2966 Mon Sep 17 00:00:00 2001
From: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu, 24 Mar 2011 10:41:14 +0100
Subject: [PATCH] Calendar widget should be disabled if no contact selected (#645582)

---
 libempathy-gtk/empathy-log-window.c  |    9 +++++++++
 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 0f91bf9..fe86cc8 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 1f99cdd..a0cbcdc 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>
-- 
1.7.4.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]