diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 19:21:58 +0800 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 19:22:01 +0800 |
commit | 897bfbce7f3333362e2dd16bb5e4986aa8fa64cd (patch) | |
tree | c56855ccef47b281988ebacbb91f6a726cbaeb84 | |
parent | b5f6788106bbd8c3e06fef09edb533812114afa7 (diff) | |
parent | 6ac9f42fa93a79064c4b69828cc8354114f1b2f0 (diff) | |
download | gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.tar gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.tar.gz gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.tar.bz2 gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.tar.lz gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.tar.xz gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.tar.zst gsoc2013-empathy-897bfbce7f3333362e2dd16bb5e4986aa8fa64cd.zip |
Merge branch 'blockade'
https://bugzilla.gnome.org/show_bug.cgi?id=656167
-rw-r--r-- | libempathy-gtk/empathy-contact-blocking-dialog.c | 12 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-blocking-dialog.ui | 23 | ||||
-rw-r--r-- | libempathy/empathy-tp-contact-list.c | 14 | ||||
-rw-r--r-- | tests/interactive/test-empathy-contact-blocking-dialog.c | 9 |
4 files changed, 38 insertions, 20 deletions
diff --git a/libempathy-gtk/empathy-contact-blocking-dialog.c b/libempathy-gtk/empathy-contact-blocking-dialog.c index 1cb2b279c..404dab172 100644 --- a/libempathy-gtk/empathy-contact-blocking-dialog.c +++ b/libempathy-gtk/empathy-contact-blocking-dialog.c @@ -758,9 +758,11 @@ empathy_contact_blocking_dialog_init (EmpathyContactBlockingDialog *self) GtkBuilder *gui; char *filename; GtkWidget *contents; - GtkWidget *account_hbox, *blocked_contacts_view; + GtkWidget *account_hbox, *blocked_contacts_view, *blocked_contacts_sw, + *remove_toolbar; GtkEntryCompletion *completion; TpAccountManager *am; + GtkStyleContext *context; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EMPATHY_TYPE_CONTACT_BLOCKING_DIALOG, @@ -782,8 +784,10 @@ empathy_contact_blocking_dialog_init (EmpathyContactBlockingDialog *self) "add-button", &self->priv->add_button, "add-contact-entry", &self->priv->add_contact_entry, "blocked-contacts", &self->priv->blocked_contacts, + "blocked-contacts-sw", &blocked_contacts_sw, "blocked-contacts-view", &blocked_contacts_view, "remove-button", &self->priv->remove_button, + "remove-toolbar", &remove_toolbar, NULL); empathy_builder_connect (gui, self, @@ -792,6 +796,12 @@ empathy_contact_blocking_dialog_init (EmpathyContactBlockingDialog *self) "remove-button", "clicked", contact_blocking_dialog_remove_contacts, NULL); + /* join the remove toolbar to the treeview */ + context = gtk_widget_get_style_context (blocked_contacts_sw); + gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM); + context = gtk_widget_get_style_context (remove_toolbar); + gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP); + /* add the contents to the dialog */ gtk_container_add ( GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (self))), diff --git a/libempathy-gtk/empathy-contact-blocking-dialog.ui b/libempathy-gtk/empathy-contact-blocking-dialog.ui index 2e943105e..78dd1cd2d 100644 --- a/libempathy-gtk/empathy-contact-blocking-dialog.ui +++ b/libempathy-gtk/empathy-contact-blocking-dialog.ui @@ -39,16 +39,17 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox1"> + <object class="GtkVBox" id="blocked-contacts-vbox"> <property name="visible">True</property> - <property name="spacing">6</property> <child> - <object class="GtkScrolledWindow" id="scrolledwindow1"> + <object class="GtkScrolledWindow" id="blocked-contacts-sw"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> <property name="vscrollbar_policy">automatic</property> <property name="shadow_type">etched-in</property> + <property name="width_request">408</property> + <property name="height_request">252</property> <child> <object class="GtkTreeView" id="blocked-contacts-view"> <property name="visible">True</property> @@ -77,22 +78,24 @@ </packing> </child> <child> - <object class="GtkVButtonBox" id="vbuttonbox1"> + <object class="GtkToolbar" id="remove-toolbar"> <property name="visible">True</property> - <property name="layout_style">start</property> + <property name="icon_size">1</property> + <style> + <class name="inline-toolbar"/> + </style> <child> - <object class="GtkButton" id="remove-button"> - <property name="label">gtk-remove</property> + <object class="GtkToolButton" id="remove-button"> + <property name="stock_id">gtk-remove</property> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_stock">True</property> + <property name="tooltip-text" translatable="yes">Remove</property> </object> <packing> <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> + <property name="homogeneous">True</property> </packing> </child> </object> diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index d947e7284..11990a9a2 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -821,7 +821,19 @@ list_get_contact_blocking_capabilities_cb (TpProxy *conn, EmpathyTpContactListPriv *priv = GET_PRIV (list); TpContactBlockingCapabilities caps; - g_return_if_fail (G_VALUE_HOLDS_UINT (value)); + if (in_error != NULL) { + DEBUG ("Get(Blocking, ContactBlockingCapabilities) on %s failed: %s", + tp_proxy_get_object_path (conn), + in_error->message); + return; + } + + if (!G_VALUE_HOLDS_UINT (value)) { + DEBUG ("Get(Blocking, ContactBlockingCapabilities) on %s returned a %s, not a uint", + tp_proxy_get_object_path (conn), + G_VALUE_TYPE_NAME (value)); + return; + } caps = g_value_get_uint (value); diff --git a/tests/interactive/test-empathy-contact-blocking-dialog.c b/tests/interactive/test-empathy-contact-blocking-dialog.c index 6c5615ec3..801bd0b50 100644 --- a/tests/interactive/test-empathy-contact-blocking-dialog.c +++ b/tests/interactive/test-empathy-contact-blocking-dialog.c @@ -41,15 +41,8 @@ main (int argc, manager = empathy_contact_manager_dup_singleton (); dialog = empathy_contact_blocking_dialog_new (NULL); - g_signal_connect_swapped (dialog, "response", - G_CALLBACK (gtk_main_quit), NULL); + gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_show (dialog); - - gtk_main (); - - gtk_widget_destroy (dialog); g_object_unref (manager); - return 0; } |