aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-03-14 09:58:00 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-03-14 09:58:00 +0800
commit8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd (patch)
tree5c1858c474144e0cd511fc6891e9d21ef978c5e3 /src
parent2e3e5e8e732fbc2e4d3ed61892aefa09efabbfc2 (diff)
parentc0eca0414ca529da3b083c099ec3031436420b00 (diff)
downloadgsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.tar
gsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.tar.gz
gsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.tar.bz2
gsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.tar.lz
gsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.tar.xz
gsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.tar.zst
gsoc2013-empathy-8e6a977d36aea1eb4b429ddee84cb9b4bc4142cd.zip
Merge branch 'glassrose-contact-blocking-rebase'
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c7
-rw-r--r--src/empathy-main-window.c17
-rw-r--r--src/empathy-main-window.ui7
3 files changed, 28 insertions, 3 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 799a8254d..23c93a15b 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -417,12 +417,15 @@ chat_window_contact_menu_update (EmpathyChatWindowPriv *priv,
if (orig_submenu == NULL || !gtk_widget_get_visible (orig_submenu)) {
submenu = empathy_chat_get_contact_menu (priv->current_chat);
+
if (submenu != NULL) {
+ /* gtk_menu_attach_to_widget() doesn't behave nicely here */
+ g_object_set_data (G_OBJECT (submenu), "window", priv->dialog);
+
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
gtk_widget_show (menu);
gtk_widget_set_sensitive (menu, TRUE);
- }
- else {
+ } else {
gtk_widget_set_sensitive (menu, FALSE);
}
} else {
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 8f08f74be..12b99ba5f 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -50,6 +50,7 @@
#include <libempathy-gtk/empathy-contact-list-store.h>
#include <libempathy-gtk/empathy-contact-list-view.h>
#include <libempathy-gtk/empathy-live-search.h>
+#include <libempathy-gtk/empathy-contact-blocking-dialog.h>
#include <libempathy-gtk/empathy-contact-search-dialog.h>
#include <libempathy-gtk/empathy-geometry.h>
#include <libempathy-gtk/empathy-gtk-enum-types.h>
@@ -1464,6 +1465,18 @@ main_window_edit_personal_information_cb (GtkAction *action,
}
static void
+main_window_edit_blocked_contacts_cb (GtkAction *action,
+ EmpathyMainWindow *window)
+{
+ GtkWidget *dialog;
+
+ dialog = empathy_contact_blocking_dialog_new (GTK_WINDOW (window));
+ gtk_widget_show (dialog);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
+}
+
+static void
main_window_edit_preferences_cb (GtkAction *action,
EmpathyMainWindow *window)
{
@@ -1622,7 +1635,8 @@ main_window_connection_items_setup (EmpathyMainWindow *window,
"chat_new_message",
"chat_new_call",
"chat_add_contact",
- "edit_personal_information"
+ "edit_personal_information",
+ "edit_blocked_contacts"
};
for (i = 0, list = NULL; i < G_N_ELEMENTS (actions_connected); i++) {
@@ -1801,6 +1815,7 @@ empathy_main_window_init (EmpathyMainWindow *window)
"edit", "activate", main_window_edit_cb,
"edit_accounts", "activate", main_window_edit_accounts_cb,
"edit_personal_information", "activate", main_window_edit_personal_information_cb,
+ "edit_blocked_contacts", "activate", main_window_edit_blocked_contacts_cb,
"edit_preferences", "activate", main_window_edit_preferences_cb,
"edit_search_contacts", "activate", main_window_edit_search_contacts_cb,
"help_about", "activate", main_window_help_about_cb,
diff --git a/src/empathy-main-window.ui b/src/empathy-main-window.ui
index 0cfd6bee4..217b276f2 100644
--- a/src/empathy-main-window.ui
+++ b/src/empathy-main-window.ui
@@ -107,6 +107,12 @@
</object>
</child>
<child>
+ <object class="GtkAction" id="edit_blocked_contacts">
+ <property name="name">edit_blocked_contacts</property>
+ <property name="label" translatable="yes">_Blocked Contacts</property>
+ </object>
+ </child>
+ <child>
<object class="GtkAction" id="edit_preferences">
<property name="stock_id">gtk-preferences</property>
<property name="name">edit_preferences</property>
@@ -249,6 +255,7 @@
<menuitem action="edit_accounts"/>
<menuitem action="edit_personal_information"/>
<menuitem action="edit_search_contacts"/>
+ <menuitem action="edit_blocked_contacts"/>
<separator/>
<menuitem action="edit_preferences"/>
</menu>