aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/empathy-accounts-dialog.c13
-rw-r--r--src/empathy-auth-client.c3
-rw-r--r--src/empathy-call-window.c2
-rw-r--r--src/empathy-chat-window.c40
-rw-r--r--src/empathy-debug-window.c2
-rw-r--r--src/empathy-roster-window.c9
-rw-r--r--src/gedit-close-button.c80
-rw-r--r--src/gedit-close-button.h60
9 files changed, 53 insertions, 158 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 01de664b0..086d13be8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,7 +85,6 @@ empathy_chat_SOURCES = \
empathy-chat-window.c empathy-chat-window.h \
empathy-invite-participant-dialog.c empathy-invite-participant-dialog.h \
empathy-chat.c \
- gedit-close-button.c gedit-close-button.h \
$(NULL)
empathy_call_SOURCES = \
@@ -138,7 +137,6 @@ empathy_handwritten_source = \
empathy-preferences.c empathy-preferences.h \
empathy-status-icon.c empathy-status-icon.h \
empathy-chat-manager.c empathy-chat-manager.h \
- gedit-close-button.c gedit-close-button.h \
empathy.c
empathy_SOURCES = \
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 4de6911e1..578f998bc 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -785,14 +785,13 @@ account_dialog_show_contact_details_failed (EmpathyAccountsDialog *dialog,
static void
create_contact_info_editor (EmpathyAccountsDialog *self,
- TpConnection *conn)
+ TpContact *tp_contact)
{
EmpathyAccountsDialogPriv *priv = GET_PRIV (self);
GtkWidget *editor, *alig;
EmpathyContact *contact;
- contact = empathy_contact_dup_from_tp_contact (
- tp_connection_get_self_contact (conn));
+ contact = empathy_contact_dup_from_tp_contact (tp_contact);
alig = gtk_alignment_new (0.5, 0, 1, 1);
@@ -819,6 +818,7 @@ account_dialog_create_dialog_content (EmpathyAccountsDialog *dialog,
const gchar *icon_name;
TpAccount *account;
TpConnection *conn = NULL;
+ TpContact *contact = NULL;
GtkWidget *bbox, *button;
account = empathy_account_settings_get_account (settings);
@@ -835,7 +835,12 @@ account_dialog_create_dialog_content (EmpathyAccountsDialog *dialog,
if (conn != NULL &&
tp_proxy_get_invalidated (conn) == NULL)
{
- create_contact_info_editor (dialog, conn);
+ contact = tp_connection_get_self_contact (conn);
+ }
+
+ if (contact != NULL)
+ {
+ create_contact_info_editor (dialog, contact);
}
else
{
diff --git a/src/empathy-auth-client.c b/src/empathy-auth-client.c
index 3228738f4..8de7b5c52 100644
--- a/src/empathy-auth-client.c
+++ b/src/empathy-auth-client.c
@@ -309,6 +309,9 @@ main (int argc,
gtk_window_set_default_icon_name ("empathy");
textdomain (GETTEXT_PACKAGE);
+ /* There is no 'main' UI window so just use the default GdkScreen */
+ empathy_set_css_provider (NULL);
+
#ifdef ENABLE_DEBUG
/* Set up debug sender */
debug_sender = tp_debug_sender_dup ();
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index d9641fdf9..437c8f544 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -1615,6 +1615,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
"menupreviewswap", "activate", empathy_call_window_swap_camera_cb,
NULL);
+ empathy_set_css_provider (GTK_WIDGET (self));
+
/* FIXME: we should use a stock "OSD" style class for the toolbar,
* once it's available in GTK+/Adwaita.
*/
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 6de6db140..ad48fcbac 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -60,7 +60,6 @@
#include "empathy-chat-window.h"
#include "empathy-about-dialog.h"
#include "empathy-invite-participant-dialog.h"
-#include "gedit-close-button.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
@@ -413,6 +412,35 @@ chat_tab_style_updated_cb (GtkWidget *hbox,
}
static GtkWidget *
+create_close_button (void)
+{
+ GtkWidget *button, *image;
+ GtkStyleContext *context;
+
+ button = gtk_button_new ();
+
+ context = gtk_widget_get_style_context (button);
+ gtk_style_context_add_class (context, "empathy-tab-close-button");
+
+ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+ gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+
+ /* We don't want focus/keynav for the button to avoid clutter, and
+ * Ctrl-W works anyway.
+ */
+ gtk_widget_set_can_focus (button, FALSE);
+ gtk_widget_set_can_default (button, FALSE);
+
+ image = gtk_image_new_from_icon_name ("window-close-symbolic",
+ GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+
+ gtk_container_add (GTK_CONTAINER (button), image);
+
+ return button;
+}
+
+static GtkWidget *
chat_window_create_label (EmpathyChatWindow *window,
EmpathyChat *chat,
gboolean is_tab_label)
@@ -479,15 +507,9 @@ chat_window_create_label (EmpathyChatWindow *window,
"chat-window-tab-sending-spinner",
sending_spinner);
- close_button = gedit_close_button_new ();
+ close_button = create_close_button ();
g_object_set_data (G_OBJECT (chat), "chat-window-tab-close-button", close_button);
- /* We don't want focus/keynav for the button to avoid clutter, and
- * Ctrl-W works anyway.
- */
- gtk_widget_set_can_focus (close_button, FALSE);
- gtk_widget_set_can_default (close_button, FALSE);
-
gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
g_signal_connect (close_button,
@@ -2307,6 +2329,8 @@ empathy_chat_window_init (EmpathyChatWindow *window)
g_object_ref (priv->ui_manager);
g_object_unref (gui);
+ empathy_set_css_provider (GTK_WIDGET (priv->dialog));
+
priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
priv->gsettings_notif = g_settings_new (EMPATHY_PREFS_NOTIFICATIONS_SCHEMA);
priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index 57549f4fc..b2e229da2 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -1855,6 +1855,8 @@ am_prepared_cb (GObject *am,
g_clear_error (&error);
}
+ empathy_set_css_provider (GTK_WIDGET (object));
+
gtk_window_set_title (GTK_WINDOW (object), _("Debug Window"));
gtk_window_set_default_size (GTK_WINDOW (object), 800, 400);
empathy_geometry_bind (GTK_WINDOW (object), "debug-window");
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index afe3a4e60..f614a806b 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -2144,6 +2144,8 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_ROSTER_WINDOW, EmpathyRosterWindowPriv);
+ empathy_set_css_provider (GTK_WIDGET (self));
+
self->priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
self->priv->gsettings_contacts = g_settings_new (EMPATHY_PREFS_CONTACTS_SCHEMA);
@@ -2237,10 +2239,6 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
self->priv->throbber,
FALSE, TRUE, 0);
- /* XXX: this class is designed to live for the duration of the program,
- * so it's got a race condition between its signal handlers and its
- * finalization. The class is planned to be removed, so we won't fix
- * this before then. */
self->priv->individual_manager = empathy_individual_manager_dup_singleton ();
if (!empathy_individual_manager_get_contacts_loaded (
@@ -2343,6 +2341,9 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
g_settings_bind (self->priv->gsettings_contacts, EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM,
self->priv->individual_store, "sort-criterium",
G_SETTINGS_BIND_GET);
+ g_settings_bind (self->priv->gsettings_ui, EMPATHY_PREFS_UI_SHOW_GROUPS,
+ self->priv->individual_store, "show-groups",
+ G_SETTINGS_BIND_GET);
g_settings_bind (self->priv->gsettings_ui, "show-balance-in-roster",
self->priv->balance_vbox, "visible",
G_SETTINGS_BIND_GET);
diff --git a/src/gedit-close-button.c b/src/gedit-close-button.c
deleted file mode 100644
index 6a9021aeb..000000000
--- a/src/gedit-close-button.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * gedit-close-button.c
- * This file is part of gedit
- *
- * Copyright (C) 2010 - Paolo Borelli
- * Copyright (C) 2011 - Ignacio Casal Quinteiro
- *
- * gedit is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * gedit is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "gedit-close-button.h"
-
-struct _GeditCloseButtonClassPrivate
-{
- GtkCssProvider *css;
-};
-
-G_DEFINE_TYPE_WITH_CODE (GeditCloseButton, gedit_close_button, GTK_TYPE_BUTTON,
- g_type_add_class_private (g_define_type_id, sizeof (GeditCloseButtonClassPrivate)))
-
-static void
-gedit_close_button_class_init (GeditCloseButtonClass *klass)
-{
- static const gchar button_style[] =
- "* {\n"
- "-GtkButton-default-border : 0;\n"
- "-GtkButton-default-outside-border : 0;\n"
- "-GtkButton-inner-border: 0;\n"
- "-GtkWidget-focus-line-width : 0;\n"
- "-GtkWidget-focus-padding : 0;\n"
- "padding: 0;\n"
- "}";
-
- klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButtonClassPrivate);
-
- klass->priv->css = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (klass->priv->css, button_style, -1, NULL);
-}
-
-static void
-gedit_close_button_init (GeditCloseButton *button)
-{
- GtkStyleContext *context;
- GtkWidget *image;
-
- image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
- GTK_ICON_SIZE_MENU);
- gtk_widget_show (image);
-
- gtk_container_add (GTK_CONTAINER (button), image);
-
- /* make it small */
- context = gtk_widget_get_style_context (GTK_WIDGET (button));
- gtk_style_context_add_provider (context,
- GTK_STYLE_PROVIDER (GEDIT_CLOSE_BUTTON_GET_CLASS (button)->priv->css),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-}
-
-GtkWidget *
-gedit_close_button_new ()
-{
- return GTK_WIDGET (g_object_new (GEDIT_TYPE_CLOSE_BUTTON,
- "relief", GTK_RELIEF_NONE,
- "focus-on-click", FALSE,
- NULL));
-}
-
-/* ex:set ts=8 noet: */
diff --git a/src/gedit-close-button.h b/src/gedit-close-button.h
deleted file mode 100644
index 791a73024..000000000
--- a/src/gedit-close-button.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * gedit-close-button.h
- * This file is part of gedit
- *
- * Copyright (C) 2010 - Paolo Borelli
- *
- * gedit is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * gedit is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __GEDIT_CLOSE_BUTTON_H__
-#define __GEDIT_CLOSE_BUTTON_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define GEDIT_TYPE_CLOSE_BUTTON (gedit_close_button_get_type ())
-#define GEDIT_CLOSE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButton))
-#define GEDIT_CLOSE_BUTTON_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButton const))
-#define GEDIT_CLOSE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButtonClass))
-#define GEDIT_IS_CLOSE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_CLOSE_BUTTON))
-#define GEDIT_IS_CLOSE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_CLOSE_BUTTON))
-#define GEDIT_CLOSE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButtonClass))
-
-typedef struct _GeditCloseButton GeditCloseButton;
-typedef struct _GeditCloseButtonClass GeditCloseButtonClass;
-typedef struct _GeditCloseButtonClassPrivate GeditCloseButtonClassPrivate;
-
-struct _GeditCloseButton
-{
- GtkButton parent;
-};
-
-struct _GeditCloseButtonClass
-{
- GtkButtonClass parent_class;
-
- GeditCloseButtonClassPrivate *priv;
-};
-
-GType gedit_close_button_get_type (void) G_GNUC_CONST;
-
-GtkWidget *gedit_close_button_new (void);
-
-G_END_DECLS
-
-#endif /* __GEDIT_CLOSE_BUTTON_H__ */
-/* ex:set ts=8 noet: */