aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2008-02-11 03:15:03 +0800
committerXavier Claessens <xclaesse@gmail.com>2008-02-11 03:15:03 +0800
commit0242d77256a8455f8e042bd82e499bee58fbfa00 (patch)
treeb159356b226c280d99d32e2d8773b4d46c63269c /libempathy-gtk
parent5af1142965e18c7bfa7ac9286aa54a466da4dc1a (diff)
parent374ef859079592419f4914c872c0c17b2aeea1a8 (diff)
downloadgsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.tar
gsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.tar.gz
gsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.tar.bz2
gsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.tar.lz
gsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.tar.xz
gsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.tar.zst
gsoc2013-empathy-0242d77256a8455f8e042bd82e499bee58fbfa00.zip
Merge branch 'master' into ircGeneric
Conflicts: libempathy-gtk/Makefile.am libempathy-gtk/empathy-accounts-dialog.c libempathy/Makefile.am
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/.gitignore1
-rw-r--r--libempathy-gtk/Makefile.am34
-rw-r--r--libempathy-gtk/empathy-account-widget-generic.c327
-rw-r--r--libempathy-gtk/empathy-account-widget-jabber.c322
-rw-r--r--libempathy-gtk/empathy-account-widget-jabber.h33
-rw-r--r--libempathy-gtk/empathy-account-widget-msn.c214
-rw-r--r--libempathy-gtk/empathy-account-widget-msn.h34
-rw-r--r--libempathy-gtk/empathy-account-widget-salut.c180
-rw-r--r--libempathy-gtk/empathy-account-widget-salut.glade127
-rw-r--r--libempathy-gtk/empathy-account-widget-salut.h34
-rw-r--r--libempathy-gtk/empathy-account-widget.c589
-rw-r--r--libempathy-gtk/empathy-account-widget.h (renamed from libempathy-gtk/empathy-account-widget-generic.h)15
-rw-r--r--libempathy-gtk/empathy-accounts-dialog.c30
-rw-r--r--libempathy-gtk/empathy-accounts-dialog.glade923
-rw-r--r--libempathy-gtk/empathy-chat-window.c2
-rw-r--r--libempathy-gtk/empathy-chat.c16
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c6
-rw-r--r--libempathy-gtk/empathy-main-window.glade733
-rw-r--r--libempathy-gtk/empathy-new-message-dialog.c66
-rw-r--r--libempathy-gtk/empathy-new-message-dialog.glade111
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c1
-rw-r--r--libempathy-gtk/empathy-status-icon.glade133
-rw-r--r--libempathy-gtk/empathy-theme.c1
-rw-r--r--libempathy-gtk/empathy-ui-utils.c39
-rw-r--r--libempathy-gtk/empathy-ui-utils.h3
25 files changed, 1576 insertions, 2398 deletions
diff --git a/libempathy-gtk/.gitignore b/libempathy-gtk/.gitignore
index a3a15a1a4..3e3f6f051 100644
--- a/libempathy-gtk/.gitignore
+++ b/libempathy-gtk/.gitignore
@@ -1 +1,2 @@
+empathy-gtk-marshal.*
*.gladep
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 7f9de5676..ccb3dca13 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -6,6 +6,9 @@ AM_CPPFLAGS = \
$(WARN_CFLAGS)
BUILT_SOURCES = \
+ empathy-gtk-marshal.h \
+ empathy-gtk-marshal.c \
+ empathy-gtk-marshal.list \
empathy-gtk-enum-types.h \
empathy-gtk-enum-types.c
@@ -19,10 +22,7 @@ libempathy_gtk_la_SOURCES = \
empathy-contact-widget.c \
empathy-contact-dialogs.c \
empathy-accounts-dialog.c \
- empathy-account-widget-generic.c \
- empathy-account-widget-jabber.c \
- empathy-account-widget-msn.c \
- empathy-account-widget-salut.c \
+ empathy-account-widget.c \
empathy-account-widget-irc.c \
empathy-profile-chooser.c \
empathy-cell-renderer-expander.c \
@@ -66,7 +66,8 @@ libempathy_gtk_la_LIBADD = \
$(top_builddir)/libempathy/libempathy.la
libempathy_gtk_la_LDFLAGS = \
- -version-info ${LIBEMPATHY_GTK_CURRENT}:${LIBEMPATHY_GTK_REVISION}:${LIBEMPATHY_GTK_AGE}
+ -version-info ${LIBEMPATHY_GTK_CURRENT}:${LIBEMPATHY_GTK_REVISION}:${LIBEMPATHY_GTK_AGE} \
+ -export-symbols-regex ^empathy_
libempathy_gtk_headers = \
empathy-images.h \
@@ -76,10 +77,7 @@ libempathy_gtk_headers = \
empathy-contact-widget.h \
empathy-contact-dialogs.h \
empathy-accounts-dialog.h \
- empathy-account-widget-generic.h \
- empathy-account-widget-jabber.h \
- empathy-account-widget-msn.h \
- empathy-account-widget-salut.h \
+ empathy-account-widget.h \
empathy-account-widget-irc.h \
empathy-profile-chooser.h \
empathy-cell-renderer-expander.h \
@@ -141,6 +139,24 @@ glade_DATA = \
empathy-chat.glade \
empathy-new-message-dialog.glade
+empathy-gtk-marshal.list: $(libempathy_gtk_la_SOURCES) Makefile.am
+ ( cd $(srcdir) && \
+ sed -n -e 's/.*empathy_gtk_marshal_\([[:upper:]]*__[[:upper:]_]*\).*/\1/p' \
+ $(libempathy_gtk_la_SOURCES) ) \
+ | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
+ if cmp -s $@.tmp $@; then \
+ rm $@.tmp; \
+ else \
+ mv $@.tmp $@; \
+ fi
+
+%-marshal.h: %-marshal.list Makefile
+ $(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+
+%-marshal.c: %-marshal.list Makefile
+ echo "#include \"empathy-gtk-marshal.h\"" > $@ && \
+ $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
+
empathy-gtk-enum-types.h: stamp-empathy-gtk-enum-types.h
@true
stamp-empathy-gtk-enum-types.h: Makefile $(libempathy_gtk_headers)
diff --git a/libempathy-gtk/empathy-account-widget-generic.c b/libempathy-gtk/empathy-account-widget-generic.c
deleted file mode 100644
index 8ade3f26f..000000000
--- a/libempathy-gtk/empathy-account-widget-generic.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2006-2007 Imendio AB
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- * Martyn Russell <martyn@imendio.com>
- */
-
-#include <config.h>
-
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include <libmissioncontrol/mc-account.h>
-#include <libmissioncontrol/mc-protocol.h>
-
-#include <libempathy/empathy-debug.h>
-
-#include "empathy-account-widget-generic.h"
-#include "empathy-ui-utils.h"
-
-#define DEBUG_DOMAIN "AccountWidgetGeneric"
-
-typedef struct {
- McAccount *account;
-
- GtkWidget *sw;
- GtkWidget *table_settings;
-
- guint n_rows;
-} EmpathyAccountWidgetGeneric;
-
-static gboolean
-account_widget_generic_entry_focus_cb (GtkWidget *widget,
- GdkEventFocus *event,
- EmpathyAccountWidgetGeneric *settings)
-{
- const gchar *str;
- const gchar *param_name;
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- param_name = g_object_get_data (G_OBJECT (widget), "param_name");
-
- mc_account_set_param_string (settings->account, param_name, str);
-
- return FALSE;
-}
-
-static void
-account_widget_generic_int_changed_cb (GtkWidget *widget,
- EmpathyAccountWidgetGeneric *settings)
-{
- const gchar *param_name;
- gint value;
-
- value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (widget));
- param_name = g_object_get_data (G_OBJECT (widget), "param_name");
-
- mc_account_set_param_int (settings->account, param_name, value);
-}
-
-static void
-account_widget_generic_checkbutton_toggled_cb (GtkWidget *widget,
- EmpathyAccountWidgetGeneric *settings)
-{
- gboolean active;
- const gchar *param_name;
-
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
- param_name = g_object_get_data (G_OBJECT (widget), "param_name");
-
- mc_account_set_param_boolean (settings->account, param_name, active);
-}
-
-static gchar *
-account_widget_generic_format_param_name (const gchar *param_name)
-{
- gchar *str;
- gchar *p;
-
- str = g_strdup (param_name);
-
- if (str && g_ascii_isalpha (str[0])) {
- str[0] = g_ascii_toupper (str[0]);
- }
-
- while ((p = strchr (str, '-')) != NULL) {
- if (p[1] != '\0' && g_ascii_isalpha (p[1])) {
- p[0] = ' ';
- p[1] = g_ascii_toupper (p[1]);
- }
-
- p++;
- }
-
- return str;
-}
-
-static void
-account_widget_generic_setup_foreach (McProtocolParam *param,
- EmpathyAccountWidgetGeneric *settings)
-{
- GtkWidget *widget = NULL;
- gchar *param_name_formatted;
-
- param_name_formatted = account_widget_generic_format_param_name (param->name);
-
- gtk_table_resize (GTK_TABLE (settings->table_settings),
- ++settings->n_rows,
- 2);
-
- if (param->signature[0] == 's') {
- gchar *str = NULL;
-
- str = g_strdup_printf (_("%s:"), param_name_formatted);
- widget = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
- g_free (str);
-
- gtk_table_attach (GTK_TABLE (settings->table_settings),
- widget,
- 0, 1,
- settings->n_rows - 1, settings->n_rows,
- GTK_FILL, 0,
- 0, 0);
-
- str = NULL;
- widget = gtk_entry_new ();
- mc_account_get_param_string (settings->account,
- param->name,
- &str);
- if (str) {
- gtk_entry_set_text (GTK_ENTRY (widget), str);
- g_free (str);
- }
-
- if (strstr (param->name, "password")) {
- gtk_entry_set_visibility (GTK_ENTRY (widget), FALSE);
- }
-
- g_signal_connect (widget, "focus-out-event",
- G_CALLBACK (account_widget_generic_entry_focus_cb),
- settings);
-
- gtk_table_attach (GTK_TABLE (settings->table_settings),
- widget,
- 1, 2,
- settings->n_rows - 1, settings->n_rows,
- GTK_FILL | GTK_EXPAND, 0,
- 0, 0);
- }
- /* int types: ynqiuxt. double type is 'd' */
- else if (param->signature[0] == 'y' ||
- param->signature[0] == 'n' ||
- param->signature[0] == 'q' ||
- param->signature[0] == 'i' ||
- param->signature[0] == 'u' ||
- param->signature[0] == 'x' ||
- param->signature[0] == 't' ||
- param->signature[0] == 'd') {
- gchar *str = NULL;
- gint value = 0;
- gdouble minint = 0;
- gdouble maxint = 0;
- gdouble step = 1;
- switch (param->signature[0]) {
- case 'y': minint = G_MININT8; maxint = G_MAXINT8; break;
- case 'n': minint = G_MININT16; maxint = G_MAXINT16; break;
- case 'q': minint = 0; maxint = G_MAXUINT16; break;
- case 'i': minint = G_MININT32; maxint = G_MAXINT32; break;
- case 'u': minint = 0; maxint = G_MAXUINT32; break;
- case 'x': minint = G_MININT64; maxint = G_MAXINT64; break;
- case 't': minint = 0; maxint = G_MAXUINT64; break;
- case 'd': minint = G_MININT32; maxint = G_MAXINT32; step = 0.1; break;
- }
-
- str = g_strdup_printf (_("%s:"), param_name_formatted);
- widget = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
- g_free (str);
-
- gtk_table_attach (GTK_TABLE (settings->table_settings),
- widget,
- 0, 1,
- settings->n_rows - 1, settings->n_rows,
- GTK_FILL, 0,
- 0, 0);
-
- widget = gtk_spin_button_new_with_range (minint, maxint, step);
- mc_account_get_param_int (settings->account,
- param->name,
- &value);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value);
-
- g_signal_connect (widget, "value-changed",
- G_CALLBACK (account_widget_generic_int_changed_cb),
- settings);
-
- gtk_table_attach (GTK_TABLE (settings->table_settings),
- widget,
- 1, 2,
- settings->n_rows - 1, settings->n_rows,
- GTK_FILL | GTK_EXPAND, 0,
- 0, 0);
- }
- else if (param->signature[0] == 'b') {
- gboolean value = FALSE;
-
- mc_account_get_param_boolean (settings->account,
- param->name,
- &value);
-
- widget = gtk_check_button_new_with_label (param_name_formatted);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
-
- g_signal_connect (widget, "toggled",
- G_CALLBACK (account_widget_generic_checkbutton_toggled_cb),
- settings);
-
- gtk_table_attach (GTK_TABLE (settings->table_settings),
- widget,
- 0, 2,
- settings->n_rows - 1, settings->n_rows,
- GTK_FILL | GTK_EXPAND, 0,
- 0, 0);
- } else {
- empathy_debug (DEBUG_DOMAIN,
- "Unknown signature for param %s: %s\n",
- param_name_formatted, param->signature);
- }
-
- if (widget) {
- g_object_set_data_full (G_OBJECT (widget), "param_name",
- g_strdup (param->name), g_free);
- }
-
- g_free (param_name_formatted);
-}
-
-static void
-accounts_widget_generic_setup (EmpathyAccountWidgetGeneric *settings)
-{
- McProtocol *protocol;
- McProfile *profile;
- GSList *params;
-
- profile = mc_account_get_profile (settings->account);
- protocol = mc_profile_get_protocol (profile);
-
- if (!protocol) {
- /* The CM is not installed, MC shouldn't list them
- * see SF bug #1688779
- * FIXME: We should display something asking the user to
- * install the CM
- */
- g_object_unref (profile);
- return;
- }
-
- params = mc_protocol_get_params (protocol);
-
- g_slist_foreach (params,
- (GFunc) account_widget_generic_setup_foreach,
- settings);
-
- g_slist_free (params);
- g_object_unref (profile);
- g_object_unref (protocol);
-}
-
-static void
-account_widget_generic_destroy_cb (GtkWidget *widget,
- EmpathyAccountWidgetGeneric *settings)
-{
- g_object_unref (settings->account);
- g_free (settings);
-}
-
-GtkWidget *
-empathy_account_widget_generic_new (McAccount *account)
-{
- EmpathyAccountWidgetGeneric *settings;
-
- g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
-
- settings = g_new0 (EmpathyAccountWidgetGeneric, 1);
-
- settings->account = g_object_ref (account);
-
- settings->table_settings = gtk_table_new (0, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (settings->table_settings), 6);
- gtk_table_set_col_spacings (GTK_TABLE (settings->table_settings), 6);
- settings->sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (settings->sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (settings->sw),
- settings->table_settings);
-
- accounts_widget_generic_setup (settings);
-
- g_signal_connect (settings->sw, "destroy",
- G_CALLBACK (account_widget_generic_destroy_cb),
- settings);
-
- gtk_widget_show_all (settings->sw);
-
- return settings->sw;
-}
diff --git a/libempathy-gtk/empathy-account-widget-jabber.c b/libempathy-gtk/empathy-account-widget-jabber.c
deleted file mode 100644
index b3339f128..000000000
--- a/libempathy-gtk/empathy-account-widget-jabber.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This library 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.
- *
- * This library 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
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- */
-
-#include "config.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <glade/glade.h>
-
-#include <libmissioncontrol/mc-profile.h>
-
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-debug.h>
-
-#include "empathy-account-widget-jabber.h"
-#include "empathy-ui-utils.h"
-
-#define DEBUG_DOMAIN "AccountWidgetJabber"
-
-#define PORT_WITHOUT_SSL 5222
-#define PORT_WITH_SSL 5223
-
-typedef struct {
- McAccount *account;
-
- GtkWidget *vbox_settings;
- GtkWidget *button_forget;
- GtkWidget *entry_id;
- GtkWidget *entry_password;
- GtkWidget *entry_resource;
- GtkWidget *entry_server;
- GtkWidget *spinbutton_port;
- GtkWidget *spinbutton_priority;
- GtkWidget *checkbutton_ssl;
- GtkWidget *checkbutton_ignore_ssl_errors;
- GtkWidget *checkbutton_encryption;
-} EmpathyAccountWidgetJabber;
-
-static gboolean
-account_widget_jabber_entry_focus_cb (GtkWidget *widget,
- GdkEventFocus *event,
- EmpathyAccountWidgetJabber *settings)
-{
- const gchar *param;
- const gchar *str;
-
- if (widget == settings->entry_password) {
- param = "password";
- }
- else if (widget == settings->entry_resource) {
- param = "resource";
- }
- else if (widget == settings->entry_server) {
- param = "server";
- }
- else if (widget == settings->entry_id) {
- param = "account";
- } else {
- return FALSE;
- }
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- if (G_STR_EMPTY (str)) {
- gchar *value = NULL;
-
- mc_account_unset_param (settings->account, param);
- mc_account_get_param_string (settings->account, param, &value);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %s", param, value);
- gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
- g_free (value);
- } else {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %s", param, str);
- mc_account_set_param_string (settings->account, param, str);
- }
-
- return FALSE;
-}
-
-static void
-account_widget_jabber_entry_changed_cb (GtkWidget *widget,
- EmpathyAccountWidgetJabber *settings)
-{
- if (widget == settings->entry_password) {
- const gchar *str;
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- gtk_widget_set_sensitive (settings->button_forget, !G_STR_EMPTY (str));
- }
-}
-
-static void
-account_widget_jabber_checkbutton_toggled_cb (GtkWidget *widget,
- EmpathyAccountWidgetJabber *settings)
-{
- gboolean value;
- gboolean default_value;
- const gchar *param;
-
- value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
- if (widget == settings->checkbutton_ssl) {
- gint port = 0;
-
- mc_account_get_param_int (settings->account, "port", &port);
-
- if (value) {
- if (port == PORT_WITHOUT_SSL || port == 0) {
- port = PORT_WITH_SSL;
- }
- } else {
- if (port == PORT_WITH_SSL || port == 0) {
- port = PORT_WITHOUT_SSL;
- }
- }
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_port), port);
- param = "old-ssl";
- }
- else if (widget == settings->checkbutton_ignore_ssl_errors) {
- param = "ignore-ssl-errors";
- }
- else if (widget == settings->checkbutton_encryption) {
- param = "require-encryption";
- } else {
- return;
- }
-
- /* FIXME: This is ugly! checkbox don't have a "not-set" value so we
- * always unset the param and set the value if different from the
- * default value. */
- mc_account_unset_param (settings->account, param);
- mc_account_get_param_boolean (settings->account, param, &default_value);
-
- if (default_value != value) {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param, value);
- mc_account_set_param_boolean (settings->account, param, value);
- } else {
- empathy_debug (DEBUG_DOMAIN, "Unset %s", param, value);
- }
-}
-
-static void
-account_widget_jabber_value_changed_cb (GtkWidget *spinbutton,
- EmpathyAccountWidgetJabber *settings)
-{
- gdouble value;
- const gchar *param;
-
- value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinbutton));
-
- if (spinbutton == settings->spinbutton_port) {
- param = "port";
- }
- else if (spinbutton == settings->spinbutton_priority) {
- param = "priority";
- } else {
- return;
- }
-
- if (value != 0) {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param, (gint) value);
- mc_account_set_param_int (settings->account, param, (gint) value);
- } else {
- gint val;
-
- mc_account_unset_param (settings->account, param);
- mc_account_get_param_int (settings->account, param, &val);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %d", param, val);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinbutton), val);
- }
-}
-
-static void
-account_widget_jabber_button_forget_clicked_cb (GtkWidget *button,
- EmpathyAccountWidgetJabber *settings)
-{
- empathy_debug (DEBUG_DOMAIN, "Unset password");
- mc_account_unset_param (settings->account, "password");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_password), "");
-}
-
-static void
-account_widget_jabber_destroy_cb (GtkWidget *widget,
- EmpathyAccountWidgetJabber *settings)
-{
- g_object_unref (settings->account);
- g_free (settings);
-}
-
-static void
-account_widget_jabber_setup (EmpathyAccountWidgetJabber *settings)
-{
- gint port = 0;
- gint priority = 0;
- gchar *id = NULL;
- gchar *resource = NULL;
- gchar *server = NULL;
- gchar *password = NULL;
- gboolean old_ssl = FALSE;
- gboolean ignore_ssl_errors = FALSE;
- gboolean encryption = FALSE;
-
- mc_account_get_param_int (settings->account, "port", &port);
- mc_account_get_param_int (settings->account, "priority", &priority);
- mc_account_get_param_string (settings->account, "account", &id);
- mc_account_get_param_string (settings->account, "resource", &resource);
- mc_account_get_param_string (settings->account, "server", &server);
- mc_account_get_param_string (settings->account, "password", &password);
- mc_account_get_param_boolean (settings->account, "old-ssl", &old_ssl);
- mc_account_get_param_boolean (settings->account, "ignore-ssl-errors", &ignore_ssl_errors);
- mc_account_get_param_boolean (settings->account, "require-encryption", &encryption);
-
- if (!id) {
- McProfile *profile;
- const gchar *server;
-
- profile = mc_account_get_profile (settings->account);
- server = mc_profile_get_default_account_domain (profile);
- if (server) {
- id = g_strconcat ("user@", server, NULL);
- }
- g_object_unref (profile);
- }
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_port), port);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_priority), priority);
- gtk_entry_set_text (GTK_ENTRY (settings->entry_id), id ? id : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_resource), resource ? resource : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_server), server ? server : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_password), password ? password : "");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (settings->checkbutton_ssl), old_ssl);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (settings->checkbutton_ignore_ssl_errors), ignore_ssl_errors);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (settings->checkbutton_encryption), encryption);
-
- gtk_widget_set_sensitive (settings->button_forget, !G_STR_EMPTY (password));
-
- g_free (id);
- g_free (resource);
- g_free (server);
- g_free (password);
-}
-
-GtkWidget *
-empathy_account_widget_jabber_new (McAccount *account)
-{
- EmpathyAccountWidgetJabber *settings;
- GladeXML *glade;
- GtkWidget *label_id, *label_password;
- GtkWidget *label_server, *label_resource;
- GtkWidget *label_port, *label_priority;
-
- settings = g_new0 (EmpathyAccountWidgetJabber, 1);
- settings->account = g_object_ref (account);
-
- glade = empathy_glade_get_file ("empathy-account-widget-jabber.glade",
- "vbox_jabber_settings",
- NULL,
- "vbox_jabber_settings", &settings->vbox_settings,
- "button_forget", &settings->button_forget,
- "label_id", &label_id,
- "label_password", &label_password,
- "label_resource", &label_resource,
- "label_priority", &label_priority,
- "label_server", &label_server,
- "label_port", &label_port,
- "entry_id", &settings->entry_id,
- "entry_password", &settings->entry_password,
- "entry_resource", &settings->entry_resource,
- "entry_server", &settings->entry_server,
- "spinbutton_port", &settings->spinbutton_port,
- "spinbutton_priority", &settings->spinbutton_priority,
- "checkbutton_ssl", &settings->checkbutton_ssl,
- "checkbutton_ignore_ssl_errors", &settings->checkbutton_ignore_ssl_errors,
- "checkbutton_encryption", &settings->checkbutton_encryption,
- NULL);
-
- account_widget_jabber_setup (settings);
-
- empathy_glade_connect (glade,
- settings,
- "vbox_jabber_settings", "destroy", account_widget_jabber_destroy_cb,
- "button_forget", "clicked", account_widget_jabber_button_forget_clicked_cb,
- "entry_password", "changed", account_widget_jabber_entry_changed_cb,
- "spinbutton_port", "value-changed", account_widget_jabber_value_changed_cb,
- "spinbutton_priority", "value-changed", account_widget_jabber_value_changed_cb,
- "entry_id", "focus-out-event", account_widget_jabber_entry_focus_cb,
- "entry_password", "focus-out-event", account_widget_jabber_entry_focus_cb,
- "entry_resource", "focus-out-event", account_widget_jabber_entry_focus_cb,
- "entry_server", "focus-out-event", account_widget_jabber_entry_focus_cb,
- "checkbutton_ssl", "toggled", account_widget_jabber_checkbutton_toggled_cb,
- "checkbutton_ignore_ssl_errors", "toggled", account_widget_jabber_checkbutton_toggled_cb,
- "checkbutton_encryption", "toggled", account_widget_jabber_checkbutton_toggled_cb,
- NULL);
-
- g_object_unref (glade);
-
- gtk_widget_show (settings->vbox_settings);
-
- return settings->vbox_settings;
-}
diff --git a/libempathy-gtk/empathy-account-widget-jabber.h b/libempathy-gtk/empathy-account-widget-jabber.h
deleted file mode 100644
index 78020c933..000000000
--- a/libempathy-gtk/empathy-account-widget-jabber.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This library 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.
- *
- * This library 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
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- */
-
-#ifndef __EMPATHY_ACCOUNT_WIDGET_JABBER_H__
-#define __EMPATHY_ACCOUNT_WIDGET_JABBER_H__
-
-#include <libmissioncontrol/mc-account.h>
-
-G_BEGIN_DECLS
-
-GtkWidget *empathy_account_widget_jabber_new (McAccount *account);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_ACCOUNT_WIDGET_JABBER_H__ */
diff --git a/libempathy-gtk/empathy-account-widget-msn.c b/libempathy-gtk/empathy-account-widget-msn.c
deleted file mode 100644
index edcd185ad..000000000
--- a/libempathy-gtk/empathy-account-widget-msn.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This library 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.
- *
- * This library 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
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- * Cosimo Cecchi <anarki@lilik.it>
- */
-
-#include "config.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <glade/glade.h>
-
-#include <libmissioncontrol/mc-profile.h>
-
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-debug.h>
-
-#include "empathy-account-widget-msn.h"
-#include "empathy-ui-utils.h"
-
-#define DEBUG_DOMAIN "AccountWidgetMSN"
-
-typedef struct {
- McAccount *account;
-
- GtkWidget *vbox_settings;
- GtkWidget *button_forget;
- GtkWidget *entry_id;
- GtkWidget *entry_password;
- GtkWidget *entry_server;
- GtkWidget *spinbutton_port;
-} EmpathyAccountWidgetMSN;
-
-static gboolean
-account_widget_msn_entry_focus_cb (GtkWidget *widget,
- GdkEventFocus *event,
- EmpathyAccountWidgetMSN *settings)
-{
- const gchar *param;
- const gchar *str;
-
- if (widget == settings->entry_password) {
- param = "password";
- }
- else if (widget == settings->entry_server) {
- param = "server";
- }
- else if (widget == settings->entry_id) {
- param = "account";
- } else {
- return FALSE;
- }
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- if (G_STR_EMPTY (str)) {
- gchar *value = NULL;
-
- mc_account_unset_param (settings->account, param);
- mc_account_get_param_string (settings->account, param, &value);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %s", param, value);
- gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
- g_free (value);
- } else {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %s", param, str);
- mc_account_set_param_string (settings->account, param, str);
- }
-
- return FALSE;
-}
-
-static void
-account_widget_msn_entry_changed_cb (GtkWidget *widget,
- EmpathyAccountWidgetMSN *settings)
-{
- if (widget == settings->entry_password) {
- const gchar *str;
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- gtk_widget_set_sensitive (settings->button_forget, !G_STR_EMPTY (str));
- }
-}
-
-static void
-account_widget_msn_value_changed_cb (GtkWidget *spinbutton,
- EmpathyAccountWidgetMSN *settings)
-{
- gdouble value;
- const gchar *param;
-
- value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinbutton));
-
- if (spinbutton == settings->spinbutton_port) {
- param = "port";
- } else {
- return;
- }
-
- if (value != 0) {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param, (gint) value);
- mc_account_set_param_int (settings->account, param, (gint) value);
- } else {
- gint val;
-
- mc_account_unset_param (settings->account, param);
- mc_account_get_param_int (settings->account, param, &val);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %d", param, val);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinbutton), val);
- }
-}
-
-static void
-account_widget_msn_button_forget_clicked_cb (GtkWidget *button,
- EmpathyAccountWidgetMSN *settings)
-{
- empathy_debug (DEBUG_DOMAIN, "Unset password");
- mc_account_unset_param (settings->account, "password");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_password), "");
-}
-
-static void
-account_widget_msn_destroy_cb (GtkWidget *widget,
- EmpathyAccountWidgetMSN *settings)
-{
- g_object_unref (settings->account);
- g_free (settings);
-}
-
-static void
-account_widget_msn_setup (EmpathyAccountWidgetMSN *settings)
-{
- guint port = 0;
- gchar *id = NULL;
- gchar *server = NULL;
- gchar *password = NULL;
-
- mc_account_get_param_int (settings->account, "port", &port);
- mc_account_get_param_string (settings->account, "account", &id);
- mc_account_get_param_string (settings->account, "server", &server);
- mc_account_get_param_string (settings->account, "password", &password);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_port), port);
- gtk_entry_set_text (GTK_ENTRY (settings->entry_id), id ? id : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_server), server ? server : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_password), password ? password : "");
-
- gtk_widget_set_sensitive (settings->button_forget, !G_STR_EMPTY (password));
-
- g_free (id);
- g_free (server);
- g_free (password);
-}
-
-GtkWidget *
-empathy_account_widget_msn_new (McAccount *account)
-{
- EmpathyAccountWidgetMSN *settings;
- GladeXML *glade;
-
- settings = g_new0 (EmpathyAccountWidgetMSN, 1);
- settings->account = g_object_ref (account);
-
- glade = empathy_glade_get_file ("empathy-account-widget-msn.glade",
- "vbox_msn_settings",
- NULL,
- "vbox_msn_settings", &settings->vbox_settings,
- "button_forget", &settings->button_forget,
- "entry_id", &settings->entry_id,
- "entry_password", &settings->entry_password,
- "entry_server", &settings->entry_server,
- "spinbutton_port", &settings->spinbutton_port,
- NULL);
-
- account_widget_msn_setup (settings);
-
- empathy_glade_connect (glade,
- settings,
- "vbox_msn_settings", "destroy", account_widget_msn_destroy_cb,
- "button_forget", "clicked", account_widget_msn_button_forget_clicked_cb,
- "entry_id", "changed", account_widget_msn_entry_changed_cb,
- "entry_password", "changed", account_widget_msn_entry_changed_cb,
- "entry_server", "changed", account_widget_msn_entry_changed_cb,
- "entry_id", "focus-out-event", account_widget_msn_entry_focus_cb,
- "entry_password", "focus-out-event", account_widget_msn_entry_focus_cb,
- "entry_server", "focus-out-event", account_widget_msn_entry_focus_cb,
- "spinbutton_port", "value-changed", account_widget_msn_value_changed_cb,
- NULL);
-
- g_object_unref (glade);
-
- gtk_widget_show (settings->vbox_settings);
-
- return settings->vbox_settings;
-}
diff --git a/libempathy-gtk/empathy-account-widget-msn.h b/libempathy-gtk/empathy-account-widget-msn.h
deleted file mode 100644
index a29a1891b..000000000
--- a/libempathy-gtk/empathy-account-widget-msn.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This library 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.
- *
- * This library 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
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- * Cosimo Cecchi <anarki@lilik.it>
- */
-
-#ifndef __EMPATHY_ACCOUNT_WIDGET_MSN_H__
-#define __EMPATHY_ACCOUNT_WIDGET_MSN_H__
-
-#include <libmissioncontrol/mc-account.h>
-
-G_BEGIN_DECLS
-
-GtkWidget *empathy_account_widget_msn_new (McAccount *account);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_ACCOUNT_WIDGET_MSN_H__ */
diff --git a/libempathy-gtk/empathy-account-widget-salut.c b/libempathy-gtk/empathy-account-widget-salut.c
deleted file mode 100644
index 78dce2312..000000000
--- a/libempathy-gtk/empathy-account-widget-salut.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This library 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.
- *
- * This library 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
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- * Cosimo Cecchi <anarki@lilik.it>
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <glade/glade.h>
-
-#include <libmissioncontrol/mc-profile.h>
-
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-debug.h>
-
-#include "empathy-account-widget-salut.h"
-#include "empathy-ui-utils.h"
-
-#define DEBUG_DOMAIN "AccountWidgetMSN"
-
-typedef struct {
- McAccount *account;
-
- GtkWidget *vbox_settings;
- GtkWidget *entry_nickname;
- GtkWidget *entry_published;
- GtkWidget *entry_first_name;
- GtkWidget *entry_last_name;
- GtkWidget *entry_email;
- GtkWidget *entry_jid;
-} EmpathyAccountWidgetSalut;
-
-static gboolean
-account_widget_salut_entry_focus_cb (GtkWidget *widget,
- GdkEventFocus *event,
- EmpathyAccountWidgetSalut *settings)
-{
- const gchar *param;
- const gchar *str;
-
- if (widget == settings->entry_nickname) {
- param = "nickname";
- }
- else if (widget == settings->entry_published) {
- param = "published-name";
- }
- else if (widget == settings->entry_first_name) {
- param = "first-name";
- }
- else if (widget == settings->entry_last_name) {
- param = "last-name";
- }
- else if (widget == settings->entry_email) {
- param = "email";
- }
- else if (widget == settings->entry_jid) {
- param = "jid";
- }
- else {
- return FALSE;
- }
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- if (G_STR_EMPTY (str)) {
- gchar *value = NULL;
-
- mc_account_unset_param (settings->account, param);
- mc_account_get_param_string (settings->account, param, &value);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %s", param, value);
- gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
- g_free (value);
- } else {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %s", param, str);
- mc_account_set_param_string (settings->account, param, str);
- }
-
- return FALSE;
-}
-
-static void
-account_widget_salut_destroy_cb (GtkWidget *widget,
- EmpathyAccountWidgetSalut *settings)
-{
- g_object_unref (settings->account);
- g_free (settings);
-}
-
-static void
-account_widget_salut_setup (EmpathyAccountWidgetSalut *settings)
-{
- gchar *nickname = NULL;
- gchar *published_name = NULL;
- gchar *first_name = NULL;
- gchar *last_name = NULL;
- gchar *email = NULL;
- gchar *jid = NULL;
-
- mc_account_get_param_string (settings->account, "nickname", &nickname);
- mc_account_get_param_string (settings->account, "published-name", &published_name);
- mc_account_get_param_string (settings->account, "first-name", &first_name);
- mc_account_get_param_string (settings->account, "last-name", &last_name);
- mc_account_get_param_string (settings->account, "email", &email);
- mc_account_get_param_string (settings->account, "jid", &jid);
-
- gtk_entry_set_text (GTK_ENTRY (settings->entry_nickname), nickname ? nickname : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_published), published_name ? published_name : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_first_name), first_name ? first_name : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_last_name), last_name ? last_name : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_email), email ? email : "");
- gtk_entry_set_text (GTK_ENTRY (settings->entry_jid), jid ? jid : "");
-
- g_free (nickname);
- g_free (published_name);
- g_free (first_name);
- g_free (last_name);
- g_free (email);
- g_free (jid);
-}
-
-
-GtkWidget *
-empathy_account_widget_salut_new (McAccount *account)
-{
- EmpathyAccountWidgetSalut *settings;
- GladeXML *glade;
-
- settings = g_new0 (EmpathyAccountWidgetSalut, 1);
- settings->account = g_object_ref (account);
-
- glade = empathy_glade_get_file ("empathy-account-widget-salut.glade",
- "vbox_salut_settings",
- NULL,
- "vbox_salut_settings", &settings->vbox_settings,
- "entry_published", &settings->entry_published,
- "entry_nickname", &settings->entry_nickname,
- "entry_first_name", &settings->entry_first_name,
- "entry_last_name", &settings->entry_last_name,
- "entry_email", &settings->entry_email,
- "entry_jid", &settings->entry_jid,
- NULL);
-
- account_widget_salut_setup (settings);
-
- empathy_glade_connect (glade,
- settings,
- "vbox_salut_settings", "destroy", account_widget_salut_destroy_cb,
- "entry_nickname", "focus-out-event", account_widget_salut_entry_focus_cb,
- "entry_published", "focus-out-event", account_widget_salut_entry_focus_cb,
- "entry_first_name", "focus-out-event", account_widget_salut_entry_focus_cb,
- "entry_last_name", "focus-out-event", account_widget_salut_entry_focus_cb,
- "entry_email", "focus-out-event", account_widget_salut_entry_focus_cb,
- "entry_jid", "focus-out-event", account_widget_salut_entry_focus_cb,
- NULL);
-
- g_object_unref (glade);
-
- gtk_widget_show (settings->vbox_settings);
-
- return settings->vbox_settings;
-}
diff --git a/libempathy-gtk/empathy-account-widget-salut.glade b/libempathy-gtk/empathy-account-widget-salut.glade
index 14ede6958..ab725c6ff 100644
--- a/libempathy-gtk/empathy-account-widget-salut.glade
+++ b/libempathy-gtk/empathy-account-widget-salut.glade
@@ -28,7 +28,7 @@
<child>
<widget class="GtkTable" id="table_common_settings">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -93,6 +93,35 @@
</child>
<child>
+ <widget class="GtkLabel" id="label_nickname">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Nickname:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">entry_nickname</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkEntry" id="entry_first_name">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -133,6 +162,28 @@
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkEntry" id="entry_nickname">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
</widget>
<packing>
<property name="padding">0</property>
@@ -151,7 +202,7 @@
<child>
<widget class="GtkTable" id="table_advanced_settings">
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -179,8 +230,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@@ -208,8 +259,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@@ -230,8 +281,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
@@ -251,37 +302,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label_nickname">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Nickname:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry_nickname</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
@@ -308,30 +330,9 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry_nickname">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
@@ -351,8 +352,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
diff --git a/libempathy-gtk/empathy-account-widget-salut.h b/libempathy-gtk/empathy-account-widget-salut.h
deleted file mode 100644
index 0cfe4f8b9..000000000
--- a/libempathy-gtk/empathy-account-widget-salut.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007 Collabora Ltd.
- *
- * This library 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.
- *
- * This library 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
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- * Cosimo Cecchi <anarki@lilik.it>
- */
-
-#ifndef __EMPATHY_ACCOUNT_WIDGET_SALUT_H__
-#define __EMPATHY_ACCOUNT_WIDGET_SALUT_H__
-
-#include <libmissioncontrol/mc-account.h>
-
-G_BEGIN_DECLS
-
-GtkWidget *empathy_account_widget_salut_new (McAccount *account);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_ACCOUNT_WIDGET_SALUT_H__ */
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
new file mode 100644
index 000000000..aed38ff0f
--- /dev/null
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -0,0 +1,589 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006-2007 Imendio AB
+ * Copyright (C) 2007 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors: Xavier Claessens <xclaesse@gmail.com>
+ * Martyn Russell <martyn@imendio.com>
+ */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <libmissioncontrol/mc-account.h>
+#include <libmissioncontrol/mc-protocol.h>
+
+#include <libempathy/empathy-debug.h>
+
+#include "empathy-account-widget.h"
+#include "empathy-ui-utils.h"
+
+#define DEBUG_DOMAIN "AccountWidget"
+
+static gboolean
+account_widget_entry_focus_cb (GtkWidget *widget,
+ GdkEventFocus *event,
+ McAccount *account)
+{
+ const gchar *str;
+ const gchar *param_name;
+
+ str = gtk_entry_get_text (GTK_ENTRY (widget));
+ param_name = g_object_get_data (G_OBJECT (widget), "param_name");
+
+ if (G_STR_EMPTY (str)) {
+ gchar *value = NULL;
+
+ mc_account_unset_param (account, param_name);
+ mc_account_get_param_string (account, param_name, &value);
+ empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %s", param_name, value);
+ gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
+ g_free (value);
+ } else {
+ empathy_debug (DEBUG_DOMAIN, "Setting %s to %s", param_name, str);
+ mc_account_set_param_string (account, param_name, str);
+ }
+
+ return FALSE;
+}
+
+static void
+account_widget_int_changed_cb (GtkWidget *widget,
+ McAccount *account)
+{
+ const gchar *param_name;
+ gint value;
+
+ value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (widget));
+ param_name = g_object_get_data (G_OBJECT (widget), "param_name");
+
+ if (value == 0) {
+ gint val;
+
+ mc_account_unset_param (account, param_name);
+ mc_account_get_param_int (account, param_name, &val);
+ empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %d", param_name, val);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), val);
+ } else {
+ empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param_name, (gint) value);
+ mc_account_set_param_int (account, param_name, (gint) value);
+ }
+}
+
+static void
+account_widget_checkbutton_toggled_cb (GtkWidget *widget,
+ McAccount *account)
+{
+ gboolean value;
+ gboolean default_value;
+ const gchar *param_name;
+
+ value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+ param_name = g_object_get_data (G_OBJECT (widget), "param_name");
+
+ /* FIXME: This is ugly! checkbox don't have a "not-set" value so we
+ * always unset the param and set the value if different from the
+ * default value. */
+ mc_account_unset_param (account, param_name);
+ mc_account_get_param_boolean (account, param_name, &default_value);
+
+ if (default_value == value) {
+ empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %d", param_name, default_value);
+ } else {
+ empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param_name, value);
+ mc_account_set_param_boolean (account, param_name, value);
+ }
+}
+
+static void
+account_widget_forget_clicked_cb (GtkWidget *button,
+ GtkWidget *entry)
+{
+ McAccount *account;
+ const gchar *param_name;
+
+ param_name = g_object_get_data (G_OBJECT (entry), "param_name");
+ account = g_object_get_data (G_OBJECT (entry), "account");
+
+ empathy_debug (DEBUG_DOMAIN, "Unset %s", param_name);
+ mc_account_unset_param (account, param_name);
+ gtk_entry_set_text (GTK_ENTRY (entry), "");
+}
+
+static void
+account_widget_password_changed_cb (GtkWidget *entry,
+ GtkWidget *button)
+{
+ const gchar *str;
+
+ str = gtk_entry_get_text (GTK_ENTRY (entry));
+ gtk_widget_set_sensitive (button, !G_STR_EMPTY (str));
+}
+
+static void
+account_widget_jabber_ssl_toggled_cb (GtkWidget *checkbutton_ssl,
+ GtkWidget *spinbutton_port)
+{
+ McAccount *account;
+ gboolean value;
+ gint port = 0;
+
+ value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton_ssl));
+ account = g_object_get_data (G_OBJECT (spinbutton_port), "account");
+ mc_account_get_param_int (account, "port", &port);
+
+ if (value) {
+ if (port == 5222 || port == 0) {
+ port = 5223;
+ }
+ } else {
+ if (port == 5223 || port == 0) {
+ port = 5222;
+ }
+ }
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinbutton_port), port);
+}
+
+static void
+account_widget_destroy_cb (GtkWidget *widget,
+ McAccount *account)
+{
+ empathy_debug (DEBUG_DOMAIN, "destroyed!");
+ g_object_unref (account);
+}
+
+static void
+account_widget_setup_widget (GtkWidget *widget,
+ McAccount *account,
+ const gchar *param_name)
+{
+ g_object_set_data_full (G_OBJECT (widget), "param_name",
+ g_strdup (param_name), g_free);
+
+ if (GTK_IS_SPIN_BUTTON (widget)) {
+ gint value = 0;
+
+ mc_account_get_param_int (account, param_name, &value);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value);
+
+ g_signal_connect (widget, "value-changed",
+ G_CALLBACK (account_widget_int_changed_cb),
+ account);
+ }
+ else if (GTK_IS_ENTRY (widget)) {
+ gchar *str = NULL;
+
+ mc_account_get_param_string (account, param_name, &str);
+ gtk_entry_set_text (GTK_ENTRY (widget), str ? str : "");
+ g_free (str);
+
+ if (strstr (param_name, "password")) {
+ gtk_entry_set_visibility (GTK_ENTRY (widget), FALSE);
+ }
+
+ g_signal_connect (widget, "focus-out-event",
+ G_CALLBACK (account_widget_entry_focus_cb),
+ account);
+ }
+ else if (GTK_IS_TOGGLE_BUTTON (widget)) {
+ gboolean value = FALSE;
+
+ mc_account_get_param_boolean (account, param_name, &value);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
+
+ g_signal_connect (widget, "toggled",
+ G_CALLBACK (account_widget_checkbutton_toggled_cb),
+ account);
+ } else {
+ empathy_debug (DEBUG_DOMAIN,
+ "Unknown type of widget for param %s",
+ param_name);
+ }
+}
+
+static gchar *
+account_widget_generic_format_param_name (const gchar *param_name)
+{
+ gchar *str;
+ gchar *p;
+
+ str = g_strdup (param_name);
+
+ if (str && g_ascii_isalpha (str[0])) {
+ str[0] = g_ascii_toupper (str[0]);
+ }
+
+ while ((p = strchr (str, '-')) != NULL) {
+ if (p[1] != '\0' && g_ascii_isalpha (p[1])) {
+ p[0] = ' ';
+ p[1] = g_ascii_toupper (p[1]);
+ }
+
+ p++;
+ }
+
+ return str;
+}
+
+static void
+accounts_widget_generic_setup (McAccount *account,
+ GtkWidget *table_settings)
+{
+ McProtocol *protocol;
+ McProfile *profile;
+ GSList *params, *l;
+ guint n_rows = 0;
+
+ profile = mc_account_get_profile (account);
+ protocol = mc_profile_get_protocol (profile);
+
+ if (!protocol) {
+ /* The CM is not installed, MC shouldn't list them
+ * see SF bug #1688779
+ * FIXME: We should display something asking the user to
+ * install the CM
+ */
+ g_object_unref (profile);
+ return;
+ }
+
+ params = mc_protocol_get_params (protocol);
+
+ for (l = params; l; l = l->next) {
+ McProtocolParam *param;
+ GtkWidget *widget = NULL;
+ gchar *param_name_formatted;
+
+ param = l->data;
+ param_name_formatted = account_widget_generic_format_param_name (param->name);
+ gtk_table_resize (GTK_TABLE (table_settings), ++n_rows, 2);
+
+ if (param->signature[0] == 's') {
+ gchar *str;
+
+ str = g_strdup_printf (_("%s:"), param_name_formatted);
+ widget = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
+ g_free (str);
+
+ gtk_table_attach (GTK_TABLE (table_settings),
+ widget,
+ 0, 1,
+ n_rows - 1, n_rows,
+ GTK_FILL, 0,
+ 0, 0);
+
+ widget = gtk_entry_new ();
+ gtk_table_attach (GTK_TABLE (table_settings),
+ widget,
+ 1, 2,
+ n_rows - 1, n_rows,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ }
+ /* int types: ynqiuxt. double type is 'd' */
+ else if (param->signature[0] == 'y' ||
+ param->signature[0] == 'n' ||
+ param->signature[0] == 'q' ||
+ param->signature[0] == 'i' ||
+ param->signature[0] == 'u' ||
+ param->signature[0] == 'x' ||
+ param->signature[0] == 't' ||
+ param->signature[0] == 'd') {
+ gchar *str = NULL;
+ gdouble minint = 0;
+ gdouble maxint = 0;
+ gdouble step = 1;
+
+ switch (param->signature[0]) {
+ case 'y': minint = G_MININT8; maxint = G_MAXINT8; break;
+ case 'n': minint = G_MININT16; maxint = G_MAXINT16; break;
+ case 'q': minint = 0; maxint = G_MAXUINT16; break;
+ case 'i': minint = G_MININT32; maxint = G_MAXINT32; break;
+ case 'u': minint = 0; maxint = G_MAXUINT32; break;
+ case 'x': minint = G_MININT64; maxint = G_MAXINT64; break;
+ case 't': minint = 0; maxint = G_MAXUINT64; break;
+ case 'd': minint = G_MININT32; maxint = G_MAXINT32; step = 0.1; break;
+ }
+
+ str = g_strdup_printf (_("%s:"), param_name_formatted);
+ widget = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
+ g_free (str);
+
+ gtk_table_attach (GTK_TABLE (table_settings),
+ widget,
+ 0, 1,
+ n_rows - 1, n_rows,
+ GTK_FILL, 0,
+ 0, 0);
+
+ widget = gtk_spin_button_new_with_range (minint, maxint, step);
+ gtk_table_attach (GTK_TABLE (table_settings),
+ widget,
+ 1, 2,
+ n_rows - 1, n_rows,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ }
+ else if (param->signature[0] == 'b') {
+ widget = gtk_check_button_new_with_label (param_name_formatted);
+ gtk_table_attach (GTK_TABLE (table_settings),
+ widget,
+ 0, 2,
+ n_rows - 1, n_rows,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ } else {
+ empathy_debug (DEBUG_DOMAIN,
+ "Unknown signature for param %s: %s",
+ param_name_formatted, param->signature);
+ }
+
+ if (widget) {
+ account_widget_setup_widget (widget, account, param->name);
+ }
+
+ g_free (param_name_formatted);
+ }
+
+ g_slist_free (params);
+ g_object_unref (profile);
+ g_object_unref (protocol);
+}
+
+static GtkWidget *
+account_widget_new_valist (McAccount *account,
+ GladeXML *gui,
+ const gchar *root,
+ const gchar *first_widget_name,
+ va_list args)
+{
+ GtkWidget *widget;
+ const gchar *widget_name;
+
+ for (widget_name = first_widget_name; widget_name; widget_name = va_arg (args, gchar*)) {
+ const gchar *param_name;
+
+ param_name = va_arg (args, gchar*);
+
+ widget = glade_xml_get_widget (gui, widget_name);
+
+ if (!widget) {
+ g_warning ("Glade is missing widget '%s'.", widget_name);
+ continue;
+ }
+
+ account_widget_setup_widget (widget, account, param_name);
+ }
+
+ widget = glade_xml_get_widget (gui, root);
+ g_signal_connect (widget, "destroy",
+ G_CALLBACK (account_widget_destroy_cb),
+ g_object_ref (account));
+
+ return widget;
+}
+
+GtkWidget *
+empathy_account_widget_new_with_glade (McAccount *account,
+ GladeXML *gui,
+ const gchar *root,
+ const gchar *first_widget_name,
+ ...)
+{
+ GtkWidget *widget;
+ va_list args;
+
+ g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
+
+ va_start (args, first_widget_name);
+ widget = account_widget_new_valist (account, gui, root,
+ first_widget_name,
+ args);
+ va_end (args);
+
+ return widget;
+}
+
+void
+emapthy_account_widget_add_forget_button (McAccount *account,
+ GladeXML *glade,
+ const gchar *button,
+ const gchar *entry)
+{
+ GtkWidget *button_forget;
+ GtkWidget *entry_password;
+ gchar *password = NULL;
+
+ button_forget = glade_xml_get_widget (glade, button);
+ entry_password = glade_xml_get_widget (glade, entry);
+
+ mc_account_get_param_string (account, "password", &password);
+ gtk_widget_set_sensitive (button_forget, !G_STR_EMPTY (password));
+ g_free (password);
+
+ g_signal_connect (button_forget, "clicked",
+ G_CALLBACK (account_widget_forget_clicked_cb),
+ entry_password);
+ g_signal_connect (entry_password, "changed",
+ G_CALLBACK (account_widget_password_changed_cb),
+ button_forget);
+
+ g_object_set_data_full (G_OBJECT (entry_password), "account",
+ g_object_ref (account),
+ g_object_unref);
+}
+
+GtkWidget *
+empathy_account_widget_generic_new (McAccount *account)
+{
+ GtkWidget *table_settings;
+ GtkWidget *sw;
+
+ g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
+
+ table_settings = gtk_table_new (0, 2, FALSE);
+ gtk_table_set_row_spacings (GTK_TABLE (table_settings), 6);
+ gtk_table_set_col_spacings (GTK_TABLE (table_settings), 6);
+ sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw),
+ table_settings);
+
+ accounts_widget_generic_setup (account, table_settings);
+
+ g_signal_connect (sw, "destroy",
+ G_CALLBACK (account_widget_destroy_cb),
+ g_object_ref (account));
+
+ gtk_widget_show_all (sw);
+
+ return sw;
+}
+
+GtkWidget *
+empathy_account_widget_salut_new (McAccount *account)
+{
+ GladeXML *glade;
+ GtkWidget *widget;
+
+ glade = empathy_glade_get ("empathy-account-widget-salut.glade",
+ "vbox_salut_settings",
+ NULL);
+
+ widget = empathy_account_widget_new_with_glade (account, glade,
+ "vbox_salut_settings",
+ "entry_published", "published-name",
+ "entry_nickname", "nickname",
+ "entry_first_name", "first-name",
+ "entry_last_name", "last-name",
+ "entry_email", "email",
+ "entry_jid", "jid",
+ NULL);
+
+ g_object_unref (glade);
+
+ gtk_widget_show (widget);
+
+ return widget;
+}
+
+GtkWidget *
+empathy_account_widget_msn_new (McAccount *account)
+{
+ GladeXML *glade;
+ GtkWidget *widget;
+
+ glade = empathy_glade_get ("empathy-account-widget-msn.glade",
+ "vbox_msn_settings",
+ NULL);
+
+ widget = empathy_account_widget_new_with_glade (account, glade,
+ "vbox_msn_settings",
+ "entry_id", "account",
+ "entry_password", "password",
+ "entry_server", "server",
+ "spinbutton_port", "port",
+ NULL);
+
+ emapthy_account_widget_add_forget_button (account, glade,
+ "button_forget",
+ "entry_password");
+
+ g_object_unref (glade);
+
+ gtk_widget_show (widget);
+
+ return widget;
+}
+
+GtkWidget *
+empathy_account_widget_jabber_new (McAccount *account)
+{
+ GladeXML *glade;
+ GtkWidget *widget;
+ GtkWidget *spinbutton_port;
+ GtkWidget *checkbutton_ssl;
+
+ glade = empathy_glade_get_file ("empathy-account-widget-jabber.glade",
+ "vbox_jabber_settings",
+ NULL,
+ "spinbutton_port", &spinbutton_port,
+ "checkbutton_ssl", &checkbutton_ssl,
+ NULL);
+
+ widget = empathy_account_widget_new_with_glade (account, glade,
+ "vbox_jabber_settings",
+ "entry_id", "account",
+ "entry_password", "password",
+ "entry_resource", "resource",
+ "entry_server", "server",
+ "spinbutton_port", "port",
+ "spinbutton_priority", "priority",
+ "checkbutton_ssl", "old-ssl",
+ "checkbutton_ignore_ssl_errors", "ignore-ssl-errors",
+ "checkbutton_encryption", "require-encryption",
+ NULL);
+
+ emapthy_account_widget_add_forget_button (account, glade,
+ "button_forget",
+ "entry_password");
+
+ g_signal_connect (checkbutton_ssl, "toggled",
+ G_CALLBACK (account_widget_jabber_ssl_toggled_cb),
+ spinbutton_port);
+
+ g_object_set_data_full (G_OBJECT (spinbutton_port), "account",
+ g_object_ref (account),
+ g_object_unref);
+
+ g_object_unref (glade);
+
+ gtk_widget_show (widget);
+
+ return widget;
+}
+
diff --git a/libempathy-gtk/empathy-account-widget-generic.h b/libempathy-gtk/empathy-account-widget.h
index 406e0a78d..191997ece 100644
--- a/libempathy-gtk/empathy-account-widget-generic.h
+++ b/libempathy-gtk/empathy-account-widget.h
@@ -26,12 +26,25 @@
#define __EMPATHY_ACCOUNT_WIDGET_GENERIC_H__
#include <gtk/gtk.h>
+#include <glade/glade.h>
#include <libmissioncontrol/mc-account.h>
G_BEGIN_DECLS
-GtkWidget *empathy_account_widget_generic_new (McAccount *account);
+GtkWidget *empathy_account_widget_new_with_glade (McAccount *account,
+ GladeXML *glade,
+ const gchar *root,
+ const gchar *first_widget_name,
+ ...);
+void emapthy_account_widget_add_forget_button (McAccount *account,
+ GladeXML *glade,
+ const gchar *button,
+ const gchar *entry);
+GtkWidget *empathy_account_widget_generic_new (McAccount *account);
+GtkWidget *empathy_account_widget_salut_new (McAccount *account);
+GtkWidget *empathy_account_widget_msn_new (McAccount *account);
+GtkWidget *empathy_account_widget_jabber_new (McAccount *account);
G_END_DECLS
diff --git a/libempathy-gtk/empathy-accounts-dialog.c b/libempathy-gtk/empathy-accounts-dialog.c
index d614b827a..832063371 100644
--- a/libempathy-gtk/empathy-accounts-dialog.c
+++ b/libempathy-gtk/empathy-accounts-dialog.c
@@ -45,10 +45,7 @@
#include "empathy-accounts-dialog.h"
#include "empathy-profile-chooser.h"
-#include "empathy-account-widget-generic.h"
-#include "empathy-account-widget-jabber.h"
-#include "empathy-account-widget-msn.h"
-#include "empathy-account-widget-salut.h"
+#include "empathy-account-widget.h"
#include "empathy-account-widget-irc.h"
#define DEBUG_DOMAIN "AccountDialog"
@@ -400,18 +397,24 @@ accounts_dialog_model_add_columns (EmpathyAccountsDialog *dialog)
view = GTK_TREE_VIEW (dialog->treeview);
gtk_tree_view_set_headers_visible (view, TRUE);
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, _("Accounts"));
-
- /* Enabled */
+ /* Enabled column */
cell = gtk_cell_renderer_toggle_new ();
- gtk_tree_view_column_pack_start (column, cell, FALSE);
- gtk_tree_view_column_add_attribute (column, cell, "active", COL_ENABLED);
+ gtk_tree_view_insert_column_with_attributes (view, -1,
+ _("Enabled"),
+ cell,
+ "active", COL_ENABLED,
+ NULL);
g_signal_connect (cell, "toggled",
G_CALLBACK (accounts_dialog_enable_toggled_cb),
dialog);
+
+ /* Account column */
+ column = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title (column, _("Accounts"));
+ gtk_tree_view_column_set_expand (column, TRUE);
+ gtk_tree_view_append_column (view, column);
- /* Icon */
+ /* Icon renderer */
cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_cell_data_func (column, cell,
@@ -420,7 +423,7 @@ accounts_dialog_model_add_columns (EmpathyAccountsDialog *dialog)
dialog,
NULL);
- /* Name */
+ /* Name renderer */
cell = gtk_cell_renderer_text_new ();
g_object_set (cell,
"ellipsize", PANGO_ELLIPSIZE_END,
@@ -431,9 +434,6 @@ accounts_dialog_model_add_columns (EmpathyAccountsDialog *dialog)
g_signal_connect (cell, "edited",
G_CALLBACK (accounts_dialog_name_edited_cb),
dialog);
-
- gtk_tree_view_column_set_expand (column, TRUE);
- gtk_tree_view_append_column (view, column);
}
static void
diff --git a/libempathy-gtk/empathy-accounts-dialog.glade b/libempathy-gtk/empathy-accounts-dialog.glade
index d9c045af1..ef7864497 100644
--- a/libempathy-gtk/empathy-accounts-dialog.glade
+++ b/libempathy-gtk/empathy-accounts-dialog.glade
@@ -1,581 +1,350 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
<glade-interface>
-
-<widget class="GtkDialog" id="accounts_dialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Accounts</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button_close">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox146">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox195">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow17">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="treeview">
- <property name="height_request">200</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">False</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox148">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button_add">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button_remove">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox214">
- <property name="width_request">415</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox_details">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkHBox" id="hbox183">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label_name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">&lt;big&gt;&lt;b&gt;Gmail&lt;/b&gt;&lt;/big&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkImage" id="image_type">
- <property name="visible">True</property>
- <property name="stock">gtk-cut</property>
- <property name="icon_size">6</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment_settings">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">6</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">20</property>
- <property name="right_padding">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label599">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Settings&lt;/b&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame_new_account">
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment29">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">6</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">20</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkVBox" id="vbox216">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkHBox" id="hbox_type">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label645">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Type:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox181">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button_create">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-new</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cr_eate</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button_back">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-go-back</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label643">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;New Account&lt;/b&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame_no_account">
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment21">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">6</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkLabel" id="label_no_account_blurb">
- <property name="visible">True</property>
- <property name="label" translatable="yes">To add a new account, you can click on the 'Add' button and a new entry will be created for you to started configuring.
+ <widget class="GtkDialog" id="accounts_dialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Accounts</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkHBox" id="hbox146">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="spacing">18</property>
+ <child>
+ <widget class="GtkVBox" id="vbox195">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow17">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTreeView" id="treeview">
+ <property name="width_request">250</property>
+ <property name="height_request">200</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="enable_search">False</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox148">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkButton" id="button_add">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_remove">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox214">
+ <property name="width_request">415</property>
+ <property name="visible">True</property>
+ <property name="spacing">18</property>
+ <child>
+ <widget class="GtkVBox" id="vbox_details">
+ <property name="visible">True</property>
+ <property name="spacing">18</property>
+ <child>
+ <widget class="GtkHBox" id="hbox183">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label_name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">&lt;big&gt;&lt;b&gt;Gmail&lt;/b&gt;&lt;/big&gt;</property>
+ <property name="use_markup">True</property>
+ <property name="selectable">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImage" id="image_type">
+ <property name="visible">True</property>
+ <property name="yalign">0</property>
+ <property name="stock">gtk-cut</property>
+ <property name="icon_size">6</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment_settings">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">20</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label599">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Settings&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame_new_account">
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment29">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">20</property>
+ <child>
+ <widget class="GtkVBox" id="vbox216">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkHBox" id="hbox_type">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label645">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Type:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox181">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkButton" id="button_back">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-go-back</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_create">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="response_id">0</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-new</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Cr_eate</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label643">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;New Account&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame_no_account">
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment21">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkLabel" id="label_no_account_blurb">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">To add a new account, you can click on the 'Add' button and a new entry will be created for you to started configuring.
If you do not want to add an account, simply click on the account you want to configure in the list on the left.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label_no_account">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;No Account Selected&lt;/b&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label_no_account">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;No Account Selected&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="button_close">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
diff --git a/libempathy-gtk/empathy-chat-window.c b/libempathy-gtk/empathy-chat-window.c
index 444616039..a30265edc 100644
--- a/libempathy-gtk/empathy-chat-window.c
+++ b/libempathy-gtk/empathy-chat-window.c
@@ -873,7 +873,7 @@ chat_window_call_activate_cb (GtkWidget *menuitem,
chat = EMPATHY_PRIVATE_CHAT (priv->current_chat);
contact = empathy_private_chat_get_contact (chat);
- empathy_call_contact (contact);
+ empathy_call_with_contact (contact);
}
}
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index fbdf6df44..f7c013820 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -40,7 +40,6 @@
#include <libempathy/empathy-log-manager.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-marshal.h>
#include "empathy-chat.h"
#include "empathy-chat-window.h"
@@ -50,6 +49,7 @@
#include "empathy-spell.h"
#include "empathy-spell-dialog.h"
#include "empathy-ui-utils.h"
+#include "empathy-gtk-marshal.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT, EmpathyChatPriv))
@@ -112,10 +112,10 @@ static void chat_send_error_cb (EmpathyTpChat
EmpathyMessage *message,
TpChannelTextSendError error_code,
EmpathyChat *chat);
-void chat_sent_message_add (EmpathyChat *chat,
+static void chat_sent_message_add (EmpathyChat *chat,
const gchar *str);
-const gchar * chat_sent_message_get_next (EmpathyChat *chat);
-const gchar * chat_sent_message_get_last (EmpathyChat *chat);
+static const gchar * chat_sent_message_get_next (EmpathyChat *chat);
+static const gchar * chat_sent_message_get_last (EmpathyChat *chat);
static gboolean chat_input_key_press_event_cb (GtkWidget *widget,
GdkEventKey *event,
EmpathyChat *chat);
@@ -279,7 +279,7 @@ empathy_chat_class_init (EmpathyChatClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- empathy_marshal_VOID__OBJECT_BOOLEAN,
+ _empathy_gtk_marshal_VOID__OBJECT_BOOLEAN,
G_TYPE_NONE,
2, EMPATHY_TYPE_MESSAGE, G_TYPE_BOOLEAN);
@@ -579,7 +579,7 @@ chat_send_error_cb (EmpathyTpChat *tp_chat,
g_free (str);
}
-void
+static void
chat_sent_message_add (EmpathyChat *chat,
const gchar *str)
{
@@ -617,7 +617,7 @@ chat_sent_message_add (EmpathyChat *chat,
priv->sent_messages_index = -1;
}
-const gchar *
+static const gchar *
chat_sent_message_get_next (EmpathyChat *chat)
{
EmpathyChatPriv *priv;
@@ -644,7 +644,7 @@ chat_sent_message_get_next (EmpathyChat *chat)
return g_slist_nth_data (priv->sent_messages, priv->sent_messages_index);
}
-const gchar *
+static const gchar *
chat_sent_message_get_last (EmpathyChat *chat)
{
EmpathyChatPriv *priv;
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 78ac3980c..ad8191398 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -43,7 +43,6 @@
#include <libempathy/empathy-contact-groups.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-marshal.h>
#include "empathy-contact-list-view.h"
#include "empathy-contact-list-store.h"
@@ -57,6 +56,7 @@
//#include "empathy-ft-window.h"
#include "empathy-log-window.h"
#include "empathy-gtk-enum-types.h"
+#include "empathy-gtk-marshal.h"
#define DEBUG_DOMAIN "ContactListView"
@@ -322,7 +322,7 @@ empathy_contact_list_view_class_init (EmpathyContactListViewClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- empathy_marshal_VOID__OBJECT_STRING_STRING,
+ _empathy_gtk_marshal_VOID__OBJECT_STRING_STRING,
G_TYPE_NONE,
3, EMPATHY_TYPE_CONTACT, G_TYPE_STRING, G_TYPE_STRING);
@@ -1497,6 +1497,6 @@ static void
contact_list_view_voip_activated (EmpathyContactListView *view,
EmpathyContact *contact)
{
- empathy_call_contact (contact);
+ empathy_call_with_contact (contact);
}
diff --git a/libempathy-gtk/empathy-main-window.glade b/libempathy-gtk/empathy-main-window.glade
index c997f38cd..02f69a38d 100644
--- a/libempathy-gtk/empathy-main-window.glade
+++ b/libempathy-gtk/empathy-main-window.glade
@@ -1,427 +1,310 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
<glade-interface>
-
-<widget class="GtkWindow" id="main_window">
- <property name="title" translatable="yes">Contact List</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">225</property>
- <property name="default_height">325</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkVBox" id="main_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkMenuBar" id="menubar2">
- <property name="visible">True</property>
- <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
- <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
-
- <child>
- <widget class="GtkMenuItem" id="chat">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Chat</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="chat_menu">
-
- <child>
- <widget class="GtkImageMenuItem" id="chat_new_message">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_New Message...</property>
- <property name="use_underline">True</property>
- <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image885">
- <property name="visible">True</property>
- <property name="icon_size">1</property>
- <property name="icon_name">im-message-new</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="chat_history">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_View Previous Conversations</property>
- <property name="use_underline">True</property>
- <accelerator key="F3" modifiers="0" signal="activate"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image886">
- <property name="visible">True</property>
- <property name="icon_name">document-open-recent</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator5">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="chat_add_contact">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Add Contact...</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image887">
- <property name="visible">True</property>
- <property name="stock">gtk-add</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator3">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkCheckMenuItem" id="chat_show_offline">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show _Offline Contacts</property>
- <property name="use_underline">True</property>
- <property name="active">False</property>
- <accelerator key="H" modifiers="GDK_CONTROL_MASK" signal="activate"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator6">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="chat_quit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Quit</property>
- <property name="use_underline">True</property>
- <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image888">
- <property name="visible">True</property>
- <property name="stock">gtk-quit</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="edit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="edit_menu">
-
- <child>
- <widget class="GtkMenuItem" id="edit_context">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Context</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="edit_context_separator">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="edit_accounts">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Accounts</property>
- <property name="use_underline">True</property>
- <accelerator key="F4" modifiers="0" signal="activate"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="edit_personal_information">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Personal Information</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image894">
- <property name="visible">True</property>
- <property name="icon_name">user-info</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator2">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="edit_preferences">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Preferences</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image891">
- <property name="visible">True</property>
- <property name="stock">gtk-preferences</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="room">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Room</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="room_menu">
-
- <child>
- <widget class="GtkMenuItem" id="room_join_new">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Join _New...</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="room_join_favorites">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Join _Favorites</property>
- <property name="use_underline">True</property>
- <accelerator key="F5" modifiers="0" signal="activate"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="room_sep">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="room_sep2">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="room_manage_favorites">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Manage Favorites</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image890">
- <property name="visible">True</property>
- <property name="icon_size">1</property>
- <property name="icon_name">system-users</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="help">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="help_menu">
-
- <child>
- <widget class="GtkImageMenuItem" id="help_contents">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Contents</property>
- <property name="use_underline">True</property>
- <accelerator key="F1" modifiers="0" signal="activate"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image892">
- <property name="visible">True</property>
- <property name="stock">gtk-help</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="help_about">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_About</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image893">
- <property name="visible">True</property>
- <property name="stock">gtk-about</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkToolbar" id="presence_toolbar">
- <property name="visible">True</property>
- <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
- <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
- <property name="tooltips">True</property>
- <property name="show_arrow">True</property>
-
- <child>
- <placeholder/>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="errors_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="roster_scrolledwindow">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
+ <widget class="GtkWindow" id="main_window">
+ <property name="title" translatable="yes">Contact List</property>
+ <property name="default_width">225</property>
+ <property name="default_height">325</property>
+ <child>
+ <widget class="GtkVBox" id="main_vbox">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkMenuBar" id="menubar2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkMenuItem" id="chat">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Chat</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="chat_menu">
+ <child>
+ <widget class="GtkImageMenuItem" id="chat_new_message">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_New Conversation...</property>
+ <property name="use_underline">True</property>
+ <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image885">
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ <property name="icon_name">im-message-new</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="chat_history">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_View Previous Conversations</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F3" modifiers="" signal="activate"/>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image886">
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ <property name="icon_name">document-open-recent</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator5">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="chat_add_contact">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Add Contact...</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image887">
+ <property name="visible">True</property>
+ <property name="stock">gtk-add</property>
+ <property name="icon_size">1</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator3">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkCheckMenuItem" id="chat_show_offline">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show _Offline Contacts</property>
+ <property name="use_underline">True</property>
+ <accelerator key="H" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator6">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="chat_quit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Quit</property>
+ <property name="use_underline">True</property>
+ <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image888">
+ <property name="visible">True</property>
+ <property name="stock">gtk-quit</property>
+ <property name="icon_size">1</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="edit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="edit_menu">
+ <child>
+ <widget class="GtkMenuItem" id="edit_context">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Context</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="edit_context_separator">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="edit_accounts">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Accounts</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F4" modifiers="" signal="activate"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="edit_personal_information">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Personal Information</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image894">
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ <property name="icon_name">user-info</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator2">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="edit_preferences">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Preferences</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image891">
+ <property name="visible">True</property>
+ <property name="stock">gtk-preferences</property>
+ <property name="icon_size">1</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="room">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Room</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="room_menu">
+ <child>
+ <widget class="GtkMenuItem" id="room_join_new">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Join _New...</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="room_join_favorites">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Join _Favorites</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F5" modifiers="" signal="activate"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="room_sep">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="room_sep2">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="room_manage_favorites">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Manage Favorites</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image890">
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ <property name="icon_name">system-users</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="help">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="help_menu">
+ <child>
+ <widget class="GtkImageMenuItem" id="help_contents">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Contents</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F1" modifiers="" signal="activate"/>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image892">
+ <property name="visible">True</property>
+ <property name="stock">gtk-help</property>
+ <property name="icon_size">1</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="help_about">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_About</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image893">
+ <property name="visible">True</property>
+ <property name="stock">gtk-about</property>
+ <property name="icon_size">1</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolbar" id="presence_toolbar">
+ <property name="visible">True</property>
+ <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="errors_vbox">
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="roster_scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c
index 80e3b611c..0213b0676 100644
--- a/libempathy-gtk/empathy-new-message-dialog.c
+++ b/libempathy-gtk/empathy-new-message-dialog.c
@@ -47,8 +47,8 @@ typedef struct {
GtkWidget *table_contact;
GtkWidget *account_chooser;
GtkWidget *entry_id;
- GtkWidget *button_validate;
- GtkWidget *button_voip;
+ GtkWidget *button_chat;
+ GtkWidget *button_call;
} EmpathyNewMessageDialog;
static void
@@ -69,27 +69,11 @@ new_message_dialog_response_cb (GtkWidget *widget,
return;
}
- if (response == GTK_RESPONSE_OK) {
- empathy_chat_with_contact_id (account, id);
+ if (response == 1) {
+ empathy_call_with_contact_id (account, id);
}
- else if (response == 3) {
- EmpathyContactFactory *factory;
- EmpathyContact *contact = NULL;
-
- factory = empathy_contact_factory_new ();
- contact = empathy_contact_factory_get_from_id (factory,
- account,
- id);
- if (contact) {
- empathy_call_contact (contact);
- } else {
- empathy_debug (DEBUG_DOMAIN,
- "Contact ID %s does not exists",
- id);
- }
-
- g_object_unref (contact);
- g_object_unref (factory);
+ else if (response == 2) {
+ empathy_chat_with_contact_id (account, id);
}
g_object_unref (account);
@@ -106,8 +90,8 @@ new_message_change_state_button_cb (GtkEditable *editable,
id = gtk_entry_get_text (GTK_ENTRY (editable));
sensitive = !G_STR_EMPTY (id);
- gtk_widget_set_sensitive(dialog->button_validate, sensitive);
- gtk_widget_set_sensitive(dialog->button_voip, sensitive);
+ gtk_widget_set_sensitive (dialog->button_chat, sensitive);
+ gtk_widget_set_sensitive (dialog->button_call, sensitive);
}
static void
@@ -131,21 +115,21 @@ empathy_new_message_dialog_show (GtkWindow *parent)
dialog = g_new0 (EmpathyNewMessageDialog, 1);
glade = empathy_glade_get_file ("empathy-new-message-dialog.glade",
- "new_message_dialog",
- NULL,
- "new_message_dialog", &dialog->dialog,
- "table_contact", &dialog->table_contact,
- "entry_id", &dialog->entry_id,
- "button_validate", &dialog->button_validate,
- "button_voip",&dialog->button_voip,
- NULL);
+ "new_message_dialog",
+ NULL,
+ "new_message_dialog", &dialog->dialog,
+ "table_contact", &dialog->table_contact,
+ "entry_id", &dialog->entry_id,
+ "button_chat", &dialog->button_chat,
+ "button_call",&dialog->button_call,
+ NULL);
empathy_glade_connect (glade,
- dialog,
- "new_message_dialog", "destroy", new_message_dialog_destroy_cb,
- "new_message_dialog", "response", new_message_dialog_response_cb,
- "entry_id", "changed", new_message_change_state_button_cb,
- NULL);
+ dialog,
+ "new_message_dialog", "destroy", new_message_dialog_destroy_cb,
+ "new_message_dialog", "response", new_message_dialog_response_cb,
+ "entry_id", "changed", new_message_change_state_button_cb,
+ NULL);
g_object_add_weak_pointer (G_OBJECT (dialog->dialog), (gpointer) &dialog);
@@ -166,8 +150,12 @@ empathy_new_message_dialog_show (GtkWindow *parent)
GTK_WINDOW (parent));
}
- gtk_widget_set_sensitive(dialog->button_validate, FALSE);
- gtk_widget_set_sensitive(dialog->button_voip, FALSE);
+ gtk_widget_set_sensitive (dialog->button_chat, FALSE);
+ gtk_widget_set_sensitive (dialog->button_call, FALSE);
+
+#ifndef HAVE_VOIP
+ gtk_widget_hide (dialog->button_call);
+#endif
gtk_widget_show (dialog->dialog);
diff --git a/libempathy-gtk/empathy-new-message-dialog.glade b/libempathy-gtk/empathy-new-message-dialog.glade
index 4fb18bd88..25f4b2254 100644
--- a/libempathy-gtk/empathy-new-message-dialog.glade
+++ b/libempathy-gtk/empathy-new-message-dialog.glade
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.0 on Fri Nov 30 23:14:21 2007 -->
+<!--*- mode: xml -*-->
<glade-interface>
<widget class="GtkDialog" id="new_message_dialog">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
- <property name="title" translatable="yes">New message</property>
+ <property name="title" translatable="yes">New Conversation</property>
<property name="resizable">False</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
@@ -13,17 +13,18 @@
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property>
<child>
<widget class="GtkTable" id="table_contact">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkEntry" id="entry_id">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -39,30 +40,25 @@
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Contact ID:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Account:</property>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
+ <property name="x_options"></property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</widget>
<packing>
<property name="position">1</property>
@@ -71,33 +67,108 @@
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
- <widget class="GtkButton" id="button2">
+ <widget class="GtkButton" id="button_call">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="response_id">-5</property>
+ <property name="can_default">True</property>
+ <property name="response_id">1</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="icon_name">gnome-stock-mic</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Call</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="button_chat">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="response_id">2</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="icon_name">im-message-new</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Chat</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index e543a5f1f..dfed7bfc7 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -37,7 +37,6 @@
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-marshal.h>
#include <libempathy/empathy-status-presets.h>
#include "empathy-ui-utils.h"
diff --git a/libempathy-gtk/empathy-status-icon.glade b/libempathy-gtk/empathy-status-icon.glade
index eb7d02a35..ab0f09f84 100644
--- a/libempathy-gtk/empathy-status-icon.glade
+++ b/libempathy-gtk/empathy-status-icon.glade
@@ -1,78 +1,59 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
<glade-interface>
-
-<widget class="GtkMenu" id="tray_menu">
-
- <child>
- <widget class="GtkCheckMenuItem" id="tray_show_list">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Show Contact List</property>
- <property name="use_underline">True</property>
- <property name="active">False</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="avskiljare5">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="tray_new_message">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_New Message...</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image599">
- <property name="visible">True</property>
- <property name="icon_size">1</property>
- <property name="icon_name">im-message-new</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="tray_status">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Status</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="avskiljare6">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="tray_quit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Quit</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image600">
- <property name="visible">True</property>
- <property name="stock">gtk-quit</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-</widget>
-
+ <widget class="GtkMenu" id="tray_menu">
+ <child>
+ <widget class="GtkCheckMenuItem" id="tray_show_list">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Show Contact List</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="avskiljare5">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="tray_new_message">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_New Conversation...</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image599">
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ <property name="icon_name">im-message-new</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="tray_status">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Status</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="avskiljare6">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="tray_quit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Quit</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="image600">
+ <property name="visible">True</property>
+ <property name="stock">gtk-quit</property>
+ <property name="icon_size">1</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
diff --git a/libempathy-gtk/empathy-theme.c b/libempathy-gtk/empathy-theme.c
index c8a9a0d48..dae690b5c 100644
--- a/libempathy-gtk/empathy-theme.c
+++ b/libempathy-gtk/empathy-theme.c
@@ -26,7 +26,6 @@
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-marshal.h>
#include "empathy-chat.h"
#include "empathy-conf.h"
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 0b29232bc..23875f722 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -53,17 +53,13 @@ struct SizeData {
gboolean preserve_aspect_ratio;
};
-static GladeXML *
-get_glade_file (const gchar *filename,
- const gchar *root,
- const gchar *domain,
- const gchar *first_required_widget,
- va_list args)
+GladeXML *
+empathy_glade_get (const gchar *filename,
+ const gchar *root,
+ const gchar *domain)
{
- gchar *path;
- GladeXML *gui;
- const char *name;
- GtkWidget **widget_ptr;
+ GladeXML *gui;
+ gchar *path;
path = g_build_filename (UNINSTALLED_GLADE_DIR, filename, NULL);
if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
@@ -77,9 +73,24 @@ get_glade_file (const gchar *filename,
if (!gui) {
g_warning ("Couldn't find necessary glade file '%s'", filename);
- return NULL;
}
+ return gui;
+}
+
+static GladeXML *
+get_glade_file (const gchar *filename,
+ const gchar *root,
+ const gchar *domain,
+ const gchar *first_required_widget,
+ va_list args)
+{
+ GladeXML *gui;
+ const char *name;
+ GtkWidget **widget_ptr;
+
+ gui = empathy_glade_get (filename, root, domain);
+
for (name = first_required_widget; name; name = va_arg (args, char *)) {
widget_ptr = va_arg (args, void *);
@@ -114,11 +125,9 @@ empathy_glade_get_file_simple (const gchar *filename,
va_end (args);
- if (!gui) {
- return;
+ if (gui) {
+ g_object_unref (gui);
}
-
- g_object_unref (gui);
}
GladeXML *
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 1fb29a97d..fedf8f7be 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -47,6 +47,9 @@ G_BEGIN_DECLS
#define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
/* Glade */
+GladeXML * empathy_glade_get (const gchar *filename,
+ const gchar *root,
+ const gchar *domain);
void empathy_glade_get_file_simple (const gchar *filename,
const gchar *root,
const gchar *domain,