aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-07-04 00:09:22 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-07-04 00:09:22 +0800
commit62a4d9c5b1a1035ddc8226ed1363054acd18df6e (patch)
treea4ddde7969ff63917ec4643efeff7b0cbff72122 /libempathy-gtk
parent8d6e6536e87618d0e479240321515b2b1e15821e (diff)
downloadgsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.tar
gsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.tar.gz
gsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.tar.bz2
gsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.tar.lz
gsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.tar.xz
gsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.tar.zst
gsoc2013-empathy-62a4d9c5b1a1035ddc8226ed1363054acd18df6e.zip
Added Send menu item to the chat input menu. Fixes bug #532622 (Jonny Lamb).
This allows users to send messages by just using the mouse. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1188 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 825cb740b..ba67cb670 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -925,6 +925,13 @@ chat_text_check_word_spelling_cb (GtkMenuItem *menuitem,
}
static void
+chat_text_send_cb (GtkMenuItem *menuitem,
+ EmpathyChat *chat)
+{
+ chat_input_text_view_send (chat);
+}
+
+static void
chat_input_populate_popup_cb (GtkTextView *view,
GtkMenu *menu,
EmpathyChat *chat)
@@ -941,6 +948,7 @@ chat_input_populate_popup_cb (GtkTextView *view,
GtkWidget *smiley_menu;
priv = GET_PRIV (chat);
+ buffer = gtk_text_view_get_buffer (view);
/* Add the emoticon menu. */
item = gtk_separator_menu_item_new ();
@@ -956,8 +964,21 @@ chat_input_populate_popup_cb (GtkTextView *view,
chat);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), smiley_menu);
+ /* Add the Send menu item. */
+ gtk_text_buffer_get_bounds (buffer, &start, &end);
+ str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+
+ if (!G_STR_EMPTY (str)) {
+ item = gtk_menu_item_new_with_mnemonic (_("_Send"));
+ g_signal_connect (G_OBJECT (item), "activate",
+ G_CALLBACK (chat_text_send_cb), chat);
+ gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show (item);
+ }
+
+ str = NULL;
+
/* Add the spell check menu item. */
- buffer = gtk_text_view_get_buffer (view);
table = gtk_text_buffer_get_tag_table (buffer);
tag = gtk_text_tag_table_lookup (table, "misspelled");