diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-04 17:59:35 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-04 17:59:35 +0800 |
commit | 761c4da4a72672f5aa6a3e21dea88ec8fb03733b (patch) | |
tree | 6a57d4ea35b661ea85ae9427c8b09a6970cb6655 /src | |
parent | 39a95ab4ddfea6bd10a7c326168ed04b1084555a (diff) | |
parent | c33fdeaba0949ce84d3b3fabc56007d3ab9de7e9 (diff) | |
download | gsoc2013-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
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-call-window.c | 38 | ||||
-rw-r--r-- | src/empathy-chat-window.c | 3 | ||||
-rw-r--r-- | src/empathy-main-window.c | 60 | ||||
-rw-r--r-- | src/empathy-main-window.ui | 2 | ||||
-rw-r--r-- | src/empathy-status-icon.c | 3 |
5 files changed, 60 insertions, 46 deletions
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, |