aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/Makefile.am125
-rw-r--r--libempathy-gtk/empathy-avatar-chooser.c1
-rw-r--r--libempathy-gtk/empathy-chat-view.c1
-rw-r--r--libempathy-gtk/empathy-chat.c111
-rw-r--r--libempathy-gtk/empathy-chat.h5
-rw-r--r--libempathy-gtk/empathy-conf.h23
-rw-r--r--libempathy-gtk/empathy-group-chat.c97
-rw-r--r--libempathy-gtk/empathy-preferences.h62
-rw-r--r--libempathy-gtk/empathy-private-chat.c1
-rw-r--r--libempathy-gtk/empathy-spell.c1
-rw-r--r--libempathy-gtk/empathy-theme-boxes.c1
-rw-r--r--libempathy-gtk/empathy-theme-manager.c1
-rw-r--r--libempathy-gtk/empathy-theme.c1
-rw-r--r--src/Makefile.am20
-rw-r--r--src/empathy-about-dialog.c (renamed from libempathy-gtk/empathy-about-dialog.c)4
-rw-r--r--src/empathy-about-dialog.h (renamed from libempathy-gtk/empathy-about-dialog.h)0
-rw-r--r--src/empathy-call-window.c (renamed from libempathy-gtk/empathy-call-window.c)0
-rw-r--r--src/empathy-call-window.glade (renamed from libempathy-gtk/empathy-call-window.glade)0
-rw-r--r--src/empathy-call-window.h (renamed from libempathy-gtk/empathy-call-window.h)0
-rw-r--r--src/empathy-chat-window.c (renamed from libempathy-gtk/empathy-chat-window.c)91
-rw-r--r--src/empathy-chat-window.h (renamed from libempathy-gtk/empathy-chat-window.h)40
-rw-r--r--src/empathy-chatrooms-window.c (renamed from libempathy-gtk/empathy-chatrooms-window.c)7
-rw-r--r--src/empathy-chatrooms-window.glade (renamed from libempathy-gtk/empathy-chatrooms-window.glade)0
-rw-r--r--src/empathy-chatrooms-window.h (renamed from libempathy-gtk/empathy-chatrooms-window.h)2
-rw-r--r--src/empathy-main-window.c (renamed from libempathy-gtk/empathy-main-window.c)23
-rw-r--r--src/empathy-main-window.glade (renamed from libempathy-gtk/empathy-main-window.glade)0
-rw-r--r--src/empathy-main-window.h (renamed from libempathy-gtk/empathy-main-window.h)0
-rw-r--r--src/empathy-new-chatroom-dialog.c (renamed from libempathy-gtk/empathy-new-chatroom-dialog.c)7
-rw-r--r--src/empathy-new-chatroom-dialog.glade (renamed from libempathy-gtk/empathy-new-chatroom-dialog.glade)0
-rw-r--r--src/empathy-new-chatroom-dialog.h (renamed from libempathy-gtk/empathy-new-chatroom-dialog.h)0
-rw-r--r--src/empathy-preferences.c (renamed from libempathy-gtk/empathy-preferences.c)15
-rw-r--r--src/empathy-preferences.glade (renamed from libempathy-gtk/empathy-preferences.glade)0
-rw-r--r--src/empathy-preferences.h38
-rw-r--r--src/empathy-status-icon.c (renamed from libempathy-gtk/empathy-status-icon.c)15
-rw-r--r--src/empathy-status-icon.glade (renamed from libempathy-gtk/empathy-status-icon.glade)0
-rw-r--r--src/empathy-status-icon.h (renamed from libempathy-gtk/empathy-status-icon.h)0
-rw-r--r--src/empathy.c6
-rw-r--r--src/ephy-spinner.c (renamed from libempathy-gtk/ephy-spinner.c)2
-rw-r--r--src/ephy-spinner.h (renamed from libempathy-gtk/ephy-spinner.h)0
39 files changed, 323 insertions, 377 deletions
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 88e10794d..d29a11f6b 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -15,48 +15,39 @@ BUILT_SOURCES = \
lib_LTLIBRARIES = libempathy-gtk.la
libempathy_gtk_la_SOURCES = \
- ephy-spinner.c ephy-spinner.h \
- empathy-main-window.c \
- empathy-status-icon.c \
- empathy-conf.c \
- empathy-contact-widget.c \
- empathy-contact-dialogs.c \
+ empathy-account-chooser.c \
+ empathy-chat.c \
+ empathy-irc-network-dialog.c \
+ empathy-spell-dialog.c \
empathy-accounts-dialog.c \
+ empathy-chat-view.c \
+ empathy-log-window.c \
+ empathy-theme-boxes.c \
empathy-account-widget.c \
- empathy-account-widget-irc.c \
- empathy-profile-chooser.c \
- empathy-cell-renderer-expander.c \
- empathy-cell-renderer-text.c \
- empathy-cell-renderer-activatable.c \
- empathy-spell.c \
- empathy-spell-dialog.c \
- empathy-contact-list-store.c \
- empathy-contact-list-view.c \
- empathy-preferences.c \
+ empathy-conf.c \
empathy-theme.c \
- empathy-theme-boxes.c \
+ empathy-account-widget-irc.c \
+ empathy-contact-dialogs.c \
+ empathy-new-message-dialog.c \
empathy-theme-irc.c \
- empathy-theme-manager.c \
- empathy-smiley-manager.c \
- empathy-chat-window.c \
- empathy-chat.c \
- empathy-chat-view.c \
- empathy-private-chat.c \
- empathy-group-chat.c \
- empathy-geometry.c \
- empathy-presence-chooser.c \
- empathy-about-dialog.c \
- empathy-account-chooser.c \
- empathy-new-chatroom-dialog.c \
- empathy-chatrooms-window.c \
- empathy-log-window.c \
- empathy-call-window.c \
empathy-avatar-chooser.c \
+ empathy-contact-list-store.c \
+ empathy-presence-chooser.c \
+ empathy-theme-manager.c \
empathy-avatar-image.c \
+ empathy-contact-list-view.c \
+ empathy-private-chat.c \
empathy-ui-utils.c \
- empathy-new-message-dialog.c \
- empathy-irc-network-dialog.c \
- totem-subtitle-encoding.c totem-subtitle-encoding.h
+ empathy-cell-renderer-activatable.c \
+ empathy-contact-widget.c \
+ empathy-profile-chooser.c \
+ empathy-cell-renderer-expander.c \
+ empathy-geometry.c \
+ empathy-smiley-manager.c \
+ empathy-cell-renderer-text.c \
+ empathy-group-chat.c \
+ empathy-spell.c \
+ totem-subtitle-encoding.c totem-subtitle-encoding.h
# do not distribute generated files
nodist_libempathy_gtk_la_SOURCES =\
@@ -72,46 +63,38 @@ libempathy_gtk_la_LDFLAGS = \
libempathy_gtk_headers = \
empathy-images.h \
- empathy-main-window.h \
- empathy-status-icon.h \
- empathy-conf.h \
- empathy-contact-widget.h \
- empathy-contact-dialogs.h \
+ empathy-account-chooser.h \
+ empathy-chat.h \
+ empathy-irc-network-dialog.h \
+ empathy-spell-dialog.h \
empathy-accounts-dialog.h \
+ empathy-chat-view.h \
+ empathy-log-window.h \
+ empathy-theme-boxes.h \
empathy-account-widget.h \
- empathy-account-widget-irc.h \
- empathy-profile-chooser.h \
- empathy-cell-renderer-expander.h \
- empathy-cell-renderer-text.h \
- empathy-cell-renderer-activatable.h \
- empathy-spell.h \
- empathy-spell-dialog.h \
- empathy-contact-list-store.h \
- empathy-contact-list-view.h \
- empathy-preferences.h \
+ empathy-conf.h \
empathy-theme.h \
- empathy-theme-boxes.h \
+ empathy-account-widget-irc.h \
+ empathy-contact-dialogs.h \
+ empathy-new-message-dialog.h \
empathy-theme-irc.h \
- empathy-theme-manager.h \
- empathy-smiley-manager.h \
- empathy-chat-window.h \
- empathy-chat.h \
- empathy-chat-view.h \
- empathy-private-chat.h \
- empathy-group-chat.h \
- empathy-geometry.h \
- empathy-presence-chooser.h \
- empathy-about-dialog.h \
- empathy-account-chooser.h \
- empathy-new-chatroom-dialog.h \
- empathy-chatrooms-window.h \
- empathy-log-window.h \
- empathy-call-window.h \
empathy-avatar-chooser.h \
+ empathy-contact-list-store.h \
+ empathy-presence-chooser.h \
+ empathy-theme-manager.h \
empathy-avatar-image.h \
+ empathy-contact-list-view.h \
+ empathy-private-chat.h \
empathy-ui-utils.h \
- empathy-new-message-dialog.h \
- empathy-irc-network-dialog.h
+ empathy-cell-renderer-activatable.h \
+ empathy-contact-widget.h \
+ empathy-profile-chooser.h \
+ empathy-cell-renderer-expander.h \
+ empathy-geometry.h \
+ empathy-smiley-manager.h \
+ empathy-cell-renderer-text.h \
+ empathy-group-chat.h \
+ empathy-spell.h
libempathy_gtk_includedir = $(includedir)/libempathy-gtk/
libempathy_gtk_include_HEADERS = \
@@ -120,11 +103,8 @@ libempathy_gtk_include_HEADERS = \
gladedir = $(datadir)/empathy
glade_DATA = \
- empathy-main-window.glade \
- empathy-status-icon.glade \
empathy-contact-widget.glade \
empathy-contact-dialogs.glade \
- empathy-preferences.glade \
empathy-presence-chooser.glade \
empathy-accounts-dialog.glade \
empathy-account-widget-generic.glade \
@@ -134,12 +114,9 @@ glade_DATA = \
empathy-account-widget-irc.glade \
empathy-account-widget-icq.glade \
empathy-account-widget-yahoo.glade \
- empathy-new-chatroom-dialog.glade \
empathy-group-chat.glade \
- empathy-chatrooms-window.glade \
empathy-spell-dialog.glade \
empathy-log-window.glade \
- empathy-call-window.glade \
empathy-chat.glade \
empathy-new-message-dialog.glade
diff --git a/libempathy-gtk/empathy-avatar-chooser.c b/libempathy-gtk/empathy-avatar-chooser.c
index 7ff34e812..99132b8a1 100644
--- a/libempathy-gtk/empathy-avatar-chooser.c
+++ b/libempathy-gtk/empathy-avatar-chooser.c
@@ -33,7 +33,6 @@
#include "empathy-avatar-chooser.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#include "empathy-ui-utils.h"
#define DEBUG_DOMAIN "AvatarChooser"
diff --git a/libempathy-gtk/empathy-chat-view.c b/libempathy-gtk/empathy-chat-view.c
index af523180d..7682bf3a1 100644
--- a/libempathy-gtk/empathy-chat-view.c
+++ b/libempathy-gtk/empathy-chat-view.c
@@ -48,7 +48,6 @@
#include "empathy-chat-view.h"
#include "empathy-chat.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#include "empathy-theme-manager.h"
#include "empathy-ui-utils.h"
#include "empathy-smiley-manager.h"
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 1b2fcccb2..50a370037 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -42,10 +42,8 @@
#include <libempathy/empathy-utils.h>
#include "empathy-chat.h"
-#include "empathy-chat-window.h"
#include "empathy-geometry.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#include "empathy-spell.h"
#include "empathy-spell-dialog.h"
#include "empathy-ui-utils.h"
@@ -67,9 +65,9 @@
struct _EmpathyChatPriv {
EmpathyLogManager *log_manager;
EmpathyTpChat *tp_chat;
- EmpathyChatWindow *window;
McAccount *account;
MissionControl *mc;
+ GtkWidget *widget;
guint composing_stop_timeout_id;
gboolean sensitive;
gchar *id;
@@ -802,21 +800,20 @@ chat_input_text_buffer_changed_cb (GtkTextBuffer *buffer,
if (priv->is_first_char) {
GtkRequisition req;
gint window_height;
- GtkWidget *dialog;
+ GtkWindow *dialog;
GtkAllocation *allocation;
/* Save the window's size */
- dialog = empathy_chat_window_get_dialog (priv->window);
- gtk_window_get_size (GTK_WINDOW (dialog),
- NULL, &window_height);
-
- gtk_widget_size_request (chat->input_text_view, &req);
-
- allocation = &GTK_WIDGET (chat->view)->allocation;
-
- priv->default_window_height = window_height;
- priv->last_input_height = req.height;
- priv->padding_height = window_height - req.height - allocation->height;
+ dialog = empathy_get_toplevel_window (priv->widget);
+ if (dialog) {
+ gtk_window_get_size (GTK_WINDOW (dialog), NULL, &window_height);
+ gtk_widget_size_request (chat->input_text_view, &req);
+ allocation = &GTK_WIDGET (chat->view)->allocation;
+
+ priv->default_window_height = window_height;
+ priv->last_input_height = req.height;
+ priv->padding_height = window_height - req.height - allocation->height;
+ }
priv->is_first_char = FALSE;
}
@@ -880,7 +877,7 @@ chat_input_text_buffer_changed_cb (GtkTextBuffer *buffer,
}
typedef struct {
- GtkWidget *window;
+ GtkWindow *window;
gint width;
gint height;
} ChangeSizeData;
@@ -888,8 +885,7 @@ typedef struct {
static gboolean
chat_change_size_in_idle_cb (ChangeSizeData *data)
{
- gtk_window_resize (GTK_WINDOW (data->window),
- data->width, data->height);
+ gtk_window_resize (data->window, data->width, data->height);
return FALSE;
}
@@ -920,7 +916,7 @@ chat_text_view_size_allocate_cb (GtkWidget *widget,
{
EmpathyChatPriv *priv;
gint width;
- GtkWidget *dialog;
+ GtkWindow *dialog;
ChangeSizeData *data;
gint window_height;
gint new_height;
@@ -960,8 +956,8 @@ chat_text_view_size_allocate_cb (GtkWidget *widget,
view_allocation = &GTK_WIDGET (chat->view)->allocation;
- dialog = empathy_chat_window_get_dialog (priv->window);
- gtk_window_get_size (GTK_WINDOW (dialog), NULL, &current_height);
+ dialog = empathy_get_toplevel_window (priv->widget);
+ gtk_window_get_size (dialog, NULL, &current_height);
new_height = view_allocation->height + priv->padding_height + allocation->height - diff;
@@ -976,7 +972,7 @@ chat_text_view_size_allocate_cb (GtkWidget *widget,
}
/* Restore the window's size */
- gtk_window_get_size (GTK_WINDOW (dialog), &width, NULL);
+ gtk_window_get_size (dialog, &width, NULL);
data = g_new0 (ChangeSizeData, 1);
data->window = dialog;
@@ -1395,13 +1391,15 @@ empathy_chat_get_status_icon_name (EmpathyChat *chat)
GtkWidget *
empathy_chat_get_widget (EmpathyChat *chat)
{
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+
g_return_val_if_fail (EMPATHY_IS_CHAT (chat), NULL);
- if (EMPATHY_CHAT_GET_CLASS (chat)->get_widget) {
- return EMPATHY_CHAT_GET_CLASS (chat)->get_widget (chat);
+ if (!priv->widget && EMPATHY_CHAT_GET_CLASS (chat)->get_widget) {
+ priv->widget = EMPATHY_CHAT_GET_CLASS (chat)->get_widget (chat);
}
- return NULL;
+ return priv->widget;
}
gboolean
@@ -1580,26 +1578,6 @@ empathy_chat_clear (EmpathyChat *chat)
}
void
-empathy_chat_set_window (EmpathyChat *chat,
- EmpathyChatWindow *window)
-{
- EmpathyChatPriv *priv;
-
- priv = GET_PRIV (chat);
- priv->window = window;
-}
-
-EmpathyChatWindow *
-empathy_chat_get_window (EmpathyChat *chat)
-{
- EmpathyChatPriv *priv;
-
- priv = GET_PRIV (chat);
-
- return priv->window;
-}
-
-void
empathy_chat_scroll_down (EmpathyChat *chat)
{
g_return_if_fail (EMPATHY_IS_CHAT (chat));
@@ -1660,50 +1638,21 @@ empathy_chat_paste (EmpathyChat *chat)
gtk_text_buffer_paste_clipboard (buffer, clipboard, NULL, TRUE);
}
-void
-empathy_chat_present (EmpathyChat *chat)
-{
- EmpathyChatPriv *priv;
-
- g_return_if_fail (EMPATHY_IS_CHAT (chat));
-
- priv = GET_PRIV (chat);
-
- if (priv->window == NULL) {
- EmpathyChatWindow *window;
-
- window = empathy_chat_window_get_default ();
- if (!window) {
- window = empathy_chat_window_new ();
- }
-
- empathy_chat_window_add_chat (window, chat);
- }
-
- empathy_chat_window_switch_to_chat (priv->window, chat);
- empathy_window_present (
- GTK_WINDOW (empathy_chat_window_get_dialog (priv->window)),
- TRUE);
-
- gtk_widget_grab_focus (chat->input_text_view);
-}
-
gboolean
empathy_chat_should_play_sound (EmpathyChat *chat)
{
- EmpathyChatWindow *window;
- gboolean play = TRUE;
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+ GtkWindow *window;
+ gboolean has_focus = FALSE;
g_return_val_if_fail (EMPATHY_IS_CHAT (chat), FALSE);
- window = empathy_chat_get_window (chat);
- if (!window) {
- return TRUE;
+ window = empathy_get_toplevel_window (priv->widget);
+ if (window) {
+ g_object_get (window, "has-toplevel-focus", &has_focus, NULL);
}
- play = !empathy_chat_window_has_focus (window);
-
- return play;
+ return !has_focus;
}
gboolean
diff --git a/libempathy-gtk/empathy-chat.h b/libempathy-gtk/empathy-chat.h
index bcf382e53..d235c08af 100644
--- a/libempathy-gtk/empathy-chat.h
+++ b/libempathy-gtk/empathy-chat.h
@@ -50,8 +50,6 @@ typedef struct _EmpathyChat EmpathyChat;
typedef struct _EmpathyChatClass EmpathyChatClass;
typedef struct _EmpathyChatPriv EmpathyChatPriv;
-#include "empathy-chat-window.h"
-
struct _EmpathyChat {
GObject parent;
@@ -79,9 +77,6 @@ struct _EmpathyChatClass {
GType empathy_chat_get_type (void);
EmpathyChatView * empathy_chat_get_view (EmpathyChat *chat);
-EmpathyChatWindow *empathy_chat_get_window (EmpathyChat *chat);
-void empathy_chat_set_window (EmpathyChat *chat,
- EmpathyChatWindow *window);
void empathy_chat_present (EmpathyChat *chat);
void empathy_chat_clear (EmpathyChat *chat);
void empathy_chat_scroll_down (EmpathyChat *chat);
diff --git a/libempathy-gtk/empathy-conf.h b/libempathy-gtk/empathy-conf.h
index 7e8e60e25..c1e491352 100644
--- a/libempathy-gtk/empathy-conf.h
+++ b/libempathy-gtk/empathy-conf.h
@@ -43,6 +43,29 @@ struct _EmpathyConfClass {
GObjectClass parent_class;
};
+#define EMPATHY_PREFS_PATH "/apps/empathy"
+#define EMPATHY_PREFS_SOUNDS_FOR_MESSAGES EMPATHY_PREFS_PATH "/notifications/sounds_for_messages"
+#define EMPATHY_PREFS_SOUNDS_WHEN_AWAY EMPATHY_PREFS_PATH "/notifications/sounds_when_away"
+#define EMPATHY_PREFS_SOUNDS_WHEN_BUSY EMPATHY_PREFS_PATH "/notifications/sounds_when_busy"
+#define EMPATHY_PREFS_POPUPS_WHEN_AVAILABLE EMPATHY_PREFS_PATH "/notifications/popups_when_available"
+#define EMPATHY_PREFS_CHAT_SHOW_SMILEYS EMPATHY_PREFS_PATH "/conversation/graphical_smileys"
+#define EMPATHY_PREFS_CHAT_THEME EMPATHY_PREFS_PATH "/conversation/theme"
+#define EMPATHY_PREFS_CHAT_THEME_CHAT_ROOM EMPATHY_PREFS_PATH "/conversation/theme_chat_room"
+#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_LANGUAGES EMPATHY_PREFS_PATH "/conversation/spell_checker_languages"
+#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED EMPATHY_PREFS_PATH "/conversation/spell_checker_enabled"
+#define EMPATHY_PREFS_CHAT_NICK_COMPLETION_CHAR EMPATHY_PREFS_PATH "/conversation/nick_completion_char"
+#define EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS EMPATHY_PREFS_PATH "/ui/separate_chat_windows"
+#define EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN EMPATHY_PREFS_PATH "/ui/main_window_hidden"
+#define EMPATHY_PREFS_UI_AVATAR_DIRECTORY EMPATHY_PREFS_PATH "/ui/avatar_directory"
+#define EMPATHY_PREFS_UI_SHOW_AVATARS EMPATHY_PREFS_PATH "/ui/show_avatars"
+#define EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST EMPATHY_PREFS_PATH "/ui/compact_contact_list"
+#define EMPATHY_PREFS_CONTACTS_SHOW_OFFLINE EMPATHY_PREFS_PATH "/contacts/show_offline"
+#define EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM EMPATHY_PREFS_PATH "/contacts/sort_criterium"
+#define EMPATHY_PREFS_HINTS_CLOSE_MAIN_WINDOW EMPATHY_PREFS_PATH "/hints/close_main_window"
+#define EMPATHY_PREFS_SALUT_ACCOUNT_CREATED EMPATHY_PREFS_PATH "/accounts/salut_created"
+#define EMPATHY_PREFS_USE_NM EMPATHY_PREFS_PATH "/use_nm"
+#define EMPATHY_PREFS_AUTOCONNECT EMPATHY_PREFS_PATH "/autoconnect"
+
typedef void (*EmpathyConfNotifyFunc) (EmpathyConf *conf,
const gchar *key,
gpointer user_data);
diff --git a/libempathy-gtk/empathy-group-chat.c b/libempathy-gtk/empathy-group-chat.c
index 007e69476..909e23162 100644
--- a/libempathy-gtk/empathy-group-chat.c
+++ b/libempathy-gtk/empathy-group-chat.c
@@ -51,7 +51,6 @@
#include "empathy-images.h"
#include "empathy-ui-utils.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#define DEBUG_DOMAIN "GroupChat"
@@ -90,11 +89,6 @@ static void group_chat_members_changed_cb (EmpathyTpChatroom *tp_
gchar *message,
gboolean is_member,
EmpathyGroupChat *chat);
-static void group_chat_topic_entry_activate_cb (GtkWidget *entry,
- GtkDialog *dialog);
-static void group_chat_topic_response_cb (GtkWidget *dialog,
- gint response,
- EmpathyGroupChat *chat);
static const gchar * group_chat_get_name (EmpathyChat *chat);
static gchar * group_chat_get_tooltip (EmpathyChat *chat);
static const gchar * group_chat_get_status_icon_name (EmpathyChat *chat);
@@ -224,25 +218,58 @@ empathy_group_chat_set_show_contacts (EmpathyGroupChat *chat,
}
}
+static void
+group_chat_topic_response_cb (GtkWidget *dialog,
+ gint response,
+ EmpathyGroupChat *chat)
+{
+ if (response == GTK_RESPONSE_OK) {
+ GtkWidget *entry;
+ const gchar *topic;
+
+ entry = g_object_get_data (G_OBJECT (dialog), "entry");
+ topic = gtk_entry_get_text (GTK_ENTRY (entry));
+
+ if (!G_STR_EMPTY (topic)) {
+ EmpathyGroupChatPriv *priv;
+ GValue value = {0, };
+
+ priv = GET_PRIV (chat);
+
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, topic);
+ empathy_tp_chat_set_property (EMPATHY_TP_CHAT (priv->tp_chat),
+ "subject", &value);
+ g_value_unset (&value);
+ }
+ }
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
+group_chat_topic_entry_activate_cb (GtkWidget *entry,
+ GtkDialog *dialog)
+{
+ gtk_dialog_response (dialog, GTK_RESPONSE_OK);
+}
+
void
empathy_group_chat_set_topic (EmpathyGroupChat *chat)
{
EmpathyGroupChatPriv *priv;
- EmpathyChatWindow *chat_window;
- GtkWidget *chat_dialog;
- GtkWidget *dialog;
- GtkWidget *entry;
- GtkWidget *hbox;
- const gchar *topic;
-
- g_return_if_fail (EMPATHY_IS_GROUP_CHAT (chat));
+ GtkWindow *parent;
+ GtkWidget *dialog;
+ GtkWidget *entry;
+ GtkWidget *hbox;
+ const gchar *topic;
priv = GET_PRIV (chat);
- chat_window = empathy_chat_get_window (EMPATHY_CHAT (chat));
- chat_dialog = empathy_chat_window_get_dialog (chat_window);
+ g_return_if_fail (EMPATHY_IS_GROUP_CHAT (chat));
- dialog = gtk_message_dialog_new (GTK_WINDOW (chat_dialog),
+ parent = empathy_get_toplevel_window (empathy_chat_get_widget (EMPATHY_CHAT (chat)));
+ dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
0,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_OK_CANCEL,
@@ -367,42 +394,6 @@ group_chat_members_changed_cb (EmpathyTpChatroom *tp_chat,
}
}
-static void
-group_chat_topic_entry_activate_cb (GtkWidget *entry,
- GtkDialog *dialog)
-{
- gtk_dialog_response (dialog, GTK_RESPONSE_OK);
-}
-
-static void
-group_chat_topic_response_cb (GtkWidget *dialog,
- gint response,
- EmpathyGroupChat *chat)
-{
- if (response == GTK_RESPONSE_OK) {
- GtkWidget *entry;
- const gchar *topic;
-
- entry = g_object_get_data (G_OBJECT (dialog), "entry");
- topic = gtk_entry_get_text (GTK_ENTRY (entry));
-
- if (!G_STR_EMPTY (topic)) {
- EmpathyGroupChatPriv *priv;
- GValue value = {0, };
-
- priv = GET_PRIV (chat);
-
- g_value_init (&value, G_TYPE_STRING);
- g_value_set_string (&value, topic);
- empathy_tp_chat_set_property (EMPATHY_TP_CHAT (priv->tp_chat),
- "subject", &value);
- g_value_unset (&value);
- }
- }
-
- gtk_widget_destroy (dialog);
-}
-
static const gchar *
group_chat_get_name (EmpathyChat *chat)
{
diff --git a/libempathy-gtk/empathy-preferences.h b/libempathy-gtk/empathy-preferences.h
deleted file mode 100644
index 750666b09..000000000
--- a/libempathy-gtk/empathy-preferences.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2003-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: Mikael Hallendal <micke@imendio.com>
- * Richard Hult <richard@imendio.com>
- * Martyn Russell <martyn@imendio.com>
- */
-
-#ifndef __EMPATHY_PREFERENCES_H__
-#define __EMPATHY_PREFERENCES_H__
-
-#include <gtk/gtkwindow.h>
-
-G_BEGIN_DECLS
-
-#define EMPATHY_PREFS_PATH "/apps/empathy"
-
-#define EMPATHY_PREFS_SOUNDS_FOR_MESSAGES EMPATHY_PREFS_PATH "/notifications/sounds_for_messages"
-#define EMPATHY_PREFS_SOUNDS_WHEN_AWAY EMPATHY_PREFS_PATH "/notifications/sounds_when_away"
-#define EMPATHY_PREFS_SOUNDS_WHEN_BUSY EMPATHY_PREFS_PATH "/notifications/sounds_when_busy"
-#define EMPATHY_PREFS_POPUPS_WHEN_AVAILABLE EMPATHY_PREFS_PATH "/notifications/popups_when_available"
-#define EMPATHY_PREFS_CHAT_SHOW_SMILEYS EMPATHY_PREFS_PATH "/conversation/graphical_smileys"
-#define EMPATHY_PREFS_CHAT_THEME EMPATHY_PREFS_PATH "/conversation/theme"
-#define EMPATHY_PREFS_CHAT_THEME_CHAT_ROOM EMPATHY_PREFS_PATH "/conversation/theme_chat_room"
-#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_LANGUAGES EMPATHY_PREFS_PATH "/conversation/spell_checker_languages"
-#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED EMPATHY_PREFS_PATH "/conversation/spell_checker_enabled"
-#define EMPATHY_PREFS_CHAT_NICK_COMPLETION_CHAR EMPATHY_PREFS_PATH "/conversation/nick_completion_char"
-#define EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS EMPATHY_PREFS_PATH "/ui/separate_chat_windows"
-#define EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN EMPATHY_PREFS_PATH "/ui/main_window_hidden"
-#define EMPATHY_PREFS_UI_AVATAR_DIRECTORY EMPATHY_PREFS_PATH "/ui/avatar_directory"
-#define EMPATHY_PREFS_UI_SHOW_AVATARS EMPATHY_PREFS_PATH "/ui/show_avatars"
-#define EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST EMPATHY_PREFS_PATH "/ui/compact_contact_list"
-#define EMPATHY_PREFS_CONTACTS_SHOW_OFFLINE EMPATHY_PREFS_PATH "/contacts/show_offline"
-#define EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM EMPATHY_PREFS_PATH "/contacts/sort_criterium"
-#define EMPATHY_PREFS_HINTS_CLOSE_MAIN_WINDOW EMPATHY_PREFS_PATH "/hints/close_main_window"
-#define EMPATHY_PREFS_SALUT_ACCOUNT_CREATED EMPATHY_PREFS_PATH "/accounts/salut_created"
-#define EMPATHY_PREFS_USE_NM EMPATHY_PREFS_PATH "/use_nm"
-#define EMPATHY_PREFS_AUTOCONNECT EMPATHY_PREFS_PATH "/autoconnect"
-
-GtkWidget * empathy_preferences_show (GtkWindow *parent);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_PREFERENCES_H__ */
-
-
diff --git a/libempathy-gtk/empathy-private-chat.c b/libempathy-gtk/empathy-private-chat.c
index 9f84c1273..a9fe6357b 100644
--- a/libempathy-gtk/empathy-private-chat.c
+++ b/libempathy-gtk/empathy-private-chat.c
@@ -45,7 +45,6 @@
#include "empathy-private-chat.h"
#include "empathy-chat-view.h"
#include "empathy-chat.h"
-#include "empathy-preferences.h"
//#include "empathy-sound.h"
#include "empathy-images.h"
#include "empathy-ui-utils.h"
diff --git a/libempathy-gtk/empathy-spell.c b/libempathy-gtk/empathy-spell.c
index b6620118a..db3233294 100644
--- a/libempathy-gtk/empathy-spell.c
+++ b/libempathy-gtk/empathy-spell.c
@@ -36,7 +36,6 @@
#include "empathy-spell.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#define DEBUG_DOMAIN "Spell"
diff --git a/libempathy-gtk/empathy-theme-boxes.c b/libempathy-gtk/empathy-theme-boxes.c
index ebbc18e17..797cb4324 100644
--- a/libempathy-gtk/empathy-theme-boxes.c
+++ b/libempathy-gtk/empathy-theme-boxes.c
@@ -28,7 +28,6 @@
#include <libempathy/empathy-debug.h>
#include "empathy-ui-utils.h"
-#include "empathy-main-window.h"
#include "empathy-theme-boxes.h"
#define DEBUG_DOMAIN "FancyTheme"
diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c
index 94276c964..490fe6ace 100644
--- a/libempathy-gtk/empathy-theme-manager.c
+++ b/libempathy-gtk/empathy-theme-manager.c
@@ -29,7 +29,6 @@
#include "empathy-chat-view.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#include "empathy-theme.h"
#include "empathy-theme-boxes.h"
#include "empathy-theme-irc.h"
diff --git a/libempathy-gtk/empathy-theme.c b/libempathy-gtk/empathy-theme.c
index dae690b5c..5d8e1b80a 100644
--- a/libempathy-gtk/empathy-theme.c
+++ b/libempathy-gtk/empathy-theme.c
@@ -29,7 +29,6 @@
#include "empathy-chat.h"
#include "empathy-conf.h"
-#include "empathy-preferences.h"
#include "empathy-theme.h"
#include "empathy-smiley-manager.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index e064945e8..7c70f78c2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,10 +19,18 @@ bin_PROGRAMS = \
empathy-accounts \
empathy-logs
-empathy_SOURCES = \
- empathy.c \
- bacon-message-connection.c \
- bacon-message-connection.h
+empathy_SOURCES = \
+ empathy.c \
+ bacon-message-connection.c bacon-message-connection.h \
+ empathy-chat-window.c empathy-chat-window.h \
+ empathy-new-chatroom-dialog.c empathy-new-chatroom-dialog.h \
+ empathy-status-icon.c empathy-status-icon.h \
+ empathy-about-dialog.c empathy-about-dialog.h \
+ empathy-chatrooms-window.c empathy-chatrooms-window.h \
+ empathy-main-window.c empathy-main-window.h \
+ empathy-preferences.c empathy-preferences.h \
+ ephy-spinner.c ephy-spinner.h
+
empathy_accounts_SOURCES = empathy-accounts.c
empathy_logs_SOURCES = empathy-logs.c
@@ -51,7 +59,9 @@ CLEANFILES = $(BUILT_SOURCES)
if HAVE_VOIP
libexec_PROGRAMS = empathy-call-chandler
-empathy_call_chandler_SOURCES = empathy-call-chandler.c
+empathy_call_chandler_SOURCES = \
+ empathy-call-chandler.c \
+ empathy-call-window.c empathy-call-window.h
service_DATA += org.gnome.Empathy.Call.service
chandler_DATA += empathy-call.chandler
else
diff --git a/libempathy-gtk/empathy-about-dialog.c b/src/empathy-about-dialog.c
index 5ecf66749..13a8aa353 100644
--- a/libempathy-gtk/empathy-about-dialog.c
+++ b/src/empathy-about-dialog.c
@@ -22,7 +22,7 @@
* Xavier Claessens <xclaesse@gmail.com>
*/
-#include "config.h"
+#include <config.h>
#include <glib/gi18n.h>
#include <gtk/gtkaboutdialog.h>
@@ -30,7 +30,7 @@
#include <glade/glade.h>
#include "empathy-about-dialog.h"
-#include "empathy-ui-utils.h"
+#include <libempathy-gtk/empathy-ui-utils.h>
#define WEB_SITE "http://live.gnome.org/Empathy"
diff --git a/libempathy-gtk/empathy-about-dialog.h b/src/empathy-about-dialog.h
index ff123ab20..ff123ab20 100644
--- a/libempathy-gtk/empathy-about-dialog.h
+++ b/src/empathy-about-dialog.h
diff --git a/libempathy-gtk/empathy-call-window.c b/src/empathy-call-window.c
index c7f202ee3..c7f202ee3 100644
--- a/libempathy-gtk/empathy-call-window.c
+++ b/src/empathy-call-window.c
diff --git a/libempathy-gtk/empathy-call-window.glade b/src/empathy-call-window.glade
index 2eeea0d92..2eeea0d92 100644
--- a/libempathy-gtk/empathy-call-window.glade
+++ b/src/empathy-call-window.glade
diff --git a/libempathy-gtk/empathy-call-window.h b/src/empathy-call-window.h
index 7d65aaeae..7d65aaeae 100644
--- a/libempathy-gtk/empathy-call-window.h
+++ b/src/empathy-call-window.h
diff --git a/libempathy-gtk/empathy-chat-window.c b/src/empathy-chat-window.c
index bbf66fbcf..d0f881bf8 100644
--- a/libempathy-gtk/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -25,7 +25,7 @@
* Xavier Claessens <xclaesse@gmail.com>
*/
-#include "config.h"
+#include <config.h>
#include <string.h>
@@ -44,18 +44,17 @@
#include <libempathy/empathy-message.h>
#include <libempathy/empathy-utils.h>
+#include <libempathy-gtk/empathy-images.h>
+#include <libempathy-gtk/empathy-conf.h>
+#include <libempathy-gtk/empathy-private-chat.h>
+#include <libempathy-gtk/empathy-group-chat.h>
+#include <libempathy-gtk/empathy-contact-dialogs.h>
+#include <libempathy-gtk/empathy-log-window.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+
#include "empathy-chat-window.h"
-#include "empathy-images.h"
-//#include "empathy-chat-invite.h"
-#include "empathy-contact-dialogs.h"
-#include "empathy-log-window.h"
#include "empathy-new-chatroom-dialog.h"
-#include "empathy-conf.h"
#include "empathy-preferences.h"
-#include "empathy-private-chat.h"
-#include "empathy-group-chat.h"
-//#include "empathy-sound.h"
-#include "empathy-ui-utils.h"
#include "empathy-about-dialog.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT_WINDOW, EmpathyChatWindowPriv))
@@ -540,13 +539,30 @@ chat_window_accel_cb (GtkAccelGroup *accelgroup,
}
}
+static EmpathyChatWindow *
+chat_window_find_chat (EmpathyChat *chat)
+{
+ EmpathyChatWindowPriv *priv;
+ GList *l, *ll;
+
+ for (l = chat_windows; l; l = l->next) {
+ priv = GET_PRIV (l->data);
+ ll = g_list_find (priv->chats, chat);
+ if (ll) {
+ return l->data;
+ }
+ }
+
+ return NULL;
+}
+
static void
chat_window_close_clicked_cb (GtkWidget *button,
EmpathyChat *chat)
{
EmpathyChatWindow *window;
- window = empathy_chat_get_window (chat);
+ window = chat_window_find_chat (chat);
empathy_chat_window_remove_chat (window, chat);
}
@@ -1013,15 +1029,10 @@ static void
chat_window_room_set_topic_activate_cb (GtkWidget *menuitem,
EmpathyChatWindow *window)
{
- EmpathyChatWindowPriv *priv;
+ EmpathyChatWindowPriv *priv = GET_PRIV (window);
- priv = GET_PRIV (window);
-
if (empathy_chat_is_group_chat (priv->current_chat)) {
- EmpathyGroupChat *group_chat;
-
- group_chat = EMPATHY_GROUP_CHAT (priv->current_chat);
- empathy_group_chat_set_topic (group_chat);
+ empathy_group_chat_set_topic (EMPATHY_GROUP_CHAT (priv->current_chat));
}
}
@@ -1387,7 +1398,7 @@ chat_window_detach_hook (GtkNotebook *source,
EmpathyChat *chat;
chat = g_object_get_data (G_OBJECT (page), "chat");
- window = empathy_chat_get_window (chat);
+ window = chat_window_find_chat (chat);
new_window = empathy_chat_window_new ();
priv = GET_PRIV (new_window);
@@ -1471,9 +1482,6 @@ chat_window_page_added_cb (GtkNotebook *notebook,
/* Get chat object */
chat = g_object_get_data (G_OBJECT (child), "chat");
- /* Set the chat window */
- empathy_chat_set_window (chat, window);
-
/* Connect chat signals for this window */
g_signal_connect (chat, "status-changed",
G_CALLBACK (chat_window_status_changed_cb),
@@ -1522,9 +1530,6 @@ chat_window_page_removed_cb (GtkNotebook *notebook,
/* Get chat object */
chat = g_object_get_data (G_OBJECT (child), "chat");
- /* Unset the window associated with a chat */
- empathy_chat_set_window (chat, NULL);
-
/* Disconnect all signal handlers for this chat and this window */
g_signal_handlers_disconnect_by_func (chat,
G_CALLBACK (chat_window_status_changed_cb),
@@ -1609,7 +1614,7 @@ chat_window_drag_data_received (GtkWidget *widget,
g_object_unref (account);
g_strfreev (strv);
- old_window = empathy_chat_get_window (chat);
+ old_window = chat_window_find_chat (chat);
if (old_window) {
if (old_window == window) {
gtk_drag_finish (context, TRUE, FALSE, time);
@@ -1622,7 +1627,7 @@ chat_window_drag_data_received (GtkWidget *widget,
}
/* Added to take care of any outstanding chat events */
- empathy_chat_present (chat);
+ empathy_chat_window_present_chat (chat);
/* We should return TRUE to remove the data when doing
* GDK_ACTION_MOVE, but we don't here otherwise it has
@@ -1646,7 +1651,7 @@ chat_window_drag_data_received (GtkWidget *widget,
chat = g_object_get_data (G_OBJECT (*child), "chat");
}
- old_window = empathy_chat_get_window (chat);
+ old_window = chat_window_find_chat (chat);
if (old_window) {
EmpathyChatWindowPriv *priv;
@@ -1722,9 +1727,6 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
/* Reference the chat object */
g_object_ref (chat);
- /* Set the chat window */
- empathy_chat_set_window (chat, window);
-
empathy_chat_load_geometry (chat, &x, &y, &w, &h);
if (x >= 0 && y >= 0) {
@@ -1874,3 +1876,30 @@ empathy_chat_window_find_chat (McAccount *account,
return NULL;
}
+void
+empathy_chat_window_present_chat (EmpathyChat *chat)
+{
+ EmpathyChatWindow *window;
+ EmpathyChatWindowPriv *priv;
+
+ g_return_if_fail (EMPATHY_IS_CHAT (chat));
+
+ window = chat_window_find_chat (chat);
+
+ /* If the chat has no window, create one */
+ if (window == NULL) {
+ window = empathy_chat_window_get_default ();
+ if (!window) {
+ window = empathy_chat_window_new ();
+ }
+
+ empathy_chat_window_add_chat (window, chat);
+ }
+
+ priv = GET_PRIV (window);
+ empathy_chat_window_switch_to_chat (window, chat);
+ empathy_window_present (GTK_WINDOW (priv->dialog), TRUE);
+
+ gtk_widget_grab_focus (chat->input_text_view);
+}
+
diff --git a/libempathy-gtk/empathy-chat-window.h b/src/empathy-chat-window.h
index c79f7519e..32ca13a96 100644
--- a/libempathy-gtk/empathy-chat-window.h
+++ b/src/empathy-chat-window.h
@@ -31,6 +31,7 @@
#include <glib-object.h>
#include <libmissioncontrol/mc-account.h>
+#include <libempathy-gtk/empathy-chat.h>
G_BEGIN_DECLS
@@ -45,8 +46,6 @@ typedef struct _EmpathyChatWindow EmpathyChatWindow;
typedef struct _EmpathyChatWindowClass EmpathyChatWindowClass;
typedef struct _EmpathyChatWindowPriv EmpathyChatWindowPriv;
-#include "empathy-chat.h"
-
struct _EmpathyChatWindow {
GObject parent;
};
@@ -55,26 +54,23 @@ struct _EmpathyChatWindowClass {
GObjectClass parent_class;
};
-GType empathy_chat_window_get_type (void);
-EmpathyChatWindow *empathy_chat_window_get_default (void);
-
-EmpathyChatWindow *empathy_chat_window_new (void);
-
-GtkWidget * empathy_chat_window_get_dialog (EmpathyChatWindow *window);
-
-void empathy_chat_window_add_chat (EmpathyChatWindow *window,
- EmpathyChat *chat);
-void empathy_chat_window_remove_chat (EmpathyChatWindow *window,
- EmpathyChat *chat);
-void empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
- EmpathyChatWindow *new_window,
- EmpathyChat *chat);
-void empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
- EmpathyChat *chat);
-gboolean empathy_chat_window_has_focus (EmpathyChatWindow *window);
-EmpathyChat * empathy_chat_window_find_chat (McAccount *account,
- const gchar *id);
-
+GType empathy_chat_window_get_type (void);
+EmpathyChatWindow *empathy_chat_window_get_default (void);
+EmpathyChatWindow *empathy_chat_window_new (void);
+GtkWidget * empathy_chat_window_get_dialog (EmpathyChatWindow *window);
+void empathy_chat_window_add_chat (EmpathyChatWindow *window,
+ EmpathyChat *chat);
+void empathy_chat_window_remove_chat (EmpathyChatWindow *window,
+ EmpathyChat *chat);
+void empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
+ EmpathyChatWindow *new_window,
+ EmpathyChat *chat);
+void empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
+ EmpathyChat *chat);
+gboolean empathy_chat_window_has_focus (EmpathyChatWindow *window);
+EmpathyChat * empathy_chat_window_find_chat (McAccount *account,
+ const gchar *id);
+void empathy_chat_window_present_chat (EmpathyChat *chat);
G_END_DECLS
#endif /* __EMPATHY_CHAT_WINDOW_H__ */
diff --git a/libempathy-gtk/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c
index 7855f3cf3..0511098c3 100644
--- a/libempathy-gtk/empathy-chatrooms-window.c
+++ b/src/empathy-chatrooms-window.c
@@ -23,7 +23,7 @@
* Mikael Hallendal <micke@imendio.com>
*/
-#include "config.h"
+#include <config.h>
#include <string.h>
#include <stdio.h>
@@ -36,10 +36,11 @@
#include <libempathy/empathy-chatroom-manager.h>
#include <libempathy/empathy-utils.h>
-#include "empathy-account-chooser.h"
+#include <libempathy-gtk/empathy-account-chooser.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+
#include "empathy-chatrooms-window.h"
#include "empathy-new-chatroom-dialog.h"
-#include "empathy-ui-utils.h"
typedef struct {
EmpathyChatroomManager *manager;
diff --git a/libempathy-gtk/empathy-chatrooms-window.glade b/src/empathy-chatrooms-window.glade
index 3316e6e82..3316e6e82 100644
--- a/libempathy-gtk/empathy-chatrooms-window.glade
+++ b/src/empathy-chatrooms-window.glade
diff --git a/libempathy-gtk/empathy-chatrooms-window.h b/src/empathy-chatrooms-window.h
index 179082052..c931c787a 100644
--- a/libempathy-gtk/empathy-chatrooms-window.h
+++ b/src/empathy-chatrooms-window.h
@@ -26,6 +26,8 @@
#ifndef __EMPATHY_CHATROOMS_WINDOW_H__
#define __EMPATHY_CHATROOMS_WINDOW_H__
+#include <gtk/gtk.h>
+
G_BEGIN_DECLS
void empathy_chatrooms_window_show (GtkWindow *parent);
diff --git a/libempathy-gtk/empathy-main-window.c b/src/empathy-main-window.c
index c447c473d..6f3ad5481 100644
--- a/libempathy-gtk/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -38,23 +38,24 @@
#include <libempathy/empathy-contact-factory.h>
#include <libempathy/empathy-status-presets.h>
+#include <libempathy-gtk/empathy-contact-dialogs.h>
+#include <libempathy-gtk/empathy-contact-list-store.h>
+#include <libempathy-gtk/empathy-contact-list-view.h>
+#include <libempathy-gtk/empathy-presence-chooser.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+#include <libempathy-gtk/empathy-geometry.h>
+#include <libempathy-gtk/empathy-conf.h>
+#include <libempathy-gtk/empathy-accounts-dialog.h>
+#include <libempathy-gtk/empathy-log-window.h>
+#include <libempathy-gtk/empathy-new-message-dialog.h>
+#include <libempathy-gtk/empathy-gtk-enum-types.h>
+
#include "empathy-main-window.h"
-#include "empathy-contact-dialogs.h"
#include "ephy-spinner.h"
-#include "empathy-contact-list-store.h"
-#include "empathy-contact-list-view.h"
-#include "empathy-presence-chooser.h"
-#include "empathy-ui-utils.h"
-#include "empathy-geometry.h"
-#include "empathy-conf.h"
#include "empathy-preferences.h"
-#include "empathy-accounts-dialog.h"
#include "empathy-about-dialog.h"
#include "empathy-new-chatroom-dialog.h"
#include "empathy-chatrooms-window.h"
-#include "empathy-log-window.h"
-#include "empathy-new-message-dialog.h"
-#include "empathy-gtk-enum-types.h"
#define DEBUG_DOMAIN "MainWindow"
diff --git a/libempathy-gtk/empathy-main-window.glade b/src/empathy-main-window.glade
index 5ac2187b5..5ac2187b5 100644
--- a/libempathy-gtk/empathy-main-window.glade
+++ b/src/empathy-main-window.glade
diff --git a/libempathy-gtk/empathy-main-window.h b/src/empathy-main-window.h
index 669a97872..669a97872 100644
--- a/libempathy-gtk/empathy-main-window.h
+++ b/src/empathy-main-window.h
diff --git a/libempathy-gtk/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c
index b33439407..b8be23add 100644
--- a/libempathy-gtk/empathy-new-chatroom-dialog.c
+++ b/src/empathy-new-chatroom-dialog.c
@@ -22,7 +22,7 @@
* Xavier Claessens <xclaesse@gmail.com>
*/
-#include "config.h"
+#include <config.h>
#include <string.h>
#include <stdio.h>
@@ -41,9 +41,10 @@
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-debug.h>
+#include <libempathy-gtk/empathy-account-chooser.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+
#include "empathy-new-chatroom-dialog.h"
-#include "empathy-account-chooser.h"
-#include "empathy-ui-utils.h"
#include "ephy-spinner.h"
#define DEBUG_DOMAIN "NewChatroomDialog"
diff --git a/libempathy-gtk/empathy-new-chatroom-dialog.glade b/src/empathy-new-chatroom-dialog.glade
index 1ba74ec32..1ba74ec32 100644
--- a/libempathy-gtk/empathy-new-chatroom-dialog.glade
+++ b/src/empathy-new-chatroom-dialog.glade
diff --git a/libempathy-gtk/empathy-new-chatroom-dialog.h b/src/empathy-new-chatroom-dialog.h
index 2a126085d..2a126085d 100644
--- a/libempathy-gtk/empathy-new-chatroom-dialog.h
+++ b/src/empathy-new-chatroom-dialog.h
diff --git a/libempathy-gtk/empathy-preferences.c b/src/empathy-preferences.c
index 1b6466683..1304c58ef 100644
--- a/libempathy-gtk/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -22,7 +22,7 @@
* Martyn Russell <martyn@imendio.com>
*/
-#include "config.h"
+#include <config.h>
#include <string.h>
@@ -30,13 +30,14 @@
#include <glade/glade.h>
#include <glib/gi18n.h>
-#include "empathy-conf.h"
+#include <libempathy-gtk/empathy-conf.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+#include <libempathy-gtk/empathy-theme-manager.h>
+#include <libempathy-gtk/empathy-spell.h>
+#include <libempathy-gtk/empathy-contact-list-store.h>
+#include <libempathy-gtk/empathy-gtk-enum-types.h>
+
#include "empathy-preferences.h"
-#include "empathy-ui-utils.h"
-#include "empathy-theme-manager.h"
-#include "empathy-spell.h"
-#include "empathy-contact-list-store.h"
-#include "empathy-gtk-enum-types.h"
typedef struct {
GtkWidget *dialog;
diff --git a/libempathy-gtk/empathy-preferences.glade b/src/empathy-preferences.glade
index bf03da6e5..bf03da6e5 100644
--- a/libempathy-gtk/empathy-preferences.glade
+++ b/src/empathy-preferences.glade
diff --git a/src/empathy-preferences.h b/src/empathy-preferences.h
new file mode 100644
index 000000000..07ae6b523
--- /dev/null
+++ b/src/empathy-preferences.h
@@ -0,0 +1,38 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2003-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: Mikael Hallendal <micke@imendio.com>
+ * Richard Hult <richard@imendio.com>
+ * Martyn Russell <martyn@imendio.com>
+ */
+
+#ifndef __EMPATHY_PREFERENCES_H__
+#define __EMPATHY_PREFERENCES_H__
+
+#include <gtk/gtkwindow.h>
+
+G_BEGIN_DECLS
+
+GtkWidget * empathy_preferences_show (GtkWindow *parent);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_PREFERENCES_H__ */
+
+
diff --git a/libempathy-gtk/empathy-status-icon.c b/src/empathy-status-icon.c
index 241a2841f..07224b06c 100644
--- a/libempathy-gtk/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -38,15 +38,16 @@
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-filter.h>
+#include <libempathy-gtk/empathy-contact-dialogs.h>
+#include <libempathy-gtk/empathy-presence-chooser.h>
+#include <libempathy-gtk/empathy-conf.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+#include <libempathy-gtk/empathy-accounts-dialog.h>
+#include <libempathy-gtk/empathy-images.h>
+#include <libempathy-gtk/empathy-new-message-dialog.h>
+
#include "empathy-status-icon.h"
-#include "empathy-contact-dialogs.h"
-#include "empathy-presence-chooser.h"
-#include "empathy-conf.h"
#include "empathy-preferences.h"
-#include "empathy-ui-utils.h"
-#include "empathy-accounts-dialog.h"
-#include "empathy-images.h"
-#include "empathy-new-message-dialog.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
diff --git a/libempathy-gtk/empathy-status-icon.glade b/src/empathy-status-icon.glade
index ab0f09f84..ab0f09f84 100644
--- a/libempathy-gtk/empathy-status-icon.glade
+++ b/src/empathy-status-icon.glade
diff --git a/libempathy-gtk/empathy-status-icon.h b/src/empathy-status-icon.h
index a7ca3c395..a7ca3c395 100644
--- a/libempathy-gtk/empathy-status-icon.h
+++ b/src/empathy-status-icon.h
diff --git a/src/empathy.c b/src/empathy.c
index d261cd54b..38060912c 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -51,8 +51,8 @@
#include <libempathy-gtk/empathy-chat.h>
#include <libempathy-gtk/empathy-private-chat.h>
#include <libempathy-gtk/empathy-group-chat.h>
-#include <libempathy-gtk/empathy-chat-window.h>
+#include "empathy-chat-window.h"
#include "bacon-message-connection.h"
#define DEBUG_DOMAIN "EmpathyMain"
@@ -89,7 +89,7 @@ new_text_channel_cb (EmpathyChandler *chandler,
empathy_chat_set_tp_chat (chat, tp_chat);
g_object_unref (tp_chat);
}
- empathy_chat_present (chat);
+ empathy_chat_window_present_chat (chat);
g_object_unref (account);
return;
@@ -112,7 +112,7 @@ new_text_channel_cb (EmpathyChandler *chandler,
return;
}
- empathy_chat_present (chat);
+ empathy_chat_window_present_chat (chat);
g_object_unref (chat);
g_object_unref (account);
diff --git a/libempathy-gtk/ephy-spinner.c b/src/ephy-spinner.c
index a8f371df3..b67b90f76 100644
--- a/libempathy-gtk/ephy-spinner.c
+++ b/src/ephy-spinner.c
@@ -24,7 +24,7 @@
* $Id: ephy-spinner.c 2114 2006-12-25 12:15:00Z mr $
*/
-#include "config.h"
+#include <config.h>
#include "ephy-spinner.h"
diff --git a/libempathy-gtk/ephy-spinner.h b/src/ephy-spinner.h
index 4435fe371..4435fe371 100644
--- a/libempathy-gtk/ephy-spinner.h
+++ b/src/ephy-spinner.h