aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-group-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-14 01:41:08 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-14 01:41:08 +0800
commit398e3bc61957f0503027d32a779da21daab3b5e1 (patch)
treead3bef8bbc0f4c69b9792fc7e0e873c9000eb729 /libempathy-gtk/empathy-group-chat.c
parentab2a4adf50fda468b9dce80c883a406802acd570 (diff)
downloadgsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.tar
gsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.tar.gz
gsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.tar.bz2
gsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.tar.lz
gsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.tar.xz
gsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.tar.zst
gsoc2013-empathy-398e3bc61957f0503027d32a779da21daab3b5e1.zip
Move modules that make no sense to be used in other applicaton from libempathy-gtk/ to src/
svn path=/trunk/; revision=789
Diffstat (limited to 'libempathy-gtk/empathy-group-chat.c')
-rw-r--r--libempathy-gtk/empathy-group-chat.c97
1 files changed, 44 insertions, 53 deletions
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)
{