From 398e3bc61957f0503027d32a779da21daab3b5e1 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 13 Mar 2008 17:41:08 +0000 Subject: [PATCH] Move modules that make no sense to be used in other applicaton from libempathy-gtk/ to src/ svn path=/trunk/; revision=789 --- libempathy-gtk/Makefile.am | 125 +++++++----------- libempathy-gtk/empathy-avatar-chooser.c | 1 - libempathy-gtk/empathy-chat-view.c | 1 - libempathy-gtk/empathy-chat.c | 111 +++++----------- libempathy-gtk/empathy-chat.h | 5 - libempathy-gtk/empathy-conf.h | 23 ++++ libempathy-gtk/empathy-group-chat.c | 97 ++++++-------- libempathy-gtk/empathy-preferences.h | 62 --------- libempathy-gtk/empathy-private-chat.c | 1 - libempathy-gtk/empathy-spell.c | 1 - libempathy-gtk/empathy-theme-boxes.c | 1 - libempathy-gtk/empathy-theme-manager.c | 1 - libempathy-gtk/empathy-theme.c | 1 - src/Makefile.am | 20 ++- .../empathy-about-dialog.c | 4 +- .../empathy-about-dialog.h | 0 {libempathy-gtk => src}/empathy-call-window.c | 0 .../empathy-call-window.glade | 0 {libempathy-gtk => src}/empathy-call-window.h | 0 {libempathy-gtk => src}/empathy-chat-window.c | 91 ++++++++----- {libempathy-gtk => src}/empathy-chat-window.h | 40 +++--- .../empathy-chatrooms-window.c | 7 +- .../empathy-chatrooms-window.glade | 0 .../empathy-chatrooms-window.h | 2 + {libempathy-gtk => src}/empathy-main-window.c | 23 ++-- .../empathy-main-window.glade | 0 {libempathy-gtk => src}/empathy-main-window.h | 0 .../empathy-new-chatroom-dialog.c | 7 +- .../empathy-new-chatroom-dialog.glade | 0 .../empathy-new-chatroom-dialog.h | 0 {libempathy-gtk => src}/empathy-preferences.c | 15 ++- .../empathy-preferences.glade | 0 src/empathy-preferences.h | 38 ++++++ {libempathy-gtk => src}/empathy-status-icon.c | 15 ++- .../empathy-status-icon.glade | 0 {libempathy-gtk => src}/empathy-status-icon.h | 0 src/empathy.c | 6 +- {libempathy-gtk => src}/ephy-spinner.c | 2 +- {libempathy-gtk => src}/ephy-spinner.h | 0 39 files changed, 323 insertions(+), 377 deletions(-) delete mode 100644 libempathy-gtk/empathy-preferences.h rename {libempathy-gtk => src}/empathy-about-dialog.c (98%) rename {libempathy-gtk => src}/empathy-about-dialog.h (100%) rename {libempathy-gtk => src}/empathy-call-window.c (100%) rename {libempathy-gtk => src}/empathy-call-window.glade (100%) rename {libempathy-gtk => src}/empathy-call-window.h (100%) rename {libempathy-gtk => src}/empathy-chat-window.c (97%) rename {libempathy-gtk => src}/empathy-chat-window.h (70%) rename {libempathy-gtk => src}/empathy-chatrooms-window.c (99%) rename {libempathy-gtk => src}/empathy-chatrooms-window.glade (100%) rename {libempathy-gtk => src}/empathy-chatrooms-window.h (98%) rename {libempathy-gtk => src}/empathy-main-window.c (98%) rename {libempathy-gtk => src}/empathy-main-window.glade (100%) rename {libempathy-gtk => src}/empathy-main-window.h (100%) rename {libempathy-gtk => src}/empathy-new-chatroom-dialog.c (99%) rename {libempathy-gtk => src}/empathy-new-chatroom-dialog.glade (100%) rename {libempathy-gtk => src}/empathy-new-chatroom-dialog.h (100%) rename {libempathy-gtk => src}/empathy-preferences.c (98%) rename {libempathy-gtk => src}/empathy-preferences.glade (100%) create mode 100644 src/empathy-preferences.h rename {libempathy-gtk => src}/empathy-status-icon.c (98%) rename {libempathy-gtk => src}/empathy-status-icon.glade (100%) rename {libempathy-gtk => src}/empathy-status-icon.h (100%) rename {libempathy-gtk => src}/ephy-spinner.c (99%) rename {libempathy-gtk => src}/ephy-spinner.h (100%) diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index 88e10794..d29a11f6 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 7ff34e81..99132b8a 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 af523180..7682bf3a 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 1b2fcccb..50a37003 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -42,10 +42,8 @@ #include #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 = >K_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 = >K_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 = >K_WIDGET (chat->view)->allocation; - dialog = empathy_chat_window_get_dialog (priv->window); - gtk_window_get_size (GTK_WINDOW (dialog), NULL, ¤t_height); + dialog = empathy_get_toplevel_window (priv->widget); + gtk_window_get_size (dialog, NULL, ¤t_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 @@ -1579,26 +1577,6 @@ empathy_chat_clear (EmpathyChat *chat) empathy_chat_view_clear (chat->view); } -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) { @@ -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 bcf382e5..d235c08a 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 7e8e60e2..c1e49135 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 007e6947..909e2316 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 750666b0..00000000 --- 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 - * Richard Hult - * Martyn Russell - */ - -#ifndef __EMPATHY_PREFERENCES_H__ -#define __EMPATHY_PREFERENCES_H__ - -#include - -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 9f84c127..a9fe6357 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 b6620118..db323329 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 ebbc18e1..797cb432 100644 --- a/libempathy-gtk/empathy-theme-boxes.c +++ b/libempathy-gtk/empathy-theme-boxes.c @@ -28,7 +28,6 @@ #include #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 94276c96..490fe6ac 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 dae690b5..5d8e1b80 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 e064945e..7c70f78c 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 similarity index 98% rename from libempathy-gtk/empathy-about-dialog.c rename to src/empathy-about-dialog.c index 5ecf6674..13a8aa35 100644 --- a/libempathy-gtk/empathy-about-dialog.c +++ b/src/empathy-about-dialog.c @@ -22,7 +22,7 @@ * Xavier Claessens */ -#include "config.h" +#include #include #include @@ -30,7 +30,7 @@ #include #include "empathy-about-dialog.h" -#include "empathy-ui-utils.h" +#include #define WEB_SITE "http://live.gnome.org/Empathy" diff --git a/libempathy-gtk/empathy-about-dialog.h b/src/empathy-about-dialog.h similarity index 100% rename from libempathy-gtk/empathy-about-dialog.h rename to src/empathy-about-dialog.h diff --git a/libempathy-gtk/empathy-call-window.c b/src/empathy-call-window.c similarity index 100% rename from libempathy-gtk/empathy-call-window.c rename to src/empathy-call-window.c diff --git a/libempathy-gtk/empathy-call-window.glade b/src/empathy-call-window.glade similarity index 100% rename from libempathy-gtk/empathy-call-window.glade rename to src/empathy-call-window.glade diff --git a/libempathy-gtk/empathy-call-window.h b/src/empathy-call-window.h similarity index 100% rename from libempathy-gtk/empathy-call-window.h rename to src/empathy-call-window.h diff --git a/libempathy-gtk/empathy-chat-window.c b/src/empathy-chat-window.c similarity index 97% rename from libempathy-gtk/empathy-chat-window.c rename to src/empathy-chat-window.c index bbf66fbc..d0f881bf 100644 --- a/libempathy-gtk/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -25,7 +25,7 @@ * Xavier Claessens */ -#include "config.h" +#include #include @@ -44,18 +44,17 @@ #include #include +#include +#include +#include +#include +#include +#include +#include + #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 similarity index 70% rename from libempathy-gtk/empathy-chat-window.h rename to src/empathy-chat-window.h index c79f7519..32ca13a9 100644 --- a/libempathy-gtk/empathy-chat-window.h +++ b/src/empathy-chat-window.h @@ -31,6 +31,7 @@ #include #include +#include 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 similarity index 99% rename from libempathy-gtk/empathy-chatrooms-window.c rename to src/empathy-chatrooms-window.c index 7855f3cf..0511098c 100644 --- a/libempathy-gtk/empathy-chatrooms-window.c +++ b/src/empathy-chatrooms-window.c @@ -23,7 +23,7 @@ * Mikael Hallendal */ -#include "config.h" +#include #include #include @@ -36,10 +36,11 @@ #include #include -#include "empathy-account-chooser.h" +#include +#include + #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 similarity index 100% rename from libempathy-gtk/empathy-chatrooms-window.glade rename to src/empathy-chatrooms-window.glade diff --git a/libempathy-gtk/empathy-chatrooms-window.h b/src/empathy-chatrooms-window.h similarity index 98% rename from libempathy-gtk/empathy-chatrooms-window.h rename to src/empathy-chatrooms-window.h index 17908205..c931c787 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 + 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 similarity index 98% rename from libempathy-gtk/empathy-main-window.c rename to src/empathy-main-window.c index c447c473..6f3ad548 100644 --- a/libempathy-gtk/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -38,23 +38,24 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #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 similarity index 100% rename from libempathy-gtk/empathy-main-window.glade rename to src/empathy-main-window.glade diff --git a/libempathy-gtk/empathy-main-window.h b/src/empathy-main-window.h similarity index 100% rename from libempathy-gtk/empathy-main-window.h rename to src/empathy-main-window.h diff --git a/libempathy-gtk/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c similarity index 99% rename from libempathy-gtk/empathy-new-chatroom-dialog.c rename to src/empathy-new-chatroom-dialog.c index b3343940..b8be23ad 100644 --- a/libempathy-gtk/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -22,7 +22,7 @@ * Xavier Claessens */ -#include "config.h" +#include #include #include @@ -41,9 +41,10 @@ #include #include +#include +#include + #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 similarity index 100% rename from libempathy-gtk/empathy-new-chatroom-dialog.glade rename to src/empathy-new-chatroom-dialog.glade diff --git a/libempathy-gtk/empathy-new-chatroom-dialog.h b/src/empathy-new-chatroom-dialog.h similarity index 100% rename from libempathy-gtk/empathy-new-chatroom-dialog.h rename to src/empathy-new-chatroom-dialog.h diff --git a/libempathy-gtk/empathy-preferences.c b/src/empathy-preferences.c similarity index 98% rename from libempathy-gtk/empathy-preferences.c rename to src/empathy-preferences.c index 1b646668..1304c58e 100644 --- a/libempathy-gtk/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -22,7 +22,7 @@ * Martyn Russell */ -#include "config.h" +#include #include @@ -30,13 +30,14 @@ #include #include -#include "empathy-conf.h" +#include +#include +#include +#include +#include +#include + #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 similarity index 100% rename from libempathy-gtk/empathy-preferences.glade rename to src/empathy-preferences.glade diff --git a/src/empathy-preferences.h b/src/empathy-preferences.h new file mode 100644 index 00000000..07ae6b52 --- /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 + * Richard Hult + * Martyn Russell + */ + +#ifndef __EMPATHY_PREFERENCES_H__ +#define __EMPATHY_PREFERENCES_H__ + +#include + +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 similarity index 98% rename from libempathy-gtk/empathy-status-icon.c rename to src/empathy-status-icon.c index 241a2841..07224b06 100644 --- a/libempathy-gtk/empathy-status-icon.c +++ b/src/empathy-status-icon.c @@ -38,15 +38,16 @@ #include #include +#include +#include +#include +#include +#include +#include +#include + #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 similarity index 100% rename from libempathy-gtk/empathy-status-icon.glade rename to src/empathy-status-icon.glade diff --git a/libempathy-gtk/empathy-status-icon.h b/src/empathy-status-icon.h similarity index 100% rename from libempathy-gtk/empathy-status-icon.h rename to src/empathy-status-icon.h diff --git a/src/empathy.c b/src/empathy.c index d261cd54..38060912 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -51,8 +51,8 @@ #include #include #include -#include +#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 similarity index 99% rename from libempathy-gtk/ephy-spinner.c rename to src/ephy-spinner.c index a8f371df..b67b90f7 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 #include "ephy-spinner.h" diff --git a/libempathy-gtk/ephy-spinner.h b/src/ephy-spinner.h similarity index 100% rename from libempathy-gtk/ephy-spinner.h rename to src/ephy-spinner.h -- 2.39.2