From: Xavier Claessens Date: Sun, 29 Apr 2007 21:30:25 +0000 (+0000) Subject: [darcs-to-svn @ Adding jabber specific settings widget] X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=2641d1b02dbc27d9ef213724ee7f2e974e3ec77b [darcs-to-svn @ Adding jabber specific settings widget] svn path=/trunk/; revision=10 --- diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index dc304553..ea1bbe29 100644 --- a/libempathy-gtk/Makefile.am +++ b/libempathy-gtk/Makefile.am @@ -11,6 +11,7 @@ noinst_LTLIBRARIES = libempathy-gtk.la libempathy_gtk_la_SOURCES = \ gossip-accounts-dialog.c gossip-accounts-dialog.h \ gossip-account-widget-generic.c gossip-account-widget-generic.h \ + gossip-account-widget-jabber.c gossip-account-widget-jabber.h \ gossip-profile-chooser.c gossip-profile-chooser.h \ gossip-cell-renderer-expander.c gossip-cell-renderer-expander.h \ gossip-cell-renderer-text.c gossip-cell-renderer-text.h \ @@ -36,9 +37,10 @@ libempathy_gtk_la_LIBADD = \ libempathy_gtk_includedir = $(includedir)/empathy/ gladedir = $(datadir)/empathy -glade_DATA = \ - empathy-accounts.glade \ - empathy-chat.glade +glade_DATA = \ + gossip-accounts-dialog.glade \ + gossip-account-widget-jabber.glade \ + gossip-chat.glade dtddir = $(datadir)/empathy dtd_DATA = \ diff --git a/libempathy-gtk/empathy-accounts.glade b/libempathy-gtk/empathy-accounts.glade deleted file mode 100644 index a7bb391d..00000000 --- a/libempathy-gtk/empathy-accounts.glade +++ /dev/null @@ -1,843 +0,0 @@ - - - - - - 5 - Accounts - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - 2 - - - True - 6 - 18 - - - True - 6 - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - - - 200 - True - True - False - - - - - - - True - 6 - - - True - True - gtk-connect - True - - - False - False - - - - - True - 6 - True - - - True - True - gtk-add - True - - - - - True - True - gtk-remove - True - - - 1 - - - - - 1 - - - - - False - False - 1 - - - - - False - False - - - - - 415 - True - 18 - - - True - 18 - - - True - 0 - GTK_SHADOW_NONE - - - True - 6 - 20 - - - True - 6 - - - True - 2 - 2 - 6 - 6 - - - True - 0 - Jabber - - - - - - - - True - 0 - Imendio - 0 - - - 1 - 2 - - - - - - True - 0 - gtk-cut - 6 - - - 1 - 2 - 2 - GTK_FILL - GTK_FILL - - - - - - - - - - - True - <b>Account</b> - True - - - label_item - - - - - False - False - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 6 - 20 - - - - - - - - True - <b>Settings</b> - True - - - label_item - - - - - 1 - - - - - - - 0 - GTK_SHADOW_NONE - - - True - 6 - 20 - - - True - 12 - - - True - 2 - 2 - 6 - 6 - - - - - - True - 0 - _Name: - True - entry_name - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - _Type: - True - - - GTK_FILL - - - - - - True - 6 - - - True - True - A unique name for this account to identify it personally to you. - * - - - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - 1 - - - - - True - 6 - - - True - True - gtk-cancel - True - - - False - False - GTK_PACK_END - 1 - - - - - True - False - True - - - True - 0 - 0 - - - True - 2 - - - True - gtk-new - - - False - False - - - - - True - Cr_eate! - True - - - False - False - 1 - - - - - - - - - False - False - GTK_PACK_END - - - - - False - False - GTK_PACK_END - 1 - - - - - - - - - True - <b>New Account</b> - True - - - label_item - - - - - False - 1 - - - - - 0 - GTK_SHADOW_NONE - - - True - 6 - 12 - - - True - 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. - True - True - - - - - - - True - <b>No Account Selected</b> - True - - - label_item - - - - - False - False - 2 - - - - - 1 - - - - - 1 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-close - True - -6 - - - - - False - GTK_PACK_END - - - - - - - True - jabber account settings - False - - - True - 6 - 3 - 12 - 6 - - - True - 0 - Login I_D: - True - entry_id - - - GTK_FILL - - - - - - True - 0 - Pass_word: - True - entry_password - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Reso_urce: - True - entry_resource - - - 2 - 3 - GTK_FILL - - - - - - True - 0 - _Server: - True - entry_server - - - 3 - 4 - GTK_FILL - - - - - - True - 0 - _Port: - True - entry_port - - - 4 - 5 - GTK_FILL - - - - - - True - True - * - - - 1 - 3 - 2 - 3 - - - - - - True - True - * - - - 1 - 3 - 3 - 4 - - - - - - True - True - * - - - 1 - 3 - 4 - 5 - - - - - - True - True - Use encryption (SS_L) - True - True - - - 3 - 5 - 6 - GTK_FILL - - - - - - True - 2 - - - True - True - False - * - - - - - True - True - Forget password and clear the entry. - - - True - gtk-clear - 1 - - - - - False - False - 1 - - - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - False - True - C_hange - True - - - 2 - 3 - 1 - 2 - GTK_FILL - - - - - - True - True - * - - - 1 - 2 - - - - - - True - True - R_egister - True - - - 2 - 3 - GTK_FILL - - - - - - - - True - msn account settings - False - - - True - 4 - 2 - 12 - 6 - - - True - 0 - Login I_D: - True - entry_id - - - GTK_FILL - - - - - - True - 0 - Pass_word: - True - entry_password - - - 1 - 2 - GTK_FILL - - - - - - True - 2 - - - True - True - False - * - - - - - True - True - Forget password and clear the entry. - - - True - gtk-clear - 1 - - - - - False - False - 1 - - - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - * - - - 1 - 2 - - - - - - True - 0 - _Server: - True - entry_server - - - 2 - 3 - GTK_FILL - - - - - - True - True - * - - - 1 - 2 - 2 - 3 - - - - - - True - 0 - _Port: - True - entry_port - - - 3 - 4 - GTK_FILL - - - - - - True - True - * - - - 1 - 2 - 3 - 4 - - - - - - - diff --git a/libempathy-gtk/empathy-chat.glade b/libempathy-gtk/empathy-chat.glade deleted file mode 100644 index e8bd47cf..00000000 --- a/libempathy-gtk/empathy-chat.glade +++ /dev/null @@ -1,700 +0,0 @@ - - - - - - - - Chat - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 350 - 250 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 4 - True - False - 3 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_NEVER - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - - - - 0 - False - False - - - - - - - - Chat - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 350 - 250 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - GTK_PACK_DIRECTION_LTR - GTK_PACK_DIRECTION_LTR - - - - True - _Conversation - True - - - - - - - True - C_lear - True - - - - True - gtk-clear - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Insert _Smiley - True - - - - - - True - - - - - - True - _View Previous Conversations - True - - - - - True - gtk-justify-left - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - _Add Contact... - True - - - - True - gtk-add - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Contact Infor_mation - True - - - - True - gtk-info - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - _Close - True - - - - - True - gtk-close - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - - _Room - True - - - - - - - True - Change _Topic... - True - - - - - - True - - - - - - True - Join _New... - True - - - - True - gtk-new - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - In_vite... - True - - - - - - True - - - - - - True - _Add To Favorites - True - - - - True - gtk-add - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - _Show Contacts - True - True - - - - - - - - - - - True - _Edit - True - - - - - - - True - Cu_t - True - - - - - True - gtk-cut - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - _Copy - True - - - - - True - gtk-copy - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - _Paste - True - - - - - True - gtk-paste - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - - True - _Tabs - True - - - - - - - True - _Previous Tab - True - - - - - - - True - _Next Tab - True - - - - - - - True - - - - - - True - Move Tab _Left - True - - - - - - True - Move Tab _Right - True - - - - - - True - _Detach Tab - True - - - - - - - - - 0 - False - False - - - - - - - - - - - - 5 - Invite - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - True - 275 - 225 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - False - True - True - True - In_vite - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - False - 18 - - - - True - False - 6 - - - - True - Select who would you like to invite: - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - Invitation _message: - True - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - You have been invited to join a chat conference. - True - * - True - 40 - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/libempathy-gtk/gossip-account-widget-jabber.c b/libempathy-gtk/gossip-account-widget-jabber.c new file mode 100644 index 00000000..589bfcc0 --- /dev/null +++ b/libempathy-gtk/gossip-account-widget-jabber.c @@ -0,0 +1,265 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2005-2007 Imendio AB + * + * 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: Martyn Russell + */ + +#include "config.h" + +#include +#include +#include + +#include +#include +#include + +#include + +#include "gossip-account-widget-jabber.h" +#include "gossip-ui-utils.h" + +#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 *checkbutton_ssl; +} GossipAccountWidgetJabber; + +static gboolean account_widget_jabber_entry_focus_cb (GtkWidget *widget, + GdkEventFocus *event, + GossipAccountWidgetJabber *settings); +static void account_widget_jabber_entry_changed_cb (GtkWidget *widget, + GossipAccountWidgetJabber *settings); +static void account_widget_jabber_checkbutton_toggled_cb (GtkWidget *widget, + GossipAccountWidgetJabber *settings); +static void account_widget_jabber_value_changed_cb (GtkWidget *spinbutton, + GossipAccountWidgetJabber *settings); +static void account_widget_jabber_button_forget_clicked_cb (GtkWidget *button, + GossipAccountWidgetJabber *settings); +static void account_widget_jabber_destroy_cb (GtkWidget *widget, + GossipAccountWidgetJabber *settings); +static void account_widget_jabber_setup (GossipAccountWidgetJabber *settings); + +static gboolean +account_widget_jabber_entry_focus_cb (GtkWidget *widget, + GdkEventFocus *event, + GossipAccountWidgetJabber *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; + + mc_account_get_param_string (settings->account, param, &value); + gtk_entry_set_text (GTK_ENTRY (widget), value ? value : ""); + g_free (value); + } else { + mc_account_set_param_string (settings->account, param, str); + } + + return FALSE; +} + +static void +account_widget_jabber_entry_changed_cb (GtkWidget *widget, + GossipAccountWidgetJabber *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, + GossipAccountWidgetJabber *settings) +{ + if (widget == settings->checkbutton_ssl) { + gint port; + gboolean old_ssl; + + mc_account_get_param_int (settings->account, "port", &port); + old_ssl = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if (old_ssl) { + if (port == PORT_WITHOUT_SSL) { + port = PORT_WITH_SSL; + } + } else { + if (port == PORT_WITH_SSL) { + port = PORT_WITHOUT_SSL; + } + } + + mc_account_set_param_int (settings->account, "port", port); + mc_account_set_param_boolean (settings->account, "old-ssl", old_ssl); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_port), port); + } +} + +static void +account_widget_jabber_value_changed_cb (GtkWidget *spinbutton, + GossipAccountWidgetJabber *settings) +{ + if (spinbutton == settings->spinbutton_port) { + gdouble value; + + value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinbutton)); + mc_account_set_param_int (settings->account, "port", (gint) value); + } +} + +static void +account_widget_jabber_button_forget_clicked_cb (GtkWidget *button, + GossipAccountWidgetJabber *settings) +{ + mc_account_set_param_string (settings->account, "password", ""); + gtk_entry_set_text (GTK_ENTRY (settings->entry_password), ""); +} + +static void +account_widget_jabber_destroy_cb (GtkWidget *widget, + GossipAccountWidgetJabber *settings) +{ + g_object_unref (settings->account); + g_free (settings); +} + +static void +account_widget_jabber_setup (GossipAccountWidgetJabber *settings) +{ + gint port; + gchar *id; + gchar *resource; + gchar *server; + gchar *password; + gboolean old_ssl; + + 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, "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); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (settings->checkbutton_ssl), old_ssl); + gtk_entry_set_text (GTK_ENTRY (settings->entry_id), id ? id : ""); + gtk_entry_set_text (GTK_ENTRY (settings->entry_password), password ? password : ""); + gtk_entry_set_text (GTK_ENTRY (settings->entry_resource), resource ? resource : ""); + gtk_entry_set_text (GTK_ENTRY (settings->entry_server), server ? server : ""); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_port), port); + + gtk_widget_set_sensitive (settings->button_forget, !G_STR_EMPTY (password)); + + g_free (id); + g_free (resource); + g_free (server); + g_free (password); +} + +GtkWidget * +gossip_account_widget_jabber_new (McAccount *account) +{ + GossipAccountWidgetJabber *settings; + GladeXML *glade; + GtkSizeGroup *size_group; + GtkWidget *label_id, *label_password; + GtkWidget *label_server, *label_resource, *label_port; + + settings = g_new0 (GossipAccountWidgetJabber, 1); + settings->account = g_object_ref (account); + + glade = gossip_glade_get_file ("gossip-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_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, + "checkbutton_ssl", &settings->checkbutton_ssl, + NULL); + + account_widget_jabber_setup (settings); + + gossip_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, + "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, + NULL); + + g_object_unref (glade); + + /* Set up remaining widgets */ + size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + + gtk_size_group_add_widget (size_group, label_id); + gtk_size_group_add_widget (size_group, label_password); + gtk_size_group_add_widget (size_group, label_resource); + gtk_size_group_add_widget (size_group, label_server); + gtk_size_group_add_widget (size_group, label_port); + + g_object_unref (size_group); + + return settings->vbox_settings; +} + diff --git a/libempathy-gtk/gossip-account-widget-jabber.glade b/libempathy-gtk/gossip-account-widget-jabber.glade new file mode 100644 index 00000000..24f3b71b --- /dev/null +++ b/libempathy-gtk/gossip-account-widget-jabber.glade @@ -0,0 +1,337 @@ + + + + + + + + True + jabber account settings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + 6 + 3 + False + 6 + 12 + + + + True + Login I_D: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_id + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Pass_word: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_password + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Reso_urce: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_resource + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + _Server: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_server + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + _Port: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + spinbutton_port + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 3 + 2 + 3 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 3 + 3 + 4 + + + + + + + True + True + Use encryption (SS_L) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 3 + 5 + 6 + fill + + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 5222 0 65556 1 10 10 + + + 1 + 3 + 4 + 5 + + + + + + + True + Forget password and clear the entry. + True + GTK_RELIEF_NORMAL + True + + + + True + gtk-clear + 1 + 0.5 + 0.5 + 0 + 0 + + + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + True + False + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 3 + 0 + 1 + + + + + + + + diff --git a/libempathy-gtk/gossip-account-widget-jabber.h b/libempathy-gtk/gossip-account-widget-jabber.h new file mode 100644 index 00000000..b491e488 --- /dev/null +++ b/libempathy-gtk/gossip-account-widget-jabber.h @@ -0,0 +1,34 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2005-2007 Imendio AB + * + * 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: Martyn Russell + */ + +#ifndef __GOSSIP_ACCOUNT_WIDGET_JABBER_H__ +#define __GOSSIP_ACCOUNT_WIDGET_JABBER_H__ + +#include + +G_BEGIN_DECLS + +GtkWidget *gossip_account_widget_jabber_new (McAccount *account); + +G_END_DECLS + +#endif /* __GOSSIP_ACCOUNT_WIDGET_JABBER_H__ */ diff --git a/libempathy-gtk/gossip-accounts-dialog.c b/libempathy-gtk/gossip-accounts-dialog.c index 848abb52..6f61dfb3 100644 --- a/libempathy-gtk/gossip-accounts-dialog.c +++ b/libempathy-gtk/gossip-accounts-dialog.c @@ -47,6 +47,7 @@ #include "gossip-accounts-dialog.h" #include "gossip-profile-chooser.h" #include "gossip-account-widget-generic.h" +#include "gossip-account-widget-jabber.h" #define DEBUG_DOMAIN "AccountDialog" @@ -284,7 +285,9 @@ accounts_dialog_update_account (GossipAccountsDialog *dialog, profile = mc_account_get_profile (account); config_ui = mc_profile_get_configuration_ui (profile); - if (strcmp (config_ui, "blah") == 0) { + if (strcmp (config_ui, "jabber") == 0) { + dialog->settings_widget = + gossip_account_widget_jabber_new (account); } else { dialog->settings_widget = gossip_account_widget_generic_new (account, @@ -957,7 +960,7 @@ gossip_accounts_dialog_show (void) dialog = g_new0 (GossipAccountsDialog, 1); - glade = gossip_glade_get_file ("empathy-accounts.glade", + glade = gossip_glade_get_file ("gossip-accounts-dialog.glade", "accounts_dialog", NULL, "accounts_dialog", &dialog->window, diff --git a/libempathy-gtk/gossip-private-chat.c b/libempathy-gtk/gossip-private-chat.c index 1ceb6d4a..c9a44bf0 100644 --- a/libempathy-gtk/gossip-private-chat.c +++ b/libempathy-gtk/gossip-private-chat.c @@ -159,7 +159,7 @@ private_chat_create_ui (GossipPrivateChat *chat) priv = GET_PRIV (chat); - glade = gossip_glade_get_file ("empathy-chat.glade", + glade = gossip_glade_get_file ("gossip-chat.glade", "chat_widget", NULL, "chat_widget", &priv->widget,