[nautilus/wip/apoos-maximus/gsoc2020: 10/29] properties-window: Add Permissions tab outer containers to template
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/apoos-maximus/gsoc2020: 10/29] properties-window: Add Permissions tab outer containers to template
- Date: Wed, 5 Aug 2020 13:48:12 +0000 (UTC)
commit cadcd20e29e335b7b6dbc3b1e4b79216c327b9b1
Author: Apoorv Sachan <apoorv 99 sachan gmail com>
Date: Wed Jun 17 23:02:12 2020 +0530
properties-window: Add Permissions tab outer containers to template
Internal widgets will be populated from template in the next commits.
src/nautilus-properties-window.c | 42 ++++++++++++--------------
src/resources/ui/nautilus-properties-window.ui | 40 ++++++++++++++++++++++--
2 files changed, 57 insertions(+), 25 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 13eae6b64..4f1e71826 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -151,6 +151,11 @@ struct _NautilusPropertiesWindow
GtkWidget *total_capacity_value;
GtkWidget *file_system_value;
+ /* Permissions tab Widgets */
+
+ GtkWidget *permissions_box;
+ GtkWidget *permissions_grid;
+
GroupChange *group_change;
OwnerChange *owner_change;
@@ -4581,18 +4586,12 @@ on_change_permissions_clicked (GtkWidget *button,
}
static void
-create_permissions_page (NautilusPropertiesWindow *window)
+setup_permissions_page (NautilusPropertiesWindow *window)
{
- GtkWidget *vbox, *button, *hbox;
- GtkGrid *page_grid;
+ GtkWidget *button, *hbox;
char *file_name, *prompt_text;
GList *file_list;
- vbox = create_page_with_box (window->notebook,
- GTK_ORIENTATION_VERTICAL,
- _("Permissions"),
- "help:gnome-help/nautilus-file-properties-permissions");
-
file_list = window->original_files;
window->initial_permissions = NULL;
@@ -4605,35 +4604,29 @@ create_permissions_page (NautilusPropertiesWindow *window)
if (!all_can_set_permissions (file_list))
{
add_prompt_and_separator (
- vbox,
+ window->permissions_box,
_("You are not the owner, so you cannot change these permissions."));
}
- page_grid = GTK_GRID (create_grid_with_standard_properties ());
-
- gtk_widget_show (GTK_WIDGET (page_grid));
- gtk_box_pack_start (GTK_BOX (vbox),
- GTK_WIDGET (page_grid),
- TRUE, TRUE, 0);
-
- create_simple_permissions (window, page_grid);
+ gtk_widget_show (window->permissions_grid);
+ create_simple_permissions (window, GTK_GRID (window->permissions_grid));
#ifdef HAVE_SELINUX
- append_blank_slim_row (page_grid);
+ append_blank_slim_row (GTK_GRID (window->permissions_grid));
append_title_value_pair
- (window, page_grid, _("Security context:"),
+ (window, GTK_GRID (window->permissions_grid), _("Security context:"),
"selinux_context", INCONSISTENT_STATE_STRING,
FALSE);
#endif
- append_blank_row (page_grid);
+ append_blank_row (GTK_GRID (window->permissions_grid));
if (window->has_recursive_apply)
{
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox);
- gtk_container_add_with_properties (GTK_CONTAINER (page_grid), hbox,
+ gtk_container_add_with_properties (GTK_CONTAINER (window->permissions_grid), hbox,
"width", 2,
NULL);
@@ -4658,7 +4651,7 @@ create_permissions_page (NautilusPropertiesWindow *window)
prompt_text = g_strdup (_("The permissions of the selected file could not be determined."));
}
- add_prompt (vbox, prompt_text, TRUE);
+ add_prompt (window->permissions_box, prompt_text, TRUE);
g_free (prompt_text);
}
}
@@ -5020,7 +5013,8 @@ create_properties_window (StartupData *startup_data)
if (should_show_permissions (window))
{
- create_permissions_page (window);
+ setup_permissions_page (window);
+ gtk_widget_show (window->permissions_box);
}
if (should_show_open_with (window))
@@ -5713,6 +5707,8 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, free_value);
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, total_capacity_value);
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, file_system_value);
+ gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, permissions_box);
+ gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, permissions_grid);
}
static void
diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui
index 7d4554b6a..523834cb8 100644
--- a/src/resources/ui/nautilus-properties-window.ui
+++ b/src/resources/ui/nautilus-properties-window.ui
@@ -672,10 +672,46 @@
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkBox" id="permissions_box">
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkGrid" id="permissions_grid">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_expand">True</property>
+ </packing>
</child>
<child type="tab">
- <placeholder/>
+ <object class="GtkLabel" id="permissions_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Permissions</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
</child>
<child>
<placeholder/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]