empathy_builder_connect (gui, self,
"toolbutton_profile", "clicked", toolbutton_profile_clicked,
"toolbutton_chat", "clicked", toolbutton_chat_clicked,
"toolbutton_call", "clicked", toolbutton_av_clicked,
"toolbutton_video", "clicked", toolbutton_av_clicked,
"imagemenuitem_delete", "activate", log_window_delete_menu_clicked_cb,
NULL);
gtk_container_add (GTK_CONTAINER (self), self->priv->vbox);
g_object_unref (gui);
g_signal_connect_swapped (closeitem, "activate",
G_CALLBACK (gtk_widget_destroy), self);
/* Account chooser for chats */
vbox = gtk_vbox_new (FALSE, 3);
self->priv->account_chooser = empathy_account_chooser_new ();
account_chooser = EMPATHY_ACCOUNT_CHOOSER (self->priv->account_chooser);
empathy_account_chooser_set_has_all_option (account_chooser, TRUE);
empathy_account_chooser_set_filter (account_chooser,
empathy_account_chooser_filter_has_logs, NULL);
empathy_account_chooser_set_all (account_chooser);
gtk_style_context_add_class (gtk_widget_get_style_context (self->priv->account_chooser),
GTK_STYLE_CLASS_RAISED);
g_signal_connect (self->priv->account_chooser, "changed",
G_CALLBACK (log_window_chats_accounts_changed_cb),
self);
label = gtk_label_new (_("Show"));
gtk_box_pack_start (GTK_BOX (vbox),
self->priv->account_chooser,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
label,
FALSE, FALSE, 0);
gtk_widget_show_all (vbox);
gtk_container_add (GTK_CONTAINER (accounts), vbox);
/* Search entry */
vbox = gtk_vbox_new (FALSE, 3);
self->priv->search_entry = gtk_entry_new ();
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry),
GTK_ENTRY_ICON_SECONDARY, "edit-find-symbolic");
gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry),
GTK_ENTRY_ICON_SECONDARY, FALSE);
label = gtk_label_new (_("Search"));
gtk_box_pack_start (GTK_BOX (vbox),
self->priv->search_entry,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
label,
FALSE, FALSE, 0);
gtk_widget_show_all (vbox);
gtk_container_add (GTK_CONTAINER (search), vbox);
g_signal_connect (self->priv->search_entry, "changed",
G_CALLBACK (log_window_search_entry_changed_cb),
self);
g_signal_connect (self->priv->search_entry, "activate",
G_CALLBACK (log_window_search_entry_activate_cb),
self);
g_signal_connect (self->priv->search_entry, "icon-press",
G_CALLBACK (log_window_search_entry_icon_pressed_cb),
self);
/* Contacts */
log_window_events_setup (self);
log_window_who_setup (self);
log_window_what_setup (self);
log_window_when_setup (self);
log_window_create_observer (self);
log_window_who_populate (self);
/* events */
self->priv->webview = webkit_web_view_new ();
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_events),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolledwindow_events),
self->priv->webview);
gtk_widget_show (self->priv->webview);
empathy_webkit_bind_font_setting (WEBKIT_WEB_VIEW (self->priv->webview),
self->priv->gsettings_desktop,
EMPATHY_PREFS_DESKTOP_INTERFACE_FONT_NAME);
filename = empathy_file_lookup ("empathy-log-window.html", "data");
gfile = g_file_new_for_path (filename);
g_free (filename);
webkit_web_view_load_uri (WEBKIT_WEB_VIEW (self->priv->webview),
g_file_get_uri (gfile));
g_object_unref (gfile);