[nautilus/freedesktop-dbus] Add nautilus_application_open_location()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/freedesktop-dbus] Add nautilus_application_open_location()
- Date: Wed, 14 Dec 2011 00:18:33 +0000 (UTC)
commit 29ecfd7fb83c57289fc5e46a05cbead958f4b1ef
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 13 17:47:32 2011 -0600
Add nautilus_application_open_location()
This is a convenience function so that NautilusFreedesktopDBus can cause
the application to open a location and optionally select an item
within that location.
Signed-off-by: Federico Mena Quintero <federico gnome org>
src/nautilus-application.c | 30 ++++++++++++++++++++++++++++++
src/nautilus-application.h | 5 +++++
2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index cb47a60..7bb55b7 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -729,6 +729,36 @@ open_windows (NautilusApplication *application,
}
}
+void
+nautilus_application_open_location (NautilusApplication *application,
+ GFile *location,
+ GFile *selection,
+ const char *startup_id)
+{
+ NautilusWindow *window;
+ GList sel_list;
+ GList *sel_list_ptr;
+
+ window = nautilus_application_create_window (application, gdk_screen_get_default ());
+ gtk_window_set_startup_id (GTK_WINDOW (window), startup_id);
+
+ if (selection) {
+ sel_list.data = nautilus_file_get (selection);
+ sel_list.prev = sel_list.next = NULL;
+ sel_list_ptr = &sel_list;
+ } else
+ sel_list_ptr = NULL;
+
+ nautilus_window_slot_open_location (nautilus_window_get_active_slot (window),
+ location,
+ 0,
+ sel_list_ptr);
+
+ if (sel_list_ptr)
+ g_object_unref (sel_list.data);
+}
+
+
static void
nautilus_application_open (GApplication *app,
GFile **files,
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 278065a..d44f7c1 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -74,6 +74,11 @@ void nautilus_application_quit (NautilusApplication *self);
NautilusWindow * nautilus_application_create_window (NautilusApplication *application,
GdkScreen *screen);
+void nautilus_application_open_location (NautilusApplication *application,
+ GFile *location,
+ GFile *selection,
+ const char *startup_id);
+
void nautilus_application_close_all_windows (NautilusApplication *self);
#endif /* __NAUTILUS_APPLICATION_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]