[nautilus] previewer: add a wrapper for the Close() remote method
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] previewer: add a wrapper for the Close() remote method
- Date: Mon, 1 Aug 2011 11:10:18 +0000 (UTC)
commit f05eaaad2ef96338622c035696148be852c4aca0
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Aug 1 13:07:52 2011 +0200
previewer: add a wrapper for the Close() remote method
src/nautilus-previewer.c | 23 +++++++++++++++++++++++
src/nautilus-previewer.h | 1 +
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-previewer.c b/src/nautilus-previewer.c
index e585187..742e083 100644
--- a/src/nautilus-previewer.c
+++ b/src/nautilus-previewer.c
@@ -175,3 +175,26 @@ nautilus_previewer_call_show_file (NautilusPreviewer *self,
previewer_show_file_ready_cb,
g_object_ref (self));
}
+
+void
+nautilus_previewer_call_close (NautilusPreviewer *self)
+{
+ if (self->priv->connection == NULL) {
+ g_printerr ("No DBus connection available");
+ return;
+ }
+
+ /* don't autostart the previewer if it's not running */
+ g_dbus_connection_call (self->priv->connection,
+ PREVIEWER_DBUS_NAME,
+ PREVIEWER_DBUS_PATH,
+ PREVIEWER_DBUS_IFACE,
+ "Close",
+ NULL,
+ NULL,
+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
+ -1,
+ NULL,
+ previewer_close_ready_cb,
+ g_object_ref (self));
+}
diff --git a/src/nautilus-previewer.h b/src/nautilus-previewer.h
index 30fa652..8f10c22 100644
--- a/src/nautilus-previewer.h
+++ b/src/nautilus-previewer.h
@@ -60,6 +60,7 @@ void nautilus_previewer_call_show_file (NautilusPreviewer *previewer,
const gchar *uri,
guint xid,
gboolean close_if_already_visible);
+void nautilus_previewer_call_close (NautilusPreviewer *previewer);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]