[nautilus] trash-bar: Add autodelete label
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] trash-bar: Add autodelete label
- Date: Fri, 13 Aug 2021 14:09:41 +0000 (UTC)
commit 4e02d0ffbde23d59e84a66c9d5cf1e88b76135e9
Author: Eric <8319652+edaigle users noreply github com>
Date: Thu Jul 8 11:01:15 2021 -0400
trash-bar: Add autodelete label
Nautilus currently provides no indication that GNOME Settings allows
users to configure automatic emptying of the trash. This commit adds
a subtitle to the trash bar, informing users whether or not automatic
emptying is currently enabled.
Relates: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1790
src/nautilus-global-preferences.c | 2 ++
src/nautilus-global-preferences.h | 1 +
src/nautilus-trash-bar.c | 13 +++++++++++++
3 files changed, 16 insertions(+)
---
diff --git a/src/nautilus-global-preferences.c b/src/nautilus-global-preferences.c
index 8fc9baadf..d24db28c3 100644
--- a/src/nautilus-global-preferences.c
+++ b/src/nautilus-global-preferences.c
@@ -41,6 +41,7 @@ GSettings *gtk_filechooser_preferences;
GSettings *gnome_lockdown_preferences;
GSettings *gnome_background_preferences;
GSettings *gnome_interface_preferences;
+GSettings *gnome_privacy_preferences;
void
nautilus_global_preferences_init (void)
@@ -65,4 +66,5 @@ nautilus_global_preferences_init (void)
gnome_lockdown_preferences = g_settings_new ("org.gnome.desktop.lockdown");
gnome_background_preferences = g_settings_new ("org.gnome.desktop.background");
gnome_interface_preferences = g_settings_new ("org.gnome.desktop.interface");
+ gnome_privacy_preferences = g_settings_new ("org.gnome.desktop.privacy");
}
diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h
index 2e8753b3c..6f098b6b8 100644
--- a/src/nautilus-global-preferences.h
+++ b/src/nautilus-global-preferences.h
@@ -152,5 +152,6 @@ extern GSettings *gtk_filechooser_preferences;
extern GSettings *gnome_lockdown_preferences;
extern GSettings *gnome_background_preferences;
extern GSettings *gnome_interface_preferences;
+extern GSettings *gnome_privacy_preferences;
G_END_DECLS
diff --git a/src/nautilus-trash-bar.c b/src/nautilus-trash-bar.c
index ae7b423be..4f7d7e2d9 100644
--- a/src/nautilus-trash-bar.c
+++ b/src/nautilus-trash-bar.c
@@ -25,11 +25,13 @@
#include "nautilus-trash-bar.h"
+#include "nautilus-global-preferences.h"
#include "nautilus-files-view.h"
#include "nautilus-file-operations.h"
#include "nautilus-file-utilities.h"
#include "nautilus-file.h"
#include "nautilus-trash-monitor.h"
+#include "nautilus-ui-utilities.h"
enum
{
@@ -188,6 +190,7 @@ nautilus_trash_bar_init (NautilusTrashBar *bar)
{
GtkWidget *content_area, *action_area, *w;
GtkWidget *label;
+ GtkWidget *subtitle;
PangoAttrList *attrs;
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (bar));
@@ -202,9 +205,19 @@ nautilus_trash_bar_init (NautilusTrashBar *bar)
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
+ subtitle = gtk_label_new (_("Trashed items are automatically deleted after a period of time"));
+
+ g_settings_bind (gnome_privacy_preferences,
+ "remove-old-trash-files",
+ subtitle,
+ "visible",
+ G_SETTINGS_BIND_GET);
+
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (content_area), label);
+ gtk_container_add (GTK_CONTAINER (content_area), subtitle);
+
w = gtk_info_bar_add_button (GTK_INFO_BAR (bar),
_("_Restore"),
TRASH_BAR_RESPONSE_RESTORE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]