[nautilus/wip/openingLocation] nautilus-window-slot: Prototyping show spinner while opening location
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/openingLocation] nautilus-window-slot: Prototyping show spinner while opening location
- Date: Mon, 6 Oct 2014 09:55:02 +0000 (UTC)
commit 0da22ff1c424655d26aa5dc5741a1b7a5fb32126
Author: Carlos Soriano <carlos soriano89 gmail com>
Date: Mon Oct 6 11:54:28 2014 +0200
nautilus-window-slot: Prototyping show spinner while opening location
src/nautilus-window-slot.c | 12 ++++++++++++
src/nautilus-window-slot.h | 4 ++++
src/nautilus-window.c | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index ea2ff71..0d7abb2 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -694,6 +694,17 @@ new_window_show_callback (GtkWidget *widget,
}
void
+nautilus_window_slot_opening_location (NautilusWindowSlot *slot,
+ GVolume *volume,
+ NautilusWindowOpenFlags flags)
+{
+ g_print("opening location\n");
+ gchar *identifier = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_CLASS);
+ gchar *name = g_volume_get_name (volume);
+ g_print("drive name%s\n", name);
+}
+
+void
nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
GFile *location,
NautilusWindowOpenFlags flags,
@@ -701,6 +712,7 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
NautilusWindowGoToCallback callback,
gpointer user_data)
{
+ g_print("open location full\n");
NautilusWindow *window;
NautilusWindow *target_window;
NautilusWindowSlot *target_slot;
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index aa9766d..c41826a 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -82,6 +82,10 @@ void nautilus_window_slot_open_location_full (NautilusWindowSlot *s
NautilusWindowGoToCallback callback,
gpointer user_data);
+void nautilus_window_slot_opening_location (NautilusWindowSlot *slot,
+ GVolume *location,
+ NautilusWindowOpenFlags flags);
+
GFile * nautilus_window_slot_get_location (NautilusWindowSlot *slot);
char * nautilus_window_slot_get_location_uri (NautilusWindowSlot *slot);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 124fc57..6237e8c 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -534,6 +534,34 @@ setup_side_pane_width (NautilusWindow *window)
window->details->side_pane_width);
}
+static void
+places_sidebar_opening_location_cb (GtkPlacesSidebar *sidebar,
+ GVolume *volume,
+ GtkPlacesOpenFlags open_flags,
+ gpointer user_data)
+{
+ NautilusWindow *window = NAUTILUS_WINDOW (user_data);
+ NautilusWindowOpenFlags flags;
+
+ switch (open_flags) {
+ case GTK_PLACES_OPEN_NEW_TAB:
+ flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+ break;
+
+ case GTK_PLACES_OPEN_NEW_WINDOW:
+ flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+ break;
+
+ case GTK_PLACES_OPEN_NORMAL: /* fall-through */
+ default:
+ flags = 0;
+ break;
+ }
+ g_print("nautilus SIGNAL opening\n");
+ nautilus_window_slot_opening_location (window->details->active_slot, volume, flags);
+
+}
+
/* Callback used when the places sidebar changes location; we need to change the displayed folder */
static void
places_sidebar_open_location_cb (GtkPlacesSidebar *sidebar,
@@ -541,6 +569,8 @@ places_sidebar_open_location_cb (GtkPlacesSidebar *sidebar,
GtkPlacesOpenFlags open_flags,
gpointer user_data)
{
+
+ g_print("open location cb\n");
NautilusWindow *window = NAUTILUS_WINDOW (user_data);
NautilusWindowOpenFlags flags;
@@ -569,6 +599,7 @@ places_sidebar_show_error_message_cb (GtkPlacesSidebar *sidebar,
const char *secondary,
gpointer user_data)
{
+ g_print("show error message\n");
NautilusWindow *window = NAUTILUS_WINDOW (user_data);
eel_show_error_dialog (primary, secondary, GTK_WINDOW (window));
@@ -801,6 +832,7 @@ places_sidebar_populate_popup_cb (GtkPlacesSidebar *sidebar,
GVolume *selected_volume,
gpointer user_data)
{
+ g_print("populate popup\n");
NautilusWindow *window = NAUTILUS_WINDOW (user_data);
GtkWidget *item;
GFile *trash;
@@ -871,6 +903,8 @@ nautilus_window_set_up_sidebar (NautilusWindow *window)
g_signal_connect (window->details->places_sidebar, "open-location",
G_CALLBACK (places_sidebar_open_location_cb), window);
+ g_signal_connect (window->details->places_sidebar, "opening-location",
+ G_CALLBACK (places_sidebar_opening_location_cb), window);
g_signal_connect (window->details->places_sidebar, "show-error-message",
G_CALLBACK (places_sidebar_show_error_message_cb), window);
g_signal_connect (window->details->places_sidebar, "show-connect-to-server",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]