summaryrefslogtreecommitdiff
path: root/src/nautilus-window-slot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-window-slot.c')
-rw-r--r--src/nautilus-window-slot.c44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index b5ff00008..5be145bac 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -61,6 +61,8 @@ enum
PROP_SELECTION,
PROP_LOCATION,
PROP_TOOLTIP,
+ PROP_ALLOW_STOP,
+ PROP_TITLE,
NUM_PROPERTIES
};
@@ -957,6 +959,18 @@ nautilus_window_slot_get_property (GObject *object,
}
break;
+ case PROP_ALLOW_STOP:
+ {
+ g_value_set_boolean (value, nautilus_window_slot_get_allow_stop (self));
+ }
+ break;
+
+ case PROP_TITLE:
+ {
+ g_value_set_string (value, nautilus_window_slot_get_title (self));
+ }
+ break;
+
default:
{
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1030,6 +1044,7 @@ nautilus_window_slot_constructed (GObject *object)
G_BINDING_DEFAULT);
priv->title = g_strdup (_("Loading…"));
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TITLE]);
}
static void
@@ -3285,6 +3300,20 @@ nautilus_window_slot_class_init (NautilusWindowSlotClass *klass)
NULL,
G_PARAM_READWRITE);
+ properties[PROP_ALLOW_STOP] =
+ g_param_spec_boolean ("allow-stop",
+ "Allow stop",
+ "Whether the slot allows stopping the loading",
+ FALSE,
+ G_PARAM_READABLE);
+
+ properties[PROP_TITLE] =
+ g_param_spec_string ("title",
+ "Title",
+ "The title of the slot",
+ NULL,
+ G_PARAM_READABLE);
+
g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
}
@@ -3402,6 +3431,8 @@ nautilus_window_slot_update_title (NautilusWindowSlot *self)
if (do_sync)
{
nautilus_window_sync_title (window, self);
+
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TITLE]);
}
if (title != NULL)
@@ -3435,6 +3466,8 @@ nautilus_window_slot_set_allow_stop (NautilusWindowSlot *self,
window = nautilus_window_slot_get_window (self);
nautilus_window_sync_allow_stop (window, self);
+
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ALLOW_STOP]);
}
void
@@ -3665,15 +3698,16 @@ nautilus_window_slot_set_active (NautilusWindowSlot *self,
if (active)
{
- int page_num;
+ HdyTabView *tab_view;
+ HdyTabPage *page;
priv = nautilus_window_slot_get_instance_private (self);
window = priv->window;
- page_num = gtk_notebook_page_num (GTK_NOTEBOOK (nautilus_window_get_notebook (window)),
- GTK_WIDGET (self));
- g_assert (page_num >= 0);
- gtk_notebook_set_current_page (GTK_NOTEBOOK (nautilus_window_get_notebook (window)), page_num);
+ tab_view = nautilus_window_get_tab_view (window);
+ page = hdy_tab_view_get_page (tab_view, GTK_WIDGET (self));
+
+ hdy_tab_view_set_selected_page (tab_view, page);
/* sync window to new slot */
nautilus_window_sync_allow_stop (window, self);