aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-04 17:59:35 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-04 17:59:35 +0800
commit761c4da4a72672f5aa6a3e21dea88ec8fb03733b (patch)
tree6a57d4ea35b661ea85ae9427c8b09a6970cb6655
parent39a95ab4ddfea6bd10a7c326168ed04b1084555a (diff)
parentc33fdeaba0949ce84d3b3fabc56007d3ab9de7e9 (diff)
downloadgsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.tar
gsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.tar.gz
gsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.tar.bz2
gsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.tar.lz
gsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.tar.xz
gsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.tar.zst
gsoc2013-empathy-761c4da4a72672f5aa6a3e21dea88ec8fb03733b.zip
Merge branch 'empathy-skype' into debian
-rw-r--r--data/Empathy.Call.client10
-rw-r--r--libempathy-gtk/empathy-account-chooser.c24
-rw-r--r--libempathy-gtk/empathy-account-chooser.h1
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c18
-rw-r--r--libempathy-gtk/empathy-individual-store.c7
-rw-r--r--libempathy-gtk/empathy-individual-view.c37
-rw-r--r--libempathy-gtk/empathy-log-window.c86
-rw-r--r--libempathy-gtk/empathy-log-window.ui56
-rw-r--r--libempathy-gtk/empathy-persona-view.c28
-rw-r--r--src/empathy-call-window.c38
-rw-r--r--src/empathy-chat-window.c3
-rw-r--r--src/empathy-main-window.c60
-rw-r--r--src/empathy-main-window.ui2
-rw-r--r--src/empathy-status-icon.c3
14 files changed, 272 insertions, 101 deletions
diff --git a/data/Empathy.Call.client b/data/Empathy.Call.client
index edcec3fbd..259025d86 100644
--- a/data/Empathy.Call.client
+++ b/data/Empathy.Call.client
@@ -8,14 +8,14 @@ org.freedesktop.Telepathy.Channel.TargetHandleType u=1
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 1]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call.DRAFT
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
-org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialAudio b=true
+org.freedesktop.Telepathy.Channel.Type.Call.DRAFT.InitialAudio b=true
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 2]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call.DRAFT
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
-org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialVideo b=true
+org.freedesktop.Telepathy.Channel.Type.Call.DRAFT.InitialVideo b=true
[org.freedesktop.Telepathy.Client.Handler.Capabilities]
-org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp=true
-org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p=true
-org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264=true
+org.freedesktop.Telepathy.Channel.Type.Call.DRAFT/ice-udp=true
+org.freedesktop.Telepathy.Channel.Type.Call.DRAFT/gtalk-p2p=true
+org.freedesktop.Telepathy.Channel.Type.Call.DRAFT/video/h264=true
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c
index afb9841e1..b6c4d51a1 100644
--- a/libempathy-gtk/empathy-account-chooser.c
+++ b/libempathy-gtk/empathy-account-chooser.c
@@ -416,6 +416,30 @@ empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
return data.set;
}
+void
+empathy_account_chooser_set_all (EmpathyAccountChooser *chooser)
+{
+ EmpathyAccountChooserPriv *priv;
+ GtkComboBox *combobox;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ g_return_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser));
+
+ priv = GET_PRIV (chooser);
+
+ g_return_if_fail (priv->has_all_option);
+
+ combobox = GTK_COMBO_BOX (chooser);
+ model = gtk_combo_box_get_model (combobox);
+
+ if (gtk_tree_model_get_iter_first (model, &iter)) {
+ /* 'All accounts' is the first row */
+ gtk_combo_box_set_active_iter (combobox, &iter);
+ priv->account_manually_set = TRUE;
+ }
+}
+
/**
* empathy_account_chooser_get_has_all_option:
* @chooser: an #EmpathyAccountChooser
diff --git a/libempathy-gtk/empathy-account-chooser.h b/libempathy-gtk/empathy-account-chooser.h
index c9e69b4f6..f3658ad7d 100644
--- a/libempathy-gtk/empathy-account-chooser.h
+++ b/libempathy-gtk/empathy-account-chooser.h
@@ -81,6 +81,7 @@ TpAccount * empathy_account_chooser_get_account (EmpathyAccountChooser
TpConnection * empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser);
gboolean empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
TpAccount *account);
+void empathy_account_chooser_set_all (EmpathyAccountChooser *chooser);
TpAccountManager * empathy_account_chooser_get_account_manager (EmpathyAccountChooser *self);
gboolean empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser);
void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser,
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 79eb5a316..bda1ed8d5 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -112,9 +112,6 @@ static const GtkTargetEntry drag_types_source[] = {
{ "text/contact-id", 0, DND_DRAG_TYPE_CONTACT_ID },
};
-static GdkAtom drag_atoms_dest[G_N_ELEMENTS (drag_types_dest)];
-static GdkAtom drag_atoms_source[G_N_ELEMENTS (drag_types_source)];
-
enum {
DRAG_CONTACT_RECEIVED,
LAST_SIGNAL
@@ -763,7 +760,8 @@ contact_list_view_drag_data_get (GtkWidget *widget,
str = g_strconcat (account_id, ":", contact_id, NULL);
if (info == DND_DRAG_TYPE_CONTACT_ID) {
- gtk_selection_data_set (selection, drag_atoms_source[info], 8,
+ gtk_selection_data_set (selection,
+ gdk_atom_intern ("text/contact-id", FALSE), 8,
(guchar *) str, strlen (str) + 1);
}
@@ -1497,7 +1495,6 @@ contact_list_view_constructed (GObject *object)
EmpathyContactListViewPriv *priv = GET_PRIV (view);
GtkCellRenderer *cell;
GtkTreeViewColumn *col;
- guint i;
priv->filter = GTK_TREE_MODEL_FILTER (gtk_tree_model_filter_new (
GTK_TREE_MODEL (priv->store), NULL));
@@ -1629,17 +1626,6 @@ contact_list_view_constructed (GObject *object)
/* Actually add the column now we have added all cell renderers */
gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
-
- /* Drag & Drop. */
- for (i = 0; i < G_N_ELEMENTS (drag_types_dest); ++i) {
- drag_atoms_dest[i] = gdk_atom_intern (drag_types_dest[i].target,
- FALSE);
- }
-
- for (i = 0; i < G_N_ELEMENTS (drag_types_source); ++i) {
- drag_atoms_source[i] = gdk_atom_intern (drag_types_source[i].target,
- FALSE);
- }
}
static void
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 242bad2be..1b4b4fd8a 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -1902,7 +1902,7 @@ individual_store_get_individual_status_icon_with_icon_name (
FolksIndividual *individual,
const gchar *status_icon_name)
{
- GdkPixbuf *pixbuf_status = NULL;
+ GdkPixbuf *pixbuf_status;
EmpathyIndividualStorePriv *priv;
const gchar *protocol_name = NULL;
gchar *icon_name = NULL;
@@ -1934,13 +1934,18 @@ individual_store_get_individual_status_icon_with_icon_name (
{
icon_name = g_strdup_printf ("%s", status_icon_name);
}
+
+ pixbuf_status = g_hash_table_lookup (priv->status_icons, icon_name);
+
if (pixbuf_status == NULL)
{
pixbuf_status =
empathy_pixbuf_contact_status_icon_with_icon_name (contact,
status_icon_name, show_protocols_here);
+
if (pixbuf_status != NULL)
{
+ /* pass the reference to the hash table */
g_hash_table_insert (priv->status_icons,
g_strdup (icon_name), pixbuf_status);
}
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 12486195c..1e0602353 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -110,13 +110,14 @@ enum
/* TODO: re-add DRAG_TYPE_CONTACT_ID, for the case that we're dragging around
* specific EmpathyContacts (between/in/out of Individuals) */
-enum DndDragType
+typedef enum
{
- DND_DRAG_TYPE_INDIVIDUAL_ID,
+ DND_DRAG_TYPE_UNKNOWN = -1,
+ DND_DRAG_TYPE_INDIVIDUAL_ID = 0,
DND_DRAG_TYPE_PERSONA_ID,
DND_DRAG_TYPE_URI_LIST,
DND_DRAG_TYPE_STRING,
-};
+} DndDragType;
#define DRAG_TYPE(T,I) \
{ (gchar *) T, 0, I }
@@ -137,7 +138,6 @@ static const GtkTargetEntry drag_types_source[] = {
#undef DRAG_TYPE
static GdkAtom drag_atoms_dest[G_N_ELEMENTS (drag_types_dest)];
-static GdkAtom drag_atoms_source[G_N_ELEMENTS (drag_types_source)];
enum
{
@@ -565,6 +565,8 @@ individual_view_drag_motion (GtkWidget *widget,
gboolean is_different = FALSE;
gboolean cleanup = TRUE;
gboolean retval = TRUE;
+ guint i;
+ DndDragType drag_type = DND_DRAG_TYPE_UNKNOWN;
priv = GET_PRIV (EMPATHY_INDIVIDUAL_VIEW (widget));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
@@ -595,8 +597,18 @@ individual_view_drag_motion (GtkWidget *widget,
target = gtk_drag_dest_find_target (widget, context, NULL);
gtk_tree_model_get_iter (model, &iter, path);
- if (target == drag_atoms_dest[DND_DRAG_TYPE_URI_LIST] ||
- target == drag_atoms_dest[DND_DRAG_TYPE_STRING])
+ /* Determine the DndDragType of the data */
+ for (i = 0; i < G_N_ELEMENTS (drag_atoms_dest); i++)
+ {
+ if (target == drag_atoms_dest[i])
+ {
+ drag_type = drag_types_dest[i].info;
+ break;
+ }
+ }
+
+ if (drag_type == DND_DRAG_TYPE_URI_LIST ||
+ drag_type == DND_DRAG_TYPE_STRING)
{
/* This is a file drag, and it can only be dropped on contacts,
* not groups.
@@ -641,10 +653,10 @@ individual_view_drag_motion (GtkWidget *widget,
if (individual != NULL)
g_object_unref (individual);
}
- else if ((target == drag_atoms_dest[DND_DRAG_TYPE_INDIVIDUAL_ID] &&
+ else if ((drag_type == DND_DRAG_TYPE_INDIVIDUAL_ID &&
(priv->view_features & EMPATHY_INDIVIDUAL_VIEW_FEATURE_GROUPS_CHANGE ||
priv->drag_row == NULL)) ||
- (target == drag_atoms_dest[DND_DRAG_TYPE_PERSONA_ID] &&
+ (drag_type == DND_DRAG_TYPE_PERSONA_ID &&
priv->view_features & EMPATHY_INDIVIDUAL_VIEW_FEATURE_PERSONA_DROP))
{
/* If target != GDK_NONE, then we have a contact (individual or persona)
@@ -789,7 +801,8 @@ individual_view_drag_data_get (GtkWidget *widget,
if (info == DND_DRAG_TYPE_INDIVIDUAL_ID)
{
- gtk_selection_data_set (selection, drag_atoms_source[info], 8,
+ gtk_selection_data_set (selection,
+ gdk_atom_intern ("text/individual-id", FALSE), 8,
(guchar *) individual_id, strlen (individual_id) + 1);
}
@@ -1856,12 +1869,6 @@ individual_view_constructed (GObject *object)
{
drag_atoms_dest[i] = gdk_atom_intern (drag_types_dest[i].target, FALSE);
}
-
- for (i = 0; i < G_N_ELEMENTS (drag_types_source); ++i)
- {
- drag_atoms_source[i] = gdk_atom_intern (drag_types_source[i].target,
- FALSE);
- }
}
static void
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index d3aa07027..e1c9856cb 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -68,6 +68,9 @@ typedef struct
GtkWidget *search_entry;
+ GtkWidget *notebook;
+ GtkWidget *spinner;
+
GtkWidget *treeview_who;
GtkWidget *treeview_what;
GtkWidget *treeview_when;
@@ -128,6 +131,13 @@ empathy_account_chooser_filter_has_logs (TpAccount *account,
enum
{
+ PAGE_EVENTS,
+ PAGE_SPINNER,
+ PAGE_EMPTY
+};
+
+enum
+{
COL_TYPE_ANY,
COL_TYPE_SEPARATOR,
COL_TYPE_NORMAL
@@ -454,6 +464,8 @@ empathy_log_window_show (TpAccount *account,
"treeview_what", &window->treeview_what,
"treeview_when", &window->treeview_when,
"treeview_events", &window->treeview_events,
+ "notebook", &window->notebook,
+ "spinner", &window->spinner,
NULL);
g_free (filename);
@@ -482,6 +494,7 @@ empathy_log_window_show (TpAccount *account,
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);
g_signal_connect (window->account_chooser, "changed",
G_CALLBACK (log_window_chats_accounts_changed_cb),
@@ -825,7 +838,7 @@ log_window_append_call (TplEvent *event,
TplCallEvent *call = TPL_CALL_EVENT (event);
GtkTreeStore *store = log_window->store_events;
GtkTreeIter iter, child;
- gchar *pretty_date, *body, *duration, *finished;
+ gchar *pretty_date, *duration, *finished;
GDateTime *started_date, *finished_date;
GTimeSpan span;
@@ -848,6 +861,8 @@ log_window_append_call (TplEvent *event,
if (tpl_call_event_get_end_reason (call) != TPL_CALL_END_REASON_NO_ANSWER)
{
+ gchar *body;
+
span = tpl_call_event_get_duration (TPL_CALL_EVENT (event));
if (span < 60)
duration = g_strdup_printf (_("%" G_GINT64_FORMAT " seconds"), span);
@@ -873,9 +888,10 @@ log_window_append_call (TplEvent *event,
COL_EVENTS_TARGET, event_get_target (event),
COL_EVENTS_EVENT, event,
-1);
+
+ g_free (body);
}
- g_free (body);
g_free (pretty_date);
g_date_time_unref (started_date);
}
@@ -1285,7 +1301,8 @@ populate_dates_from_search_hits (GList *accounts,
COL_WHEN_TEXT, _("Anytime"),
-1);
- gtk_tree_selection_select_iter (selection, &iter);
+ if (gtk_tree_model_iter_nth_child (model, &iter, NULL, 2))
+ gtk_tree_selection_select_iter (selection, &iter);
}
}
@@ -2281,17 +2298,60 @@ log_window_what_setup (EmpathyLogWindow *window)
}
static void
+start_spinner (void)
+{
+ gtk_spinner_start (GTK_SPINNER (log_window->spinner));
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (log_window->notebook),
+ PAGE_EMPTY);
+}
+
+static gboolean
+show_spinner (gpointer data)
+{
+ gboolean active;
+
+ if (log_window == NULL)
+ return FALSE;
+
+ g_object_get (log_window->spinner, "active", &active, NULL);
+
+ if (active)
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (log_window->notebook),
+ PAGE_SPINNER);
+
+ return FALSE;
+}
+
+static void
+show_events (TplActionChain *chain,
+ gpointer user_data)
+{
+ gtk_spinner_stop (GTK_SPINNER (log_window->spinner));
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (log_window->notebook),
+ PAGE_EVENTS);
+
+ _tpl_action_chain_continue (chain);
+}
+
+static void
log_window_got_messages_for_date_cb (GObject *manager,
GAsyncResult *result,
gpointer user_data)
{
Ctx *ctx = user_data;
+ GtkTreeView *view;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
GList *events;
GList *l;
GError *error = NULL;
+ gint n;
if (log_window == NULL)
- goto out;
+ {
+ ctx_free (ctx);
+ return;
+ }
if (log_window->count != ctx->count)
goto out;
@@ -2357,6 +2417,19 @@ log_window_got_messages_for_date_cb (GObject *manager,
}
g_list_free (events);
+ view = GTK_TREE_VIEW (log_window->treeview_events);
+ model = gtk_tree_view_get_model (view);
+ n = gtk_tree_model_iter_n_children (model, NULL) - 1;
+
+ if (n >= 0 && gtk_tree_model_iter_nth_child (model, &iter, NULL, n))
+ {
+ GtkTreePath *path;
+
+ path = gtk_tree_model_get_path (model, &iter);
+ gtk_tree_view_scroll_to_cell (view, path, NULL, FALSE, 0, 0);
+ gtk_tree_path_free (path);
+ }
+
out:
ctx_free (ctx);
@@ -2444,6 +2517,9 @@ log_window_get_messages_for_dates (EmpathyLogWindow *window,
}
}
+ start_spinner ();
+ g_timeout_add (1000, show_spinner, NULL);
+ _tpl_action_chain_append (window->chain, show_events, NULL);
_tpl_action_chain_start (window->chain);
g_list_free_full (accounts, g_object_unref);
@@ -2554,7 +2630,7 @@ select_first_date (TplActionChain *chain, gpointer user_data)
selection = gtk_tree_view_get_selection (view);
/* Show messages of the most recent date */
- if (gtk_tree_model_get_iter_first (model, &iter))
+ if (gtk_tree_model_iter_nth_child (model, &iter, NULL, 2))
gtk_tree_selection_select_iter (selection, &iter);
_tpl_action_chain_continue (log_window->chain);
diff --git a/libempathy-gtk/empathy-log-window.ui b/libempathy-gtk/empathy-log-window.ui
index 9b5ab9551..9c2303829 100644
--- a/libempathy-gtk/empathy-log-window.ui
+++ b/libempathy-gtk/empathy-log-window.ui
@@ -225,15 +225,63 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow_events">
+ <object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
+ <property name="show_border">False</property>
+ <property name="show_tabs">False</property>
<child>
- <object class="GtkTreeView" id="treeview_events">
+ <object class="GtkScrolledWindow" id="scrolledwindow_events">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <object class="GtkTreeView" id="treeview_events">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">page 2</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinner" id="spinner">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">page 2</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow_empty">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <object class="GtkTreeView" id="treeview_empty">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/libempathy-gtk/empathy-persona-view.c b/libempathy-gtk/empathy-persona-view.c
index adfe6be5c..ff2c6ec82 100644
--- a/libempathy-gtk/empathy-persona-view.c
+++ b/libempathy-gtk/empathy-persona-view.c
@@ -83,12 +83,13 @@ enum
PROP_FEATURES,
};
-enum DndDragType
+typedef enum
{
- DND_DRAG_TYPE_INDIVIDUAL_ID,
+ DND_DRAG_TYPE_UNKNOWN = -1,
+ DND_DRAG_TYPE_INDIVIDUAL_ID = 0,
DND_DRAG_TYPE_PERSONA_ID,
DND_DRAG_TYPE_STRING,
-};
+} DndDragType;
#define DRAG_TYPE(T,I) \
{ (gchar *) T, 0, I }
@@ -106,7 +107,6 @@ static const GtkTargetEntry drag_types_source[] = {
#undef DRAG_TYPE
static GdkAtom drag_atoms_dest[G_N_ELEMENTS (drag_types_dest)];
-static GdkAtom drag_atoms_source[G_N_ELEMENTS (drag_types_source)];
enum
{
@@ -412,12 +412,24 @@ drag_motion (GtkWidget *widget,
EmpathyPersonaView *self = EMPATHY_PERSONA_VIEW (widget);
EmpathyPersonaViewPriv *priv;
GdkAtom target;
+ guint i;
+ DndDragType drag_type = DND_DRAG_TYPE_UNKNOWN;
priv = GET_PRIV (self);
target = gtk_drag_dest_find_target (GTK_WIDGET (self), context, NULL);
- if (target == drag_atoms_dest[DND_DRAG_TYPE_INDIVIDUAL_ID])
+ /* Determine the DndDragType of the data */
+ for (i = 0; i < G_N_ELEMENTS (drag_atoms_dest); i++)
+ {
+ if (target == drag_atoms_dest[i])
+ {
+ drag_type = drag_types_dest[i].info;
+ break;
+ }
+ }
+
+ if (drag_type == DND_DRAG_TYPE_INDIVIDUAL_ID)
{
GtkTreePath *path;
@@ -466,7 +478,8 @@ drag_data_get (GtkWidget *widget,
return;
persona_uid = folks_persona_get_uid (persona);
- gtk_selection_data_set (selection, drag_atoms_source[info], 8,
+ gtk_selection_data_set (selection,
+ gdk_atom_intern ("text/persona-id", FALSE), 8,
(guchar *) persona_uid, strlen (persona_uid) + 1);
g_object_unref (persona);
@@ -614,9 +627,6 @@ constructed (GObject *object)
/* Drag & Drop. */
for (i = 0; i < G_N_ELEMENTS (drag_types_dest); ++i)
drag_atoms_dest[i] = gdk_atom_intern (drag_types_dest[i].target, FALSE);
-
- for (i = 0; i < G_N_ELEMENTS (drag_types_source); ++i)
- drag_atoms_source[i] = gdk_atom_intern (drag_types_source[i].target, FALSE);
}
static void
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 3f260327a..0e1b55fdb 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -667,12 +667,6 @@ add_video_preview_to_pipeline (EmpathyCallWindow *self)
return;
}
- if (!gst_bin_add (GST_BIN (priv->pipeline), priv->video_tee))
- {
- g_warning ("Could not add video tee to pipeline");
- return;
- }
-
if (!gst_bin_add (GST_BIN (priv->pipeline), preview))
{
g_warning ("Could not add video preview to pipeline");
@@ -699,7 +693,6 @@ create_video_preview (EmpathyCallWindow *self)
GstBus *bus;
g_assert (priv->video_preview == NULL);
- g_assert (priv->video_tee == NULL);
bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline));
@@ -710,10 +703,6 @@ create_video_preview (EmpathyCallWindow *self)
gtk_box_pack_start (GTK_BOX (priv->self_user_output_hbox),
priv->video_preview, TRUE, TRUE, 0);
- priv->video_tee = gst_element_factory_make ("tee", NULL);
- gst_object_ref (priv->video_tee);
- gst_object_sink (priv->video_tee);
-
g_object_unref (bus);
}
@@ -990,6 +979,12 @@ create_pipeline (EmpathyCallWindow *self)
priv->pipeline = gst_pipeline_new (NULL);
priv->pipeline_playing = FALSE;
+ priv->video_tee = gst_element_factory_make ("tee", NULL);
+ gst_object_ref (priv->video_tee);
+ gst_object_sink (priv->video_tee);
+
+ gst_bin_add (GST_BIN (priv->pipeline), priv->video_tee);
+
bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline));
priv->bus_message_source_id = gst_bus_add_watch (bus,
empathy_call_window_bus_message, self);
@@ -2594,21 +2589,18 @@ empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
retval = TRUE;
break;
case FS_MEDIA_TYPE_VIDEO:
- if (priv->video_input != NULL)
+ if (priv->video_tee != NULL)
{
- if (priv->video_tee != NULL)
+ pad = gst_element_get_request_pad (priv->video_tee, "src%d");
+ if (GST_PAD_LINK_FAILED (gst_pad_link (pad, sink)))
{
- pad = gst_element_get_request_pad (priv->video_tee, "src%d");
- if (GST_PAD_LINK_FAILED (gst_pad_link (pad, sink)))
- {
- g_warning ("Could not link video source input pipeline");
- break;
- }
- gst_object_unref (pad);
+ g_warning ("Could not link video source input pipeline");
+ break;
}
-
- retval = TRUE;
+ gst_object_unref (pad);
}
+
+ retval = TRUE;
break;
default:
g_assert_not_reached ();
@@ -2634,7 +2626,7 @@ empathy_call_window_remove_video_input (EmpathyCallWindow *self)
gst_element_set_state (preview, GST_STATE_NULL);
gst_bin_remove_many (GST_BIN (priv->pipeline), priv->video_input,
- priv->video_tee, preview, NULL);
+ preview, NULL);
g_object_unref (priv->video_input);
priv->video_input = NULL;
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 4bbf1a789..d498d8fec 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1389,8 +1389,9 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
G_CALLBACK (chat_window_notification_closed_cb), window, 0);
if (has_x_canonical_append) {
+ /* We have to set a not empty string to keep libnotify happy */
notify_notification_set_hint_string (notification,
- EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "");
+ EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "1");
}
}
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 2fcc31e02..e81218f2c 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -223,6 +223,8 @@ main_window_flash_foreach (GtkTreeModel *model,
pixbuf = empathy_individual_store_get_individual_status_icon (
GET_PRIV (data->window)->individual_store,
individual);
+ if (pixbuf != NULL)
+ g_object_ref (pixbuf);
}
gtk_tree_store_set (GTK_TREE_STORE (model), iter,
@@ -243,6 +245,7 @@ main_window_flash_foreach (GtkTreeModel *model,
g_object_unref (individual);
tp_clear_object (&contact);
+ tp_clear_object (&pixbuf);
return FALSE;
}
@@ -941,10 +944,11 @@ main_window_balance_update_balance (GtkAction *action,
GValueArray *balance)
{
TpAccount *account = g_object_get_data (G_OBJECT (action), "account");
+ GtkWidget *label;
int amount = 0;
guint scale = G_MAXINT32;
const char *currency = "";
- char *str;
+ char *money, *str;
if (balance != NULL)
tp_value_array_unpack (balance, 3,
@@ -956,19 +960,28 @@ main_window_balance_update_balance (GtkAction *action,
scale == G_MAXINT32 &&
tp_str_empty (currency)) {
/* unknown balance */
- str = g_strdup_printf ("%s (--)",
- tp_account_get_display_name (account));
+ money = g_strdup ("--");
} else {
- char *money = empathy_format_currency (amount, scale, currency);
+ char *tmp = empathy_format_currency (amount, scale, currency);
- str = g_strdup_printf ("%s (%s %s)",
- tp_account_get_display_name (account),
- currency, money);
- g_free (money);
+ money = g_strdup_printf ("%s %s", currency, tmp);
+ g_free (tmp);
}
+ /* Translators: this string will be something like:
+ * Top up Skype ($1.23)..." */
+ str = g_strdup_printf (_("Top up %s (%s)..."),
+ tp_account_get_display_name (account),
+ money);
+
gtk_action_set_label (action, str);
g_free (str);
+
+ /* update the money label in the roster */
+ label = g_object_get_data (G_OBJECT (action), "money-label");
+
+ gtk_label_set_text (GTK_LABEL (label), money);
+ g_free (money);
}
static void
@@ -1079,35 +1092,42 @@ main_window_setup_balance_create_widget (EmpathyMainWindow *window,
GtkAction *action)
{
EmpathyMainWindowPriv *priv = GET_PRIV (window);
+ TpAccount *account;
GtkWidget *hbox, *image, *label, *button;
+ account = g_object_get_data (G_OBJECT (action), "account");
+ g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
+
hbox = gtk_hbox_new (FALSE, 6);
+ /* protocol icon */
image = gtk_image_new ();
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0);
- gtk_widget_show (image);
+ g_object_bind_property (action, "icon-name", image, "icon-name",
+ G_BINDING_SYNC_CREATE);
+ /* account name label */
label = gtk_label_new ("");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
- gtk_widget_show (label);
+ g_object_bind_property (account, "display-name", label, "label",
+ G_BINDING_SYNC_CREATE);
+
+ /* balance label */
+ label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+ g_object_set_data (G_OBJECT (action), "money-label", label);
+ /* top up button */
button = gtk_button_new_with_label (_("Top Up..."));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
- gtk_widget_show (button);
+ g_signal_connect_swapped (button, "clicked",
+ G_CALLBACK (gtk_action_activate), action);
gtk_box_pack_start (GTK_BOX (priv->balance_vbox), hbox, FALSE, TRUE, 0);
gtk_widget_show_all (hbox);
- /* bind the properties from the action to the widgets -- I could have
- * written a widget that implemented GtkActivatable, but effort */
- g_object_bind_property (action, "label", label, "label",
- G_BINDING_SYNC_CREATE);
- g_object_bind_property (action, "icon-name", image, "icon-name",
- G_BINDING_SYNC_CREATE);
- g_signal_connect_swapped (button, "clicked",
- G_CALLBACK (gtk_action_activate), action);
-
/* tie the lifetime of the widget to the lifetime of the action */
g_object_weak_ref (G_OBJECT (action),
(GWeakNotify) gtk_widget_destroy, hbox);
diff --git a/src/empathy-main-window.ui b/src/empathy-main-window.ui
index 95a6ec8dd..9d6474ba5 100644
--- a/src/empathy-main-window.ui
+++ b/src/empathy-main-window.ui
@@ -71,7 +71,7 @@
<child>
<object class="GtkToggleAction" id="view_balance_show_in_roster">
<property name="name">view_balance_show_in_roster</property>
- <property name="label" translatable="yes">Show Account _Balances in Roster</property>
+ <property name="label" translatable="yes">Credit Balance</property>
<property name="visible">False</property>
</object>
</child>
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index a4ca21300..325fa7f0f 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -251,8 +251,9 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
NOTIFY_EXPIRES_DEFAULT);
if (has_x_canonical_append) {
+ /* We have to set a not empty string to keep libnotify happy */
notify_notification_set_hint_string (notification,
- EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "");
+ EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "1");
}
if (empathy_notify_manager_has_capability (priv->notify_mgr,