Commit ecbc84d9 authored by Mohammed Sadiq's avatar Mohammed Sadiq
Browse files

window: Simplify updating headerbar info button

parent ec4ae8f7
......@@ -564,17 +564,14 @@ on_feedback_triggered (LfbEvent *event,
static void
chatty_conv_switch_conv (ChattyConversation *chatty_conv)
{
ChattyWindow *window;
PurpleConversationType conv_type;
GtkWidget *convs_notebook;
gint page_num;
ChattyWindow *window;
GtkWidget *convs_notebook;
int page_num;
window = chatty_application_get_main_window (CHATTY_APPLICATION_DEFAULT ());
convs_notebook = chatty_window_get_convs_notebook (window);
conv_type = purple_conversation_get_type (chatty_conv->conv);
page_num = gtk_notebook_page_num (GTK_NOTEBOOK(convs_notebook),
chatty_conv->chat_view);
......@@ -584,10 +581,6 @@ chatty_conv_switch_conv (ChattyConversation *chatty_conv)
g_debug ("chatty_conv_switch_conv active_conv: %s page_num %i",
purple_conversation_get_name (chatty_conv->conv), page_num);
if (conv_type == PURPLE_CONV_TYPE_CHAT) {
chatty_window_set_header_chat_info_button_visible (window, TRUE);
}
chatty_chat_view_focus_entry (CHATTY_CHAT_VIEW (chatty_conv->chat_view));
}
......
......@@ -327,6 +327,8 @@ window_notebook_after_switch_cb (GtkNotebook *notebook,
purple_conversation_get_name (conv));
chatty_chat_set_unread_count (chat, 0);
gtk_widget_set_visible (self->header_chat_info_button,
!chatty_chat_is_im (chat));
}
......@@ -406,8 +408,6 @@ chatty_window_open_item (ChattyWindow *self,
buddy = (PurpleBuddy*)node;
account = purple_buddy_get_account (buddy);
chatty_window_set_header_chat_info_button_visible (self, FALSE);
if (chatty_blist_protocol_is_sms (account)) {
ChattyEds *chatty_eds;
ChattyContact *contact;
......@@ -1240,15 +1240,6 @@ chatty_window_set_uri (ChattyWindow *self,
g_free (who);
}
void
chatty_window_set_header_chat_info_button_visible (ChattyWindow *self,
gboolean visible)
{
gtk_widget_set_visible (self->header_chat_info_button, visible);
}
GtkWidget *
chatty_window_get_convs_notebook (ChattyWindow *self)
{
......
......@@ -48,7 +48,6 @@ void chatty_window_change_view (ChattyWindow *self, guint state);
GtkWidget *chatty_window_get_convs_notebook (ChattyWindow *self);
void chatty_window_chat_list_select_first (ChattyWindow *self);
void chatty_window_set_header_chat_info_button_visible (ChattyWindow *self, gboolean visible);
G_END_DECLS
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment