summaryrefslogtreecommitdiffstats
path: root/panels/usage
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:45:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:45:20 +0000
commitae1c76ff830d146d41e88d6fba724c0a54bce868 (patch)
tree3c354bec95af07be35fc71a4b738268496f1a1c4 /panels/usage
parentInitial commit. (diff)
downloadgnome-control-center-ae1c76ff830d146d41e88d6fba724c0a54bce868.tar.xz
gnome-control-center-ae1c76ff830d146d41e88d6fba724c0a54bce868.zip
Adding upstream version 1:43.6.upstream/1%43.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'panels/usage')
-rw-r--r--panels/usage/cc-usage-panel.c362
-rw-r--r--panels/usage/cc-usage-panel.h50
-rw-r--r--panels/usage/cc-usage-panel.ui140
-rw-r--r--panels/usage/gnome-usage-panel.desktop.in.in19
-rw-r--r--panels/usage/icons/meson.build4
-rw-r--r--panels/usage/icons/scalable/org.gnome.Settings-file-history-symbolic.svg4
-rw-r--r--panels/usage/meson.build45
-rw-r--r--panels/usage/usage.gresource.xml6
8 files changed, 630 insertions, 0 deletions
diff --git a/panels/usage/cc-usage-panel.c b/panels/usage/cc-usage-panel.c
new file mode 100644
index 0000000..29230aa
--- /dev/null
+++ b/panels/usage/cc-usage-panel.c
@@ -0,0 +1,362 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2018 Red Hat, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Matthias Clasen <mclasen@redhat.com>
+ */
+
+#include "cc-usage-panel.h"
+#include "cc-usage-panel-enums.h"
+#include "cc-usage-resources.h"
+#include "cc-util.h"
+
+#include <gio/gdesktopappinfo.h>
+#include <glib/gi18n.h>
+
+struct _CcUsagePanel
+{
+ CcPanel parent_instance;
+
+ GSettings *privacy_settings;
+
+ GtkSwitch *recently_used_switch;
+ AdwComboRow *retain_history_combo;
+
+ GtkSwitch *purge_trash_switch;
+ GtkSwitch *purge_temp_switch;
+ AdwComboRow *purge_after_combo;
+ GtkButton *purge_temp_button;
+ GtkButton *purge_trash_button;
+};
+
+CC_PANEL_REGISTER (CcUsagePanel, cc_usage_panel)
+
+static char *
+purge_after_name_cb (AdwEnumListItem *item,
+ gpointer user_data)
+{
+ switch (adw_enum_list_item_get_value (item))
+ {
+ case CC_USAGE_PANEL_PURGE_AFTER_1_HOUR:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "1 hour"));
+ case CC_USAGE_PANEL_PURGE_AFTER_1_DAY:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "1 day"));
+ case CC_USAGE_PANEL_PURGE_AFTER_2_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "2 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_3_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "3 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_4_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "4 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_5_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "5 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_6_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "6 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_7_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "7 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_14_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "14 days"));
+ case CC_USAGE_PANEL_PURGE_AFTER_30_DAYS:
+ /* Translators: Option for "Automatically Delete Period" in "Trash & Temporary Files" group */
+ return g_strdup (C_("purge_files", "30 days"));
+ default:
+ return NULL;
+ }
+}
+
+static void
+purge_after_combo_changed_cb (AdwComboRow *combo_row,
+ GParamSpec *pspec,
+ CcUsagePanel *self)
+{
+ AdwEnumListItem *item;
+ CcUsagePanelPurgeAfter value;
+
+ item = ADW_ENUM_LIST_ITEM (adw_combo_row_get_selected_item (combo_row));
+ value = adw_enum_list_item_get_value (item);
+
+ g_settings_set (self->privacy_settings, "old-files-age", "u", value);
+}
+
+static void
+set_purge_after_value_for_combo (AdwComboRow *combo_row,
+ CcUsagePanel *self)
+{
+ AdwEnumListModel *model;
+ guint value;
+
+ model = ADW_ENUM_LIST_MODEL (adw_combo_row_get_model (combo_row));
+
+ g_settings_get (self->privacy_settings, "old-files-age", "u", &value);
+ adw_combo_row_set_selected (combo_row,
+ adw_enum_list_model_find_position (model, value));
+}
+
+static GtkDialog *
+run_warning (CcUsagePanel *self,
+ const gchar *prompt,
+ const gchar *text,
+ const gchar *button_title)
+{
+ GtkWindow *parent;
+ GtkWidget *dialog;
+ GtkWidget *button;
+ CcShell *shell;
+
+ shell = cc_panel_get_shell (CC_PANEL (self));
+ parent = GTK_WINDOW (cc_shell_get_toplevel (shell));
+
+ dialog = gtk_message_dialog_new (parent,
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_NONE,
+ NULL);
+ g_object_set (dialog,
+ "text", prompt,
+ "secondary-text", text,
+ NULL);
+ gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button (GTK_DIALOG (dialog), button_title, GTK_RESPONSE_OK);
+
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), FALSE);
+
+ button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "destructive-action");
+
+ gtk_window_present (GTK_WINDOW (dialog));
+
+ return GTK_DIALOG (dialog);
+}
+
+static void
+on_empty_trash_warning_response_cb (GtkDialog *dialog,
+ gint response,
+ CcUsagePanel *self)
+{
+ g_autoptr(GDBusConnection) bus = NULL;
+
+ if (response != GTK_RESPONSE_OK)
+ goto out;
+
+ bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
+ g_dbus_connection_call (bus,
+ "org.gnome.SettingsDaemon.Housekeeping",
+ "/org/gnome/SettingsDaemon/Housekeeping",
+ "org.gnome.SettingsDaemon.Housekeeping",
+ "EmptyTrash",
+ NULL, NULL, 0, -1, NULL, NULL, NULL);
+
+out:
+ gtk_window_destroy (GTK_WINDOW (dialog));
+}
+
+static void
+empty_trash (CcUsagePanel *self)
+{
+ GtkDialog *dialog;
+
+ dialog = run_warning (self,
+ _("Empty all items from Trash?"),
+ _("All items in the Trash will be permanently deleted."),
+ _("_Empty Trash"));
+
+ g_signal_connect_object (dialog,
+ "response",
+ G_CALLBACK (on_empty_trash_warning_response_cb),
+ self,
+ 0);
+}
+
+static void
+on_purge_temp_warning_response_cb (GtkDialog *dialog,
+ gint response,
+ CcUsagePanel *self)
+{
+ g_autoptr(GDBusConnection) bus = NULL;
+
+ if (response != GTK_RESPONSE_OK)
+ goto out;
+
+ bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
+ g_dbus_connection_call (bus,
+ "org.gnome.SettingsDaemon.Housekeeping",
+ "/org/gnome/SettingsDaemon/Housekeeping",
+ "org.gnome.SettingsDaemon.Housekeeping",
+ "RemoveTempFiles",
+ NULL, NULL, 0, -1, NULL, NULL, NULL);
+
+out:
+ gtk_window_destroy (GTK_WINDOW (dialog));
+}
+static void
+purge_temp (CcUsagePanel *self)
+{
+ GtkDialog *dialog;
+
+ dialog = run_warning (self,
+ _("Delete all the temporary files?"),
+ _("All the temporary files will be permanently deleted."),
+ _("_Purge Temporary Files"));
+
+ g_signal_connect_object (dialog,
+ "response",
+ G_CALLBACK (on_purge_temp_warning_response_cb),
+ self,
+ 0);
+}
+
+static void
+cc_usage_panel_finalize (GObject *object)
+{
+ CcUsagePanel *self = CC_USAGE_PANEL (object);
+
+ g_clear_object (&self->privacy_settings);
+
+ G_OBJECT_CLASS (cc_usage_panel_parent_class)->finalize (object);
+}
+
+static char *
+retain_history_name_cb (AdwEnumListItem *item,
+ gpointer user_data)
+{
+ switch (adw_enum_list_item_get_value (item))
+ {
+ case CC_USAGE_PANEL_RETAIN_HISTORY_1_DAY:
+ /* Translators: Option for "File History Duration" in "File History" group */
+ return g_strdup (C_("retain_history", "1 day"));
+ case CC_USAGE_PANEL_RETAIN_HISTORY_7_DAYS:
+ /* Translators: Option for "File History Duration" in "File History" group */
+ return g_strdup (C_("retain_history", "7 days"));
+ case CC_USAGE_PANEL_RETAIN_HISTORY_30_DAYS:
+ /* Translators: Option for "File History Duration" in "File History" group */
+ return g_strdup (C_("retain_history", "30 days"));
+ case CC_USAGE_PANEL_RETAIN_HISTORY_FOREVER:
+ /* Translators: Option for "File History Duration" in "File History" group */
+ return g_strdup (C_("retain_history", "Forever"));
+ default:
+ return NULL;
+ }
+}
+
+static void
+retain_history_combo_changed_cb (AdwComboRow *combo_row,
+ GParamSpec *pspec,
+ CcUsagePanel *self)
+{
+ AdwEnumListItem *item;
+ CcUsagePanelRetainHistory value;
+
+ item = ADW_ENUM_LIST_ITEM (adw_combo_row_get_selected_item (combo_row));
+ value = adw_enum_list_item_get_value (item);
+
+ g_settings_set (self->privacy_settings, "recent-files-max-age", "i", value);
+}
+
+static void
+set_retain_history_value_for_combo (AdwComboRow *combo_row,
+ CcUsagePanel *self)
+{
+ AdwEnumListModel *model;
+ gint value;
+
+ model = ADW_ENUM_LIST_MODEL (adw_combo_row_get_model (combo_row));
+
+ g_settings_get (self->privacy_settings, "recent-files-max-age", "i", &value);
+ adw_combo_row_set_selected (combo_row,
+ adw_enum_list_model_find_position (model, value));
+}
+
+static void
+cc_usage_panel_init (CcUsagePanel *self)
+{
+ g_resources_register (cc_usage_get_resource ());
+
+ g_type_ensure (CC_TYPE_USAGE_PANEL_PURGE_AFTER);
+ g_type_ensure (CC_TYPE_USAGE_PANEL_RETAIN_HISTORY);
+
+ gtk_widget_init_template (GTK_WIDGET (self));
+
+ self->privacy_settings = g_settings_new ("org.gnome.desktop.privacy");
+
+ g_settings_bind (self->privacy_settings,
+ "remember-recent-files",
+ self->recently_used_switch,
+ "active",
+ G_SETTINGS_BIND_DEFAULT);
+
+ set_retain_history_value_for_combo (self->retain_history_combo, self);
+
+ g_settings_bind (self->privacy_settings,
+ "remember-recent-files",
+ self->retain_history_combo,
+ "sensitive",
+ G_SETTINGS_BIND_GET);
+
+ g_settings_bind (self->privacy_settings, "remove-old-trash-files",
+ self->purge_trash_switch, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
+ g_settings_bind (self->privacy_settings, "remove-old-temp-files",
+ self->purge_temp_switch, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
+ set_purge_after_value_for_combo (self->purge_after_combo, self);
+
+ g_signal_connect_object (self->purge_trash_button, "clicked", G_CALLBACK (empty_trash), self, G_CONNECT_SWAPPED);
+ g_signal_connect_object (self->purge_temp_button, "clicked", G_CALLBACK (purge_temp), self, G_CONNECT_SWAPPED);
+}
+
+static void
+clear_recent (CcUsagePanel *self)
+{
+ GtkRecentManager *m;
+
+ m = gtk_recent_manager_get_default ();
+ gtk_recent_manager_purge_items (m, NULL);
+}
+
+static void
+cc_usage_panel_class_init (CcUsagePanelClass *klass)
+{
+ GObjectClass *oclass = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ oclass->finalize = cc_usage_panel_finalize;
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/usage/cc-usage-panel.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, purge_after_combo);
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, purge_temp_switch);
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, purge_trash_button);
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, purge_trash_switch);
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, purge_temp_button);
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, recently_used_switch);
+ gtk_widget_class_bind_template_child (widget_class, CcUsagePanel, retain_history_combo);
+
+ gtk_widget_class_bind_template_callback (widget_class, clear_recent);
+ gtk_widget_class_bind_template_callback (widget_class, retain_history_name_cb);
+ gtk_widget_class_bind_template_callback (widget_class, retain_history_combo_changed_cb);
+ gtk_widget_class_bind_template_callback (widget_class, purge_after_name_cb);
+ gtk_widget_class_bind_template_callback (widget_class, purge_after_combo_changed_cb);
+}
diff --git a/panels/usage/cc-usage-panel.h b/panels/usage/cc-usage-panel.h
new file mode 100644
index 0000000..62a9a9e
--- /dev/null
+++ b/panels/usage/cc-usage-panel.h
@@ -0,0 +1,50 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2018 Red Hat, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Matthias Clasen <mclasen@redhat.com>
+ */
+
+#pragma once
+
+#include <shell/cc-panel.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_USAGE_PANEL (cc_usage_panel_get_type ())
+G_DECLARE_FINAL_TYPE (CcUsagePanel, cc_usage_panel, CC, USAGE_PANEL, CcPanel)
+
+typedef enum {
+ CC_USAGE_PANEL_PURGE_AFTER_1_HOUR = 0,
+ CC_USAGE_PANEL_PURGE_AFTER_1_DAY = 1,
+ CC_USAGE_PANEL_PURGE_AFTER_2_DAYS = 2,
+ CC_USAGE_PANEL_PURGE_AFTER_3_DAYS = 3,
+ CC_USAGE_PANEL_PURGE_AFTER_4_DAYS = 4,
+ CC_USAGE_PANEL_PURGE_AFTER_5_DAYS = 5,
+ CC_USAGE_PANEL_PURGE_AFTER_6_DAYS = 6,
+ CC_USAGE_PANEL_PURGE_AFTER_7_DAYS = 7,
+ CC_USAGE_PANEL_PURGE_AFTER_14_DAYS = 14,
+ CC_USAGE_PANEL_PURGE_AFTER_30_DAYS = 30,
+} CcUsagePanelPurgeAfter;
+
+typedef enum {
+ CC_USAGE_PANEL_RETAIN_HISTORY_1_DAY = 1,
+ CC_USAGE_PANEL_RETAIN_HISTORY_7_DAYS = 7,
+ CC_USAGE_PANEL_RETAIN_HISTORY_30_DAYS = 30,
+ CC_USAGE_PANEL_RETAIN_HISTORY_FOREVER = -1,
+} CcUsagePanelRetainHistory;
+
+G_END_DECLS
diff --git a/panels/usage/cc-usage-panel.ui b/panels/usage/cc-usage-panel.ui
new file mode 100644
index 0000000..7a5c27f
--- /dev/null
+++ b/panels/usage/cc-usage-panel.ui
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="CcUsagePanel" parent="CcPanel">
+ <child type="content">
+ <object class="AdwPreferencesPage">
+ <!-- File History -->
+ <child>
+ <object class="AdwPreferencesGroup">
+ <property name="title" translatable="yes">File History</property>
+ <property name="description" translatable="yes">File history keeps a record of files that you have used. This information is shared between applications, and makes it easier to find files that you might want to use.</property>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">File H_istory</property>
+ <property name="activatable-widget">recently_used_switch</property>
+ <property name="use-underline">true</property>
+ <child>
+ <object class="GtkSwitch" id="recently_used_switch">
+ <property name="valign">center</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwComboRow" id="retain_history_combo">
+ <property name="title" translatable="yes">File _History Duration</property>
+ <property name="use-underline">true</property>
+ <signal name="notify::selected-item" handler="retain_history_combo_changed_cb"/>
+ <property name="model">
+ <object class="AdwEnumListModel">
+ <property name="enum-type">CcUsagePanelRetainHistory</property>
+ </object>
+ </property>
+ <property name="expression">
+ <closure type="gchararray" function="retain_history_name_cb"/>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="hexpand">true</property>
+ <property name="halign">end</property>
+ <property name="homogeneous">true</property>
+ <property name="spacing">12</property>
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkButton" id="clear_recent_button">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">_Clear History…</property>
+ <property name="use_underline">1</property>
+ <signal name="clicked" handler="clear_recent" swapped="yes"/>
+ <style>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <!-- Trash & Temporary Files -->
+ <child>
+ <object class="AdwPreferencesGroup">
+ <property name="title" translatable="yes">Trash &amp;amp; Temporary Files</property>
+ <property name="description" translatable="yes">Trash and temporary files can sometimes include personal or sensitive information. Automatically deleting them can help to protect privacy.</property>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Automatically Delete _Trash Content</property>
+ <property name="activatable-widget">purge_trash_switch</property>
+ <property name="use-underline">true</property>
+ <child>
+ <object class="GtkSwitch" id="purge_trash_switch">
+ <property name="valign">center</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Automatically Delete Temporary _Files</property>
+ <property name="activatable-widget">purge_temp_switch</property>
+ <property name="use-underline">true</property>
+ <child>
+ <object class="GtkSwitch" id="purge_temp_switch">
+ <property name="valign">center</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwComboRow" id="purge_after_combo">
+ <property name="title" translatable="yes">Automatically Delete _Period</property>
+ <property name="use-underline">true</property>
+ <signal name="notify::selected-item" handler="purge_after_combo_changed_cb"/>
+ <property name="model">
+ <object class="AdwEnumListModel">
+ <property name="enum-type">CcUsagePanelPurgeAfter</property>
+ </object>
+ </property>
+ <property name="expression">
+ <closure type="gchararray" function="purge_after_name_cb"/>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="hexpand">true</property>
+ <property name="halign">end</property>
+ <property name="homogeneous">true</property>
+ <property name="margin-top">12</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkButton" id="purge_trash_button">
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">_Empty Trash…</property>
+ <property name="use-underline">true</property>
+ <style>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="purge_temp_button">
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">_Delete Temporary Files…</property>
+ <property name="use-underline">true</property>
+ <style>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/panels/usage/gnome-usage-panel.desktop.in.in b/panels/usage/gnome-usage-panel.desktop.in.in
new file mode 100644
index 0000000..8a62303
--- /dev/null
+++ b/panels/usage/gnome-usage-panel.desktop.in.in
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Name=File History & Trash
+Comment=Don't leave traces
+Exec=gnome-control-center usage
+# FIXME
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
+Icon=org.gnome.Settings-file-history-symbolic
+Terminal=false
+Type=Application
+NoDisplay=true
+StartupNotify=true
+Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-PrivacySettings;
+OnlyShowIn=GNOME;Unity;
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=gnome-control-center
+X-GNOME-Bugzilla-Component=privacy
+X-GNOME-Bugzilla-Version=@VERSION@
+# Translators: Search terms to find the Usage panel. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
+Keywords=usage;recent;history;files;temporary;tmp;private;privacy;trash;purge;retain;
diff --git a/panels/usage/icons/meson.build b/panels/usage/icons/meson.build
new file mode 100644
index 0000000..79f20c5
--- /dev/null
+++ b/panels/usage/icons/meson.build
@@ -0,0 +1,4 @@
+install_data(
+ 'scalable/org.gnome.Settings-file-history-symbolic.svg',
+ install_dir: join_paths(control_center_icondir, 'hicolor', 'scalable', 'apps')
+)
diff --git a/panels/usage/icons/scalable/org.gnome.Settings-file-history-symbolic.svg b/panels/usage/icons/scalable/org.gnome.Settings-file-history-symbolic.svg
new file mode 100644
index 0000000..eb459b9
--- /dev/null
+++ b/panels/usage/icons/scalable/org.gnome.Settings-file-history-symbolic.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
+ <path d="m 4 0 c -1.644531 0 -3 1.355469 -3 3 v 9 c 0 1.644531 1.355469 3 3 3 h 8 c 1.644531 0 3 -1.355469 3 -3 v -9 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 8 c 0.570312 0 1 0.429688 1 1 v 4 h -10 v -4 c 0 -0.570312 0.429688 -1 1 -1 z m 2.464844 1.429688 c -0.019532 0 -0.039063 0.003906 -0.058594 0.007812 c -0.019531 0 -0.042969 0 -0.0625 0 c -0.214844 0.070312 -0.355469 0.273438 -0.34375 0.5 v 0.0625 c 0 0.546875 0.453125 1 1 1 h 2 c 0.546875 0 1 -0.453125 1 -1 v -0.0625 c 0.011719 -0.675781 -1.011719 -0.675781 -1 0 v 0.0625 h -2 v -0.0625 c 0.003906 -0.296875 -0.246094 -0.527344 -0.535156 -0.507812 z m -3.464844 4.570312 h 10 v 4 c 0 0.570312 -0.429688 1 -1 1 h -8 c -0.570312 0 -1 -0.429688 -1 -1 z m 3.464844 1.429688 c -0.019532 0 -0.039063 0.003906 -0.058594 0.007812 c -0.019531 0 -0.042969 0 -0.0625 0 c -0.214844 0.070312 -0.355469 0.273438 -0.34375 0.5 v 0.0625 c 0 0.546875 0.453125 1 1 1 h 2 c 0.546875 0 1 -0.453125 1 -1 v -0.0625 c 0.011719 -0.675781 -1.011719 -0.675781 -1 0 v 0.0625 h -2 v -0.0625 c 0.003906 -0.296875 -0.246094 -0.527344 -0.535156 -0.507812 z m 0 0" fill="#222222" fill-rule="evenodd"/>
+</svg>
diff --git a/panels/usage/meson.build b/panels/usage/meson.build
new file mode 100644
index 0000000..8365b83
--- /dev/null
+++ b/panels/usage/meson.build
@@ -0,0 +1,45 @@
+panels_list += cappletname
+desktop = 'gnome-@0@-panel.desktop'.format(cappletname)
+
+desktop_in = configure_file(
+ input: desktop + '.in.in',
+ output: desktop + '.in',
+ configuration: desktop_conf
+)
+
+i18n.merge_file(
+ type: 'desktop',
+ input: desktop_in,
+ output: desktop,
+ po_dir: po_dir,
+ install: true,
+ install_dir: control_center_desktopdir
+)
+
+sources = files('cc-usage-panel.c')
+
+resource_data = files('cc-usage-panel.ui')
+
+sources += gnome.mkenums_simple(
+ 'cc-usage-panel-enums',
+ sources: ['cc-usage-panel.h'],
+)
+
+sources += gnome.compile_resources(
+ 'cc-' + cappletname + '-resources',
+ cappletname + '.gresource.xml',
+ c_name: 'cc_' + cappletname,
+ dependencies: resource_data,
+ export: true
+)
+
+cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
+
+panels_libs += static_library(
+ cappletname,
+ sources: sources,
+ include_directories: [top_inc, common_inc],
+ dependencies: common_deps,
+ c_args: cflags
+)
+subdir('icons')
diff --git a/panels/usage/usage.gresource.xml b/panels/usage/usage.gresource.xml
new file mode 100644
index 0000000..3f55dbf
--- /dev/null
+++ b/panels/usage/usage.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/control-center/usage">
+ <file preprocess="xml-stripblanks">cc-usage-panel.ui</file>
+ </gresource>
+</gresources>