[nautilus] Implement the initiated_unmount property for NautilusWindow.
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Implement the initiated_unmount property for NautilusWindow.
- Date: Mon, 8 Mar 2010 14:08:12 +0000 (UTC)
commit 43f080c97369796043e45719933f536e0b29582f
Author: Luke Symes <allsymes gmail com>
Date: Mon Mar 8 16:29:49 2010 +1300
Implement the initiated_unmount property for NautilusWindow.
Windows will have this set to TRUE when one of their slots
initiates an unmount.
https://bugzilla.gnome.org/show_bug.cgi?id=611569
libnautilus-private/nautilus-window-info.c | 18 ++++++++++++++++++
libnautilus-private/nautilus-window-info.h | 7 +++++++
src/nautilus-window-private.h | 5 +++++
src/nautilus-window.c | 15 +++++++++++++++
4 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-window-info.c b/libnautilus-private/nautilus-window-info.c
index efb45b5..7639775 100644
--- a/libnautilus-private/nautilus-window-info.c
+++ b/libnautilus-private/nautilus-window-info.c
@@ -276,3 +276,21 @@ nautilus_window_info_get_extra_slot (NautilusWindowInfo *window)
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_extra_slot) (window);
}
+
+gboolean
+nautilus_window_info_get_initiated_unmount (NautilusWindowInfo *window)
+{
+ g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), FALSE);
+
+ return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_initiated_unmount) (window);
+}
+
+void
+nautilus_window_info_set_initiated_unmount (NautilusWindowInfo *window, gboolean initiated_unmount)
+{
+ g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
+
+ (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->set_initiated_unmount) (window,
+ initiated_unmount);
+
+}
diff --git a/libnautilus-private/nautilus-window-info.h b/libnautilus-private/nautilus-window-info.h
index 530f9d5..1c71d58 100644
--- a/libnautilus-private/nautilus-window-info.h
+++ b/libnautilus-private/nautilus-window-info.h
@@ -139,6 +139,10 @@ struct _NautilusWindowInfoIface
NautilusWindowSlotInfo * (* get_active_slot) (NautilusWindowInfo *window);
NautilusWindowSlotInfo * (* get_extra_slot) (NautilusWindowInfo *window);
+ gboolean (* get_initiated_unmount) (NautilusWindowInfo *window);
+ void (* set_initiated_unmount) (NautilusWindowInfo *window,
+ gboolean initiated_unmount);
+
void (* view_visible) (NautilusWindowInfo *window,
NautilusView *view);
void (* close_window) (NautilusWindowInfo *window);
@@ -170,6 +174,9 @@ GList * nautilus_window_info_get_selection
NautilusWindowShowHiddenFilesMode nautilus_window_info_get_hidden_files_mode (NautilusWindowInfo *window);
void nautilus_window_info_set_hidden_files_mode (NautilusWindowInfo *window,
NautilusWindowShowHiddenFilesMode mode);
+gboolean nautilus_window_info_get_initiated_unmount (NautilusWindowInfo *window);
+void nautilus_window_info_set_initiated_unmount (NautilusWindowInfo *window,
+ gboolean initiated_unmount);
GtkUIManager * nautilus_window_info_get_ui_manager (NautilusWindowInfo *window);
G_END_DECLS
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index addcbd7..d99a13e 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -81,6 +81,11 @@ struct NautilusWindowDetails
*/
GList *panes;
NautilusWindowPane *active_pane;
+
+ /* So we can tell which window initiated
+ * an unmount operation.
+ */
+ gboolean initiated_unmount;
};
struct _NautilusNavigationWindowDetails {
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index b822500..716561a 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1847,6 +1847,19 @@ nautilus_window_set_hidden_files_mode (NautilusWindowInfo *window,
g_signal_emit_by_name (window, "hidden_files_mode_changed");
}
+static gboolean
+nautilus_window_get_initiated_unmount (NautilusWindowInfo *window)
+{
+ return window->details->initiated_unmount;
+}
+
+static void
+nautilus_window_set_initiated_unmount (NautilusWindowInfo *window,
+ gboolean initiated_unmount)
+{
+ window->details->initiated_unmount = initiated_unmount;
+}
+
static NautilusBookmarkList *
nautilus_window_get_bookmark_list (NautilusWindowInfo *window)
{
@@ -1940,6 +1953,8 @@ nautilus_window_info_iface_init (NautilusWindowInfoIface *iface)
iface->set_hidden_files_mode = nautilus_window_set_hidden_files_mode;
iface->get_active_slot = nautilus_window_get_active_slot;
iface->get_extra_slot = nautilus_window_get_extra_slot;
+ iface->get_initiated_unmount = nautilus_window_get_initiated_unmount;
+ iface->set_initiated_unmount = nautilus_window_set_initiated_unmount;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]