- Removed trailing spaces
- Notify change to visibility
- Added G_PARAM_STATIC_STRINGS to properties
- Broke empathy_chat_set_show_contacts() in two, simplifying call
</long>
</locale>
</schema>
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/empathy/sounds/sounds_contact_logout</key>
<applyto>/apps/empathy/sounds/sounds_contact_logout</applyto>
<schema>
<key>/schemas/apps/empathy/sounds/sounds_contact_logout</key>
<applyto>/apps/empathy/sounds/sounds_contact_logout</applyto>
</long>
</locale>
</schema>
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/empathy/sounds/sounds_service_logout</key>
<applyto>/apps/empathy/sounds/sounds_service_logout</applyto>
<schema>
<key>/schemas/apps/empathy/sounds/sounds_service_logout</key>
<applyto>/apps/empathy/sounds/sounds_service_logout</applyto>
</long>
</locale>
</schema>
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/empathy/conversation/show_contacts_in_rooms</key>
<applyto>/apps/empathy/conversation/show_contacts_in_rooms</applyto>
<schema>
<key>/schemas/apps/empathy/conversation/show_contacts_in_rooms</key>
<applyto>/apps/empathy/conversation/show_contacts_in_rooms</applyto>
Character to add after nickname when using nick completion (tab)
in group chat.
</long>
Character to add after nickname when using nick completion (tab)
in group chat.
</long>
</long>
</locale>
</schema>
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/empathy/autoconnect</key>
<applyto>/apps/empathy/autoconnect</applyto>
<schema>
<key>/schemas/apps/empathy/autoconnect</key>
<applyto>/apps/empathy/autoconnect</applyto>
-void
-empathy_chat_set_show_contacts (EmpathyChat *chat,
- gboolean show)
+static void
+chat_update_contacts_visibility (EmpathyChat *chat)
{
EmpathyChatPriv *priv = GET_PRIV (chat);
{
EmpathyChatPriv *priv = GET_PRIV (chat);
-
- priv->show_contacts = show;
+ gboolean show;
+
+ show = priv->remote_contact == NULL && priv->show_contacts;
if (!priv->scrolled_window_contacts) {
return;
if (!priv->scrolled_window_contacts) {
return;
+ if (show && priv->contact_list_view == NULL) {
EmpathyContactListStore *store;
gint min_width;
EmpathyContactListStore *store;
gint min_width;
gtk_widget_show (priv->contact_list_view);
gtk_widget_show (priv->scrolled_window_contacts);
g_object_unref (store);
gtk_widget_show (priv->contact_list_view);
gtk_widget_show (priv->scrolled_window_contacts);
g_object_unref (store);
priv->contacts_width = gtk_paned_get_position (GTK_PANED (priv->hpaned));
gtk_widget_hide (priv->scrolled_window_contacts);
priv->contacts_width = gtk_paned_get_position (GTK_PANED (priv->hpaned));
gtk_widget_hide (priv->scrolled_window_contacts);
- if (priv->contact_list_view) {
+ if (priv->contact_list_view != NULL) {
gtk_widget_destroy (priv->contact_list_view);
priv->contact_list_view = NULL;
}
}
}
gtk_widget_destroy (priv->contact_list_view);
priv->contact_list_view = NULL;
}
}
}
+void
+empathy_chat_set_show_contacts (EmpathyChat *chat,
+ gboolean show)
+{
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+
+ priv->show_contacts = show;
+
+ chat_update_contacts_visibility (chat);
+
+ g_object_notify (G_OBJECT (chat), "show-contacts");
+}
+
static void
chat_remote_contact_changed_cb (EmpathyChat *chat)
{
EmpathyChatPriv *priv = GET_PRIV (chat);
static void
chat_remote_contact_changed_cb (EmpathyChat *chat)
{
EmpathyChatPriv *priv = GET_PRIV (chat);
if (priv->remote_contact != NULL) {
g_object_unref (priv->remote_contact);
if (priv->remote_contact != NULL) {
g_object_unref (priv->remote_contact);
priv->id = g_strdup (empathy_tp_chat_get_id (priv->tp_chat));
}
priv->id = g_strdup (empathy_tp_chat_get_id (priv->tp_chat));
}
- active = (priv->remote_contact == NULL && priv->show_contacts == TRUE);
- empathy_chat_set_show_contacts (chat, active);
+ chat_update_contacts_visibility (chat);
g_object_notify (G_OBJECT (chat), "remote-contact");
g_object_notify (G_OBJECT (chat), "id");
g_object_notify (G_OBJECT (chat), "remote-contact");
g_object_notify (G_OBJECT (chat), "id");
GList *list = NULL;
gchar *filename;
GtkTextBuffer *buffer;
GList *list = NULL;
gchar *filename;
GtkTextBuffer *buffer;
filename = empathy_file_lookup ("empathy-chat.ui",
"libempathy-gtk");
filename = empathy_file_lookup ("empathy-chat.ui",
"libempathy-gtk");
gtk_widget_show (chat->input_text_view);
/* Create contact list */
gtk_widget_show (chat->input_text_view);
/* Create contact list */
- active = (priv->remote_contact == NULL && priv->show_contacts == TRUE);
- empathy_chat_set_show_contacts (chat, active);
+ chat_update_contacts_visibility (chat);
/* Initialy hide the topic, will be shown if not empty */
gtk_widget_hide (priv->hbox_topic);
/* Initialy hide the topic, will be shown if not empty */
gtk_widget_hide (priv->hbox_topic);
"The tp chat object",
EMPATHY_TYPE_TP_CHAT,
G_PARAM_CONSTRUCT |
"The tp chat object",
EMPATHY_TYPE_TP_CHAT,
G_PARAM_CONSTRUCT |
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ACCOUNT,
g_param_spec_object ("account",
"Account of the chat",
"The account of the chat",
MC_TYPE_ACCOUNT,
g_object_class_install_property (object_class,
PROP_ACCOUNT,
g_param_spec_object ("account",
"Account of the chat",
"The account of the chat",
MC_TYPE_ACCOUNT,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ID,
g_param_spec_string ("id",
"Chat's id",
"The id of the chat",
NULL,
g_object_class_install_property (object_class,
PROP_ID,
g_param_spec_string ("id",
"Chat's id",
"The id of the chat",
NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
"Chat's name",
"The name of the chat",
NULL,
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
"Chat's name",
"The name of the chat",
NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_SUBJECT,
g_param_spec_string ("subject",
"Chat's subject",
"The subject or topic of the chat",
NULL,
g_object_class_install_property (object_class,
PROP_SUBJECT,
g_param_spec_string ("subject",
"Chat's subject",
"The subject or topic of the chat",
NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_REMOTE_CONTACT,
g_param_spec_object ("remote-contact",
"The remote contact",
"The remote contact is any",
EMPATHY_TYPE_CONTACT,
g_object_class_install_property (object_class,
PROP_REMOTE_CONTACT,
g_param_spec_object ("remote-contact",
"The remote contact",
"The remote contact is any",
EMPATHY_TYPE_CONTACT,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_SHOW_CONTACTS,
g_param_spec_boolean ("show-contacts",
"Contacts' visibility",
"The visibility of the contacts' list",
TRUE,
g_object_class_install_property (object_class,
PROP_SHOW_CONTACTS,
g_param_spec_boolean ("show-contacts",
"Contacts' visibility",
"The visibility of the contacts' list",
TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
signals[COMPOSING] =
g_signal_new ("composing",
signals[COMPOSING] =
g_signal_new ("composing",
static void
empathy_chat_init (EmpathyChat *chat)
{
static void
empathy_chat_init (EmpathyChat *chat)
{
EmpathyChatPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chat,
EMPATHY_TYPE_CHAT, EmpathyChatPriv);
EmpathyChatPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chat,
EMPATHY_TYPE_CHAT, EmpathyChatPriv);
empathy_conf_get_bool (empathy_conf_get (),
EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS,
empathy_conf_get_bool (empathy_conf_get (),
EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS,
- empathy_chat_set_show_contacts (chat, active);
-
/* Block events for some time to avoid having "has come online" or
* "joined" messages. */
priv->block_events_timeout_id =
/* Block events for some time to avoid having "has come online" or
* "joined" messages. */
priv->block_events_timeout_id =
active = gtk_toggle_action_get_active (toggle_action);
active = gtk_toggle_action_get_active (toggle_action);
- g_object_set (priv->current_chat,
- "show-contacts", active,
- NULL);
+ empathy_chat_set_show_contacts (priv->current_chat, active);
preferences_hookup_toggle_button (preferences,
EMPATHY_PREFS_CHAT_SHOW_SMILEYS,
preferences->checkbutton_show_smileys);
preferences_hookup_toggle_button (preferences,
EMPATHY_PREFS_CHAT_SHOW_SMILEYS,
preferences->checkbutton_show_smileys);
preferences_hookup_toggle_button (preferences,
EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS,
preferences->checkbutton_show_contacts_in_rooms);
preferences_hookup_toggle_button (preferences,
EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS,
preferences->checkbutton_show_contacts_in_rooms);