[nautilus] general: add a setting for the default compression format
- From: Răzvan-Mihai Chițu <razvanchitu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] general: add a setting for the default compression format
- Date: Mon, 22 Aug 2016 21:42:45 +0000 (UTC)
commit 9d8de33448073196b3a7d649330e9a4da9fefd7f
Author: Razvan Chitu <razvan ch95 gmail com>
Date: Sun Aug 21 22:54:04 2016 +0300
general: add a setting for the default compression format
The compression operation allows multiple formats to be selected. It would be
good to store the last choice of the user in order to select it for future
operations.
https://bugzilla.gnome.org/show_bug.cgi?id=770199
data/org.gnome.nautilus.gschema.xml | 15 +++++++++++++++
src/nautilus-global-preferences.c | 2 ++
src/nautilus-global-preferences.h | 11 +++++++++++
3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index e89d0d8..c05faf3 100644
--- a/data/org.gnome.nautilus.gschema.xml
+++ b/data/org.gnome.nautilus.gschema.xml
@@ -56,8 +56,15 @@
<value value="1" nick="last_used"/>
</enum>
+ <enum id="org.gnome.nautilus.CompressionFormat">
+ <value value="0" nick="zip"/>
+ <value value="1" nick="tar.xz"/>
+ <value value="2" nick="7z"/>
+ </enum>
+
<schema path="/org/gnome/nautilus/" id="org.gnome.nautilus" gettext-domain="nautilus">
<child schema="org.gnome.nautilus.preferences" name="preferences"/>
+ <child schema="org.gnome.nautilus.compression" name="compression"/>
<child schema="org.gnome.nautilus.icon-view" name="icon-view"/>
<child schema="org.gnome.nautilus.list-view" name="list-view"/>
<child schema="org.gnome.nautilus.desktop" name="desktop"/>
@@ -211,6 +218,14 @@
</key>
</schema>
+ <schema path="/org/gnome/nautilus/compression/" id="org.gnome.nautilus.compression"
gettext-domain="nautilus">
+ <key name="default-compression-format" enum="org.gnome.nautilus.CompressionFormat">
+ <default>'zip'</default>
+ <summary>Default format for compressing files</summary>
+ <description>The format that will be selected when compressing files.</description>
+ </key>
+ </schema>
+
<schema path="/org/gnome/nautilus/icon-view/" id="org.gnome.nautilus.icon-view" gettext-domain="nautilus">
<key type="as" name="captions">
<default>[ 'none', 'none', 'none' ]</default>
diff --git a/src/nautilus-global-preferences.c b/src/nautilus-global-preferences.c
index 19b475f..efbc620 100644
--- a/src/nautilus-global-preferences.c
+++ b/src/nautilus-global-preferences.c
@@ -34,6 +34,7 @@
#include <glib/gi18n.h>
GSettings *nautilus_preferences;
+GSettings *nautilus_compression_preferences;
GSettings *nautilus_icon_view_preferences;
GSettings *nautilus_list_view_preferences;
GSettings *nautilus_desktop_preferences;
@@ -56,6 +57,7 @@ nautilus_global_preferences_init (void)
initialized = TRUE;
nautilus_preferences = g_settings_new("org.gnome.nautilus.preferences");
+ nautilus_compression_preferences = g_settings_new ("org.gnome.nautilus.compression");
nautilus_window_state = g_settings_new("org.gnome.nautilus.window-state");
nautilus_icon_view_preferences = g_settings_new("org.gnome.nautilus.icon-view");
nautilus_list_view_preferences = g_settings_new("org.gnome.nautilus.list-view");
diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h
index bd665e3..bf1c896 100644
--- a/src/nautilus-global-preferences.h
+++ b/src/nautilus-global-preferences.h
@@ -80,6 +80,16 @@ typedef enum
/* The default folder viewer - one of the two enums below */
#define NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER "default-folder-viewer"
+/* Compression */
+#define NAUTILUS_PREFERENCES_DEFAULT_COMPRESSION_FORMAT "default-compression-format"
+
+typedef enum
+{
+ NAUTILUS_COMPRESSION_ZIP = 0,
+ NAUTILUS_COMPRESSION_TAR_XZ,
+ NAUTILUS_COMPRESSION_7ZIP
+} NautilusCompressionFormat;
+
/* Icon View */
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL "default-zoom-level"
@@ -167,6 +177,7 @@ typedef enum
void nautilus_global_preferences_init (void);
extern GSettings *nautilus_preferences;
+extern GSettings *nautilus_compression_preferences;
extern GSettings *nautilus_icon_view_preferences;
extern GSettings *nautilus_list_view_preferences;
extern GSettings *nautilus_desktop_preferences;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]