#include <sys/stat.h>
#include <glib/gi18n.h>
+#include <tp-account-widgets/tpaw-builder.h>
#include "empathy-about-dialog.h"
#include "empathy-accounts-dialog.h"
return FALSE;
}
+static void
+hide_search_bar (EmpathyRosterWindow *roster_window)
+{
+ if (TPAW_IS_LIVE_SEARCH (roster_window->priv->search_bar) &&
+ gtk_widget_is_visible (roster_window->priv->search_bar))
+ gtk_widget_hide (roster_window->priv->search_bar);
+}
+
static void
individual_activated_cb (EmpathyRosterView *self,
FolksIndividual *individual,
empathy_chat_with_contact (contact, gtk_get_current_event_time ());
g_object_unref (contact);
+
+ /* Hide the search-bar upon hitting "Enter" on an individual */
+ hide_search_bar (EMPATHY_ROSTER_WINDOW (user_data));
}
static void
gpointer user_data)
{
empathy_event_activate (event);
+
+ /* Hide the search-bar upon an event activation */
+ hide_search_bar (EMPATHY_ROSTER_WINDOW (user_data));
}
static void
tp_account_get_detailed_error (account, NULL)))
{
roster_window_error_add_stock_button (GTK_INFO_BAR (info_bar),
- GTK_STOCK_REFRESH, _("Update software..."),
+ GTK_STOCK_REFRESH, _("Update software…"),
ERROR_RESPONSE_RETRY);
}
else
set_notebook_page (self);
}
+static void
+account_removed_cb (TpAccountManager *manager,
+ TpAccount *account,
+ EmpathyRosterWindow *self)
+{
+ set_notebook_page (self);
+}
+
static void
account_manager_prepared_cb (GObject *source_object,
GAsyncResult *result,
g_signal_connect (manager, "account-validity-changed",
G_CALLBACK (roster_window_account_validity_changed_cb), self);
+ tp_g_signal_connect_object (manager, "account-removed",
+ G_CALLBACK (account_removed_cb), self, 0);
tp_g_signal_connect_object (manager, "account-disabled",
G_CALLBACK (account_disabled_cb), self, 0);
tp_g_signal_connect_object (manager, "account-enabled",
gtk_menu_detach (GTK_MENU (menushell));
}
+static void
+menu_item_activated_cb (GtkMenuShell *menushell,
+ gpointer user_data)
+{
+ EmpathyRosterWindow *roster_window = EMPATHY_ROSTER_WINDOW (user_data);
+
+ hide_search_bar (roster_window);
+}
+
static void
popup_individual_menu_cb (EmpathyRosterView *view,
+ const gchar *active_group,
FolksIndividual *individual,
guint button,
guint time,
EMPATHY_INDIVIDUAL_FEATURE_REMOVE |
EMPATHY_INDIVIDUAL_FEATURE_FILE_TRANSFER;
- menu = empathy_individual_menu_new (individual, features, NULL);
+ menu = empathy_individual_menu_new (individual, active_group,
+ features, NULL);
/* menu is initially unowned but gtk_menu_attach_to_widget() takes its
* floating ref. We can either wait for the view to release its ref
* during the whole lifetime of Empathy. */
g_signal_connect (menu, "deactivate", G_CALLBACK (menu_deactivate_cb),
NULL);
+ g_signal_connect (menu, "menu-item-activated",
+ G_CALLBACK (menu_item_activated_cb), user_data);
gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (view), NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, time);
{
/* Check if contact supports FT */
FolksIndividual *individual;
- GtkWidget *child;
+ GtkListBoxRow *row;
individual = empathy_roster_view_get_individual_at_y (self->priv->view,
- y, &child);
+ y, &row);
if (individual == NULL)
goto no_hl;
if (!individual_supports_ft (individual))
goto no_hl;
- egg_list_box_drag_highlight_widget (EGG_LIST_BOX (widget), child);
+ gtk_list_box_drag_highlight_row (GTK_LIST_BOX (widget), row);
return FALSE;
}
no_hl:
- egg_list_box_drag_unhighlight_widget (EGG_LIST_BOX (widget));
+ gtk_list_box_drag_unhighlight_row (GTK_LIST_BOX (widget));
return FALSE;
}
/* Set up interface */
filename = empathy_file_lookup ("empathy-roster-window.ui", "src");
- gui = empathy_builder_get_file (filename,
+ gui = tpaw_builder_get_file (filename,
"main_vbox", &self->priv->main_vbox,
"balance_vbox", &self->priv->balance_vbox,
"errors_vbox", &self->priv->errors_vbox,
roster_window_setup_actions (self);
filename = empathy_file_lookup ("empathy-roster-window-menubar.ui", "src");
- gui = empathy_builder_get_file (filename,
+ gui = tpaw_builder_get_file (filename,
"appmenu", &self->priv->menumodel,
"rooms", &self->priv->rooms_section,
NULL);
gtk_widget_show (GTK_WIDGET (self->priv->view));
- egg_list_box_add_to_scrolled (EGG_LIST_BOX (self->priv->view),
- GTK_SCROLLED_WINDOW (sw));
+ gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (self->priv->view));
g_signal_connect (self->priv->view, "individual-activated",
G_CALLBACK (individual_activated_cb), self);
gtk_widget_set_has_tooltip (GTK_WIDGET (self->priv->view), TRUE);
/* Set up search bar */
- self->priv->search_bar = empathy_live_search_new (
+ self->priv->search_bar = tpaw_live_search_new (
GTK_WIDGET (self->priv->view));
empathy_roster_view_set_live_search (self->priv->view,
- EMPATHY_LIVE_SEARCH (self->priv->search_bar));
+ TPAW_LIVE_SEARCH (self->priv->search_bar));
gtk_box_pack_start (GTK_BOX (search_vbox), self->priv->search_bar,
FALSE, TRUE, 0);