diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-accounts-dialog.c | 5 | ||||
-rw-r--r-- | src/empathy-chat-window.c | 15 | ||||
-rw-r--r-- | src/empathy-chatrooms-window.c | 2 | ||||
-rw-r--r-- | src/empathy-event-manager.c | 14 | ||||
-rw-r--r-- | src/empathy-ft-manager.c | 34 | ||||
-rw-r--r-- | src/empathy-main-window.c | 8 | ||||
-rw-r--r-- | src/empathy-new-chatroom-dialog.c | 71 |
7 files changed, 52 insertions, 97 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 196ffceb5..f1a21140b 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -2389,6 +2389,7 @@ empathy_accounts_dialog_show_application (GdkScreen *screen, gboolean hidden) { GError *error = NULL; + GdkDisplay *display; GString *cmd; gchar *path; GAppInfo *app_info; @@ -2435,8 +2436,8 @@ empathy_accounts_dialog_show_application (GdkScreen *screen, goto out; } - context = gdk_app_launch_context_new (); - gdk_app_launch_context_set_display (context, gdk_screen_get_display (screen)); + display = gdk_screen_get_display (screen); + context = gdk_display_get_app_launch_context (display); if (!g_app_info_launch (app_info, NULL, (GAppLaunchContext *) context, &error)) diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 9f893dc7e..07b940e3f 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -219,20 +219,23 @@ chat_window_close_clicked_cb (GtkAction *action, } static void -chat_tab_style_set_cb (GtkWidget *hbox, - GtkStyle *previous_style, - gpointer user_data) +chat_tab_style_updated_cb (GtkWidget *hbox, + gpointer user_data) { GtkWidget *button; int char_width, h, w; PangoContext *context; + const PangoFontDescription *font_desc; PangoFontMetrics *metrics; button = g_object_get_data (G_OBJECT (user_data), "chat-window-tab-close-button"); context = gtk_widget_get_pango_context (hbox); - metrics = pango_context_get_metrics (context, gtk_widget_get_style (hbox)->font_desc, + font_desc = gtk_style_context_get_font (gtk_widget_get_style_context (hbox), + GTK_STATE_FLAG_NORMAL); + + metrics = pango_context_get_metrics (context, font_desc, pango_context_get_language (context)); char_width = pango_font_metrics_get_approximate_char_width (metrics); pango_font_metrics_unref (metrics); @@ -335,8 +338,8 @@ chat_window_create_label (EmpathyChatWindow *window, /* React to theme changes and also setup the size correctly. */ g_signal_connect (hbox, - "style-set", - G_CALLBACK (chat_tab_style_set_cb), + "style-updated", + G_CALLBACK (chat_tab_style_updated_cb), chat); } diff --git a/src/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c index 35e3e8b9d..1b00548f5 100644 --- a/src/empathy-chatrooms-window.c +++ b/src/empathy-chatrooms-window.c @@ -139,7 +139,7 @@ empathy_chatrooms_window_show (GtkWindow *parent) /* Account chooser for chat rooms */ window->account_chooser = empathy_account_chooser_new (); empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (window->account_chooser), - empathy_account_chooser_filter_is_connected, + empathy_account_chooser_filter_supports_chatrooms, NULL); g_object_set (window->account_chooser, "has-all-option", TRUE, diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 93656c3a9..c7dd660a0 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -1115,11 +1115,12 @@ event_manager_presence_changed_cb (EmpathyContact *contact, if (g_settings_get_boolean (priv->gsettings_notif, EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNOUT)) { - header = g_strdup_printf (_("%s is now offline."), + header = g_strdup_printf ("<b>%s</b>", empathy_contact_get_alias (contact)); - event_manager_add (manager, NULL, contact, EMPATHY_EVENT_TYPE_PRESENCE, - EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL); + event_manager_add (manager, NULL, contact, + EMPATHY_EVENT_TYPE_PRESENCE, EMPATHY_IMAGE_AVATAR_DEFAULT, + header, _("Disconnected"), NULL, NULL, NULL); } } } @@ -1136,11 +1137,12 @@ event_manager_presence_changed_cb (EmpathyContact *contact, if (g_settings_get_boolean (priv->gsettings_notif, EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNIN)) { - header = g_strdup_printf (_("%s is now online."), + header = g_strdup_printf ("<b>%s</b>", empathy_contact_get_alias (contact)); - event_manager_add (manager, NULL, contact, EMPATHY_EVENT_TYPE_PRESENCE, - EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL); + event_manager_add (manager, NULL, contact, + EMPATHY_EVENT_TYPE_PRESENCE, EMPATHY_IMAGE_AVATAR_DEFAULT, + header, _("Connected"), NULL, NULL, NULL); } } } diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c index 126ad8795..abe7975c4 100644 --- a/src/empathy-ft-manager.c +++ b/src/empathy-ft-manager.c @@ -816,8 +816,6 @@ ft_manager_open (EmpathyFTManager *manager) GtkTreeIter iter; GtkTreeModel *model; EmpathyFTHandler *handler; - char *uri; - GFile *file; EmpathyFTManagerPriv *priv = GET_PRIV (manager); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); @@ -827,14 +825,19 @@ ft_manager_open (EmpathyFTManager *manager) gtk_tree_model_get (model, &iter, COL_FT_OBJECT, &handler, -1); - file = empathy_ft_handler_get_gfile (handler); - uri = g_file_get_uri (file); + if (empathy_ft_handler_is_completed (handler)){ + char *uri; + GFile *file; - DEBUG ("Opening URI: %s", uri); - empathy_url_show (GTK_WIDGET (priv->window), uri); + file = empathy_ft_handler_get_gfile (handler); + uri = g_file_get_uri (file); + + DEBUG ("Opening URI: %s", uri); + empathy_url_show (GTK_WIDGET (priv->window), uri); + g_free (uri); + } g_object_unref (handler); - g_free (uri); } static void @@ -923,6 +926,20 @@ ft_manager_destroy_cb (GtkWidget *widget, } static gboolean +ft_view_button_press_event_cb (GtkWidget *widget, + GdkEventKey *event, + EmpathyFTManager *manager) +{ + + if (event->type != GDK_2BUTTON_PRESS) + return FALSE; + + ft_manager_open (manager); + + return FALSE; +} + +static gboolean ft_manager_key_press_event_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data) @@ -977,6 +994,9 @@ ft_manager_build_ui (EmpathyFTManager *manager) gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); g_signal_connect (selection, "changed", G_CALLBACK (ft_manager_selection_changed), manager); + g_signal_connect (view, "button-press-event", + G_CALLBACK (ft_view_button_press_event_cb), + manager); gtk_tree_view_set_headers_visible (view, TRUE); gtk_tree_view_set_enable_search (view, FALSE); diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 88335b654..740220b2f 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -1479,14 +1479,12 @@ static void main_window_help_debug_cb (GtkAction *action, EmpathyMainWindow *window) { - GdkScreen *screen = gdk_screen_get_default (); + GdkDisplay *display; GError *error = NULL; gchar *path; GAppInfo *app_info; GdkAppLaunchContext *context = NULL; - g_return_if_fail (GDK_IS_SCREEN (screen)); - /* Try to run from source directory if possible */ path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "src", "empathy-debugger", NULL); @@ -1503,8 +1501,8 @@ main_window_help_debug_cb (GtkAction *action, goto out; } - context = gdk_app_launch_context_new (); - gdk_app_launch_context_set_display (context, gdk_screen_get_display (screen)); + display = gdk_display_get_default (); + context = gdk_display_get_app_launch_context (display); if (!g_app_info_launch (app_info, NULL, (GAppLaunchContext *) context, &error)) { diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c index 58690d139..f0e58c749 100644 --- a/src/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -73,11 +73,6 @@ typedef struct { GtkWidget *viewport_error; } EmpathyNewChatroomDialog; -typedef struct { - EmpathyAccountChooserFilterResultCallback callback; - gpointer user_data; -} FilterCallbackData; - enum { COL_NEED_PASSWORD, COL_INVITE_ONLY, @@ -138,70 +133,6 @@ static void new_chatroom_dialog_button_close_error_clicked_cb (GtkButton static EmpathyNewChatroomDialog *dialog_p = NULL; -static void -conn_prepared_cb (GObject *conn, - GAsyncResult *result, - gpointer user_data) -{ - FilterCallbackData *data = user_data; - GError *myerr = NULL; - TpCapabilities *caps; - - if (!tp_proxy_prepare_finish (conn, result, &myerr)) { - data->callback (FALSE, data->user_data); - g_slice_free (FilterCallbackData, data); - } - - caps = tp_connection_get_capabilities (TP_CONNECTION (conn)); - data->callback (tp_capabilities_supports_text_chatrooms (caps), - data->user_data); - - g_slice_free (FilterCallbackData, data); -} - -/** - * empathy_account_chooser_filter_supports_multichat: - * @account: a #TpAccount - * @callback: an #EmpathyAccountChooserFilterResultCallback accepting the result - * @callback_data: data passed to the @callback - * @user_data: user data or %NULL - * - * An #EmpathyAccountChooserFilterFunc that returns accounts that both - * support multiuser text chat and are connected. - * - * Returns (via the callback) TRUE if @account both supports muc and is connected - */ -static void -empathy_account_chooser_filter_supports_multichat ( - TpAccount *account, - EmpathyAccountChooserFilterResultCallback callback, - gpointer callback_data, - gpointer user_data) -{ - TpConnection *connection; - FilterCallbackData *cb_data; - GQuark features[] = { TP_CONNECTION_FEATURE_CAPABILITIES, 0 }; - - if (tp_account_get_connection_status (account, NULL) != - TP_CONNECTION_STATUS_CONNECTED) { - callback (FALSE, callback_data); - return; - } - - /* check if CM supports multiuser text chat */ - connection = tp_account_get_connection (account); - if (connection == NULL) { - callback (FALSE, callback_data); - return; - } - - cb_data = g_slice_new0 (FilterCallbackData); - cb_data->callback = callback; - cb_data->user_data = callback_data; - tp_proxy_prepare_async (connection, features, conn_prepared_cb, - cb_data); -} - void empathy_new_chatroom_dialog_show (GtkWindow *parent) { @@ -270,7 +201,7 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent) /* Account chooser for custom */ dialog->account_chooser = empathy_account_chooser_new (); empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser), - empathy_account_chooser_filter_supports_multichat, + empathy_account_chooser_filter_supports_chatrooms, NULL); gtk_table_attach_defaults (GTK_TABLE (dialog->table_info), dialog->account_chooser, |