[gnome-commander/GSettings] Creates GSettings enums automatically by definitions in data/Makefile.am
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Creates GSettings enums automatically by definitions in data/Makefile.am
- Date: Sun, 7 Aug 2016 13:38:25 +0000 (UTC)
commit ba3689a58a1b15be8713f4726920af5383ab891f
Author: Uwe Scholz <uwescholz src gnome org>
Date: Sun Aug 7 15:31:10 2016 +0200
Creates GSettings enums automatically by definitions in data/Makefile.am
data/Makefile.am | 5 +
data/org.gnome.gnome-commander.gschema.xml | 112 +++++-----------------------
src/dialogs/gnome-cmd-options-dialog.cc | 2 +-
src/gnome-cmd-data.h | 18 ++--
src/gnome-cmd-types.h | 32 ++++----
src/intviewer/search-dlg.h | 4 +-
6 files changed, 52 insertions(+), 121 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 1ae6321..daa99d6 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,6 +6,11 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
+gsettings_ENUM_NAMESPACE = org.gnome.gnome-commander
+gsettings_ENUM_FILES = $(top_srcdir)/src/gnome-cmd-types.h \
+ $(top_srcdir)/src/gnome-cmd-data.h \
+ $(top_srcdir)/src/intviewer/search-dlg.h
+
gsettings_SCHEMAS = org.gnome.@PACKAGE gschema xml
@GSETTINGS_RULES@
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 47c781a..f64dd75 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -13,45 +13,6 @@
<child name="internal-viewer" schema="org.gnome.gnome-commander.preferences.internal-viewer"/>
</schema>
- <enum id="org.gnome.gnome-commander.preferences.general.size-display-mode-enum">
- <value nick="plain" value="0"/>
- <value nick="locale" value="1"/>
- <value nick="grouped" value="2"/>
- <value nick="powered" value="3"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.perm-display-mode-enum">
- <value nick="text" value="0"/>
- <value nick="numbers" value="1"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.graphical-layout-mode-enum">
- <value nick="off" value="0"/>
- <value nick="file icons" value="1"/>
- <value nick="MIME icons" value="2"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.extension-display-mode-enum">
- <value nick="with filename column" value="0"/>
- <value nick="separate column" value="1"/>
- <value nick="both columns" value="2"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.clicks-to-open-item-enum">
- <value nick="single" value="0"/>
- <value nick="double" value="1"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.right-mouse-btn-mode-enum">
- <value nick="popup" value="0"/>
- <value nick="select" value="1"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.middle-mouse-btn-mode-enum">
- <value nick="parent directory" value="0"/>
- <value nick="new tab" value="1"/>
- </enum>
-
<enum id="org.gnome.gnome-commander.preferences.general.icon-scale-quality-enum">
<value nick="GDK_INTERP_NEAREST" value="0"/>
<value nick="GDK_INTERP_TILES" value="1"/>
@@ -59,44 +20,11 @@
<value nick="GDK_INTERP_HYPER" value="3"/>
</enum>
- <enum id="org.gnome.gnome-commander.preferences.general.tab-lock-indicator-enum">
- <value nick="icon" value="0"/>
- <value nick="asterisk" value="1"/>
- <value nick="styled text" value="2"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.general.quick-search-enum">
- <value nick="CTRL+ALT+letter" value="0"/>
- <value nick="ALT+letter" value="1"/>
- </enum>
-
<enum id="org.gnome.gnome-commander.preferences.confirmations.delete-default-enum">
<value nick="cancel" value="3"/>
<value nick="delete" value="1"/>
</enum>
- <enum id="org.gnome.gnome-commander.preferences.confirmations.overwrite-enum">
- <value nick="skip all" value="0"/>
- <value nick="query" value="1"/>
- <value nick="overwrite silently" value="2"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.colors.theme-enum">
- <value nick="none" value="0"/>
- <value nick="modern" value="1"/>
- <value nick="fusion" value="2"/>
- <value nick="classic" value="3"/>
- <value nick="deep blue" value="4"/>
- <value nick="cafezinho" value="5"/>
- <value nick="green tiger" value="6"/>
- <value nick="custom" value="7"/>
- </enum>
-
- <enum id="org.gnome.gnome-commander.preferences.internal-viewer.search-mode-enum">
- <value nick="text" value="0"/>
- <value nick="hexadecimal" value="1"/>
- </enum>
-
<schema gettext-domain="gnome-commander" id="org.gnome.gnome-commander.preferences.general"
path="/org/gnome/gnome-commander/preferences/general/">
<key name="use-default-font" type="b">
<default>true</default>
@@ -115,22 +43,22 @@
A custom font that will be used for the file panes. This will only take effect if the "Use Default
Font" option is turned off.
</description>
</key>
- <key name='size-display-mode'
enum='org.gnome.gnome-commander.preferences.general.size-display-mode-enum'>
+ <key name='size-display-mode' enum='org.gnome.gnome-commander.GnomeCmdSizeDispMode'>
<default>'powered'</default>
<summary>Filesize display mode</summary>
<description>
Defines how the filesize will be displayed in the associated pane column.
</description>
</key>
- <key name='perm-display-mode'
enum='org.gnome.gnome-commander.preferences.general.perm-display-mode-enum'>
+ <key name='perm-display-mode' enum='org.gnome.gnome-commander.GnomeCmdPermDispMode'>
<default l10n="messages">'text'</default>
<summary>Permission display mode</summary>
<description>
Defines how the file permission will be displayed in the associated pane column.
</description>
</key>
- <key name='graphical-layout-mode'
enum='org.gnome.gnome-commander.preferences.general.graphical-layout-mode-enum'>
- <default l10n="messages">'MIME icons'</default>
+ <key name='graphical-layout-mode' enum='org.gnome.gnome-commander.GnomeCmdLayout'>
+ <default l10n="messages">'mime-icons'</default>
<summary>Graphical layout mode</summary>
<description>
Defines the icon style of files and folders in the file panes.
@@ -155,15 +83,15 @@
<summary>List font</summary>
<description>The font in the file panes.</description>
</key>
- <key name='extension-display-mode'
enum='org.gnome.gnome-commander.preferences.general.extension-display-mode-enum'>
- <default l10n="messages">'both columns'</default>
+ <key name='extension-display-mode' enum='org.gnome.gnome-commander.GnomeCmdExtDispMode'>
+ <default l10n="messages">'both'</default>
<summary>Extension display mode</summary>
<description>
Defines where the file name extension is displayed.
</description>
</key>
- <key name="clicks-to-open-item"
enum='org.gnome.gnome-commander.preferences.general.clicks-to-open-item-enum'>
- <default>'double'</default>
+ <key name="clicks-to-open-item" enum='org.gnome.gnome-commander.LeftMouseButtonMode'>
+ <default>'double-click'</default>
<summary>Clicks to open an item</summary>
<description>
Number of clicks for opening a file or folder.
@@ -176,8 +104,8 @@
Defines if a click on an unselected item unselects already selected items.
</description>
</key>
- <key name="right-mouse-btn-mode"
enum='org.gnome.gnome-commander.preferences.general.right-mouse-btn-mode-enum'>
- <default l10n="messages">'popup'</default>
+ <key name="right-mouse-btn-mode" enum='org.gnome.gnome-commander.RightMouseButtonMode'>
+ <default l10n="messages">'popups-menu'</default>
<summary>Right mouse button mode</summary>
<description>
Defines what happens when the right mouse button is clicked on an item.
@@ -361,8 +289,8 @@
The number represents the main window state, e.g. 'maximized', 'fullscreen', etc. and is
calculated internally.
</description>
</key>
- <key name="middle-mouse-btn-mode"
enum="org.gnome.gnome-commander.preferences.general.middle-mouse-btn-mode-enum">
- <default l10n="messages">'parent directory'</default>
+ <key name="middle-mouse-btn-mode" enum="org.gnome.gnome-commander.MiddleMouseButtonMode">
+ <default l10n="messages">'goes-up-dir'</default>
<summary>Middle mouse button mode</summary>
<description>
Defines what happens when the middle mouse button is clicked.
@@ -396,7 +324,7 @@
Defines if the tab bar is always shown.
</description>
</key>
- <key name="tab-lock-indicator"
enum='org.gnome.gnome-commander.preferences.general.tab-lock-indicator-enum'>
+ <key name="tab-lock-indicator" enum='org.gnome.gnome-commander.TabLockIndicator'>
<default l10n="messages">'icon'</default>
<summary>Tab lock indicator</summary>
<description>
@@ -459,8 +387,8 @@
This option defines if the main menu is visible or not.
</description>
</key>
- <key name="quick-search" enum="org.gnome.gnome-commander.preferences.general.quick-search-enum">
- <default>'CTRL+ALT+letter'</default>
+ <key name="quick-search" enum="org.gnome.gnome-commander.GnomeCmdQuickSearchShortcut">
+ <default>'ctrl-alt'</default>
<summary>Quick search shortcut</summary>
<description>
This option defines the shortcut for quick search.
@@ -503,14 +431,14 @@
This setting defines the default active option in the delete confirmation dialog.
</description>
</key>
- <key name="copy-overwrite" enum="org.gnome.gnome-commander.preferences.confirmations.overwrite-enum">
+ <key name="copy-overwrite" enum="org.gnome.gnome-commander.GnomeCmdConfirmOverwriteMode">
<default l10n="messages">'query'</default>
<summary>Confirm copy overwrite</summary>
<description>
This option defines the default behavior when items will be overwritten by a copy command.
</description>
</key>
- <key name="move-overwrite" enum="org.gnome.gnome-commander.preferences.confirmations.overwrite-enum">
+ <key name="move-overwrite" enum="org.gnome.gnome-commander.GnomeCmdConfirmOverwriteMode">
<default l10n="messages">'query'</default>
<summary>Confirm move overwrite</summary>
<description>
@@ -643,8 +571,8 @@
</key>
</schema>
<schema gettext-domain="gnome-commander" id="org.gnome.gnome-commander.preferences.colors"
path="/org/gnome/gnome-commander/preferences/colors/">
- <key name="theme" enum="org.gnome.gnome-commander.preferences.colors.theme-enum">
- <default l10n="messages">'green tiger'</default>
+ <key name="theme" enum="org.gnome.gnome-commander.GnomeCmdColorMode">
+ <default l10n="messages">'green-tiger'</default>
<summary>Color theme</summary>
<description>
This option defines the current color theme.
@@ -835,7 +763,7 @@
This option defines if searching within the internal viewer is case sensitive.
</description>
</key>
- <key name="search-mode" enum='org.gnome.gnome-commander.preferences.internal-viewer.search-mode-enum'>
+ <key name="search-mode" enum='org.gnome.gnome-commander.SEARCHMODE'>
<default l10n="messages">'text'</default>
<summary>Search mode</summary>
<description>
diff --git a/src/dialogs/gnome-cmd-options-dialog.cc b/src/dialogs/gnome-cmd-options-dialog.cc
index 372c79d..b6ce72b 100644
--- a/src/dialogs/gnome-cmd-options-dialog.cc
+++ b/src/dialogs/gnome-cmd-options-dialog.cc
@@ -701,7 +701,7 @@ inline GtkWidget *create_layout_tab (GtkWidget *parent, GnomeCmdData::Options &c
_("MIME icons"),
NULL
};
- const gchar *color_modes[GNOME_CMD_NUM_COLOR_MODES+1] = {
+ const gchar *color_modes[GNOME_CMD_COLOR_CUSTOM+2] = {
_("Respect theme colors"),
_("Modern"),
_("Fusion"),
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index c697b60..5838e0d 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -199,30 +199,30 @@ struct GnomeCmdConRemote;
struct GnomeCmdData
{
- enum LeftMouseButtonMode
+ typedef enum
{
LEFT_BUTTON_OPENS_WITH_SINGLE_CLICK,
LEFT_BUTTON_OPENS_WITH_DOUBLE_CLICK
- };
+ }LeftMouseButtonMode;
- enum MiddleMouseButtonMode
+ typedef enum
{
MIDDLE_BUTTON_GOES_UP_DIR,
MIDDLE_BUTTON_OPENS_NEW_TAB
- };
+ }MiddleMouseButtonMode;
- enum RightMouseButtonMode
+ typedef enum
{
RIGHT_BUTTON_POPUPS_MENU,
RIGHT_BUTTON_SELECTS
- };
+ }RightMouseButtonMode;
- enum TabLockIndicator
+ typedef enum
{
TAB_LOCK_ICON,
TAB_LOCK_ASTERISK,
TAB_LOCK_STYLED_TEXT
- };
+ }TabLockIndicator;
enum {SEARCH_HISTORY_SIZE=10, ADVRENAME_HISTORY_SIZE=10, INTVIEWER_HISTORY_SIZE=16};
@@ -244,7 +244,7 @@ struct GnomeCmdData
struct Options
{
// private:
- GnomeCmdColorTheme color_themes[GNOME_CMD_NUM_COLOR_MODES];
+ GnomeCmdColorTheme color_themes[GNOME_CMD_COLOR_CUSTOM+1];
public:
GcmdSettings *gcmd_settings;
diff --git a/src/gnome-cmd-types.h b/src/gnome-cmd-types.h
index 456bd51..813697d 100644
--- a/src/gnome-cmd-types.h
+++ b/src/gnome-cmd-types.h
@@ -33,46 +33,45 @@ enum FileSelectorID
};
-enum GnomeCmdLayout
+typedef enum
{
GNOME_CMD_LAYOUT_TEXT,
GNOME_CMD_LAYOUT_TYPE_ICONS,
GNOME_CMD_LAYOUT_MIME_ICONS
-};
+}GnomeCmdLayout;
-enum GnomeCmdSizeDispMode
+typedef enum
{
GNOME_CMD_SIZE_DISP_MODE_PLAIN,
GNOME_CMD_SIZE_DISP_MODE_LOCALE,
GNOME_CMD_SIZE_DISP_MODE_GROUPED,
GNOME_CMD_SIZE_DISP_MODE_POWERED
-};
+}GnomeCmdSizeDispMode;
-enum GnomeCmdPermDispMode
+typedef enum
{
GNOME_CMD_PERM_DISP_MODE_TEXT,
GNOME_CMD_PERM_DISP_MODE_NUMBER
-};
+}GnomeCmdPermDispMode;
-enum GnomeCmdQuickSearchShortcut
+typedef enum
{
GNOME_CMD_QUICK_SEARCH_CTRL_ALT,
GNOME_CMD_QUICK_SEARCH_ALT
-};
+}GnomeCmdQuickSearchShortcut;
-enum GnomeCmdExtDispMode
+typedef enum
{
GNOME_CMD_EXT_DISP_WITH_FNAME,
GNOME_CMD_EXT_DISP_STRIPPED,
GNOME_CMD_EXT_DISP_BOTH
-};
-
+}GnomeCmdExtDispMode;
-enum GnomeCmdColorMode
+typedef enum // Watch out for the usage of GNOME_CMD_COLOR_CUSTOM in gnome-cmd-data.h and
dialogs/gnome-cmd-options-dialog.cc when adding another element here.
{
GNOME_CMD_COLOR_NONE,
GNOME_CMD_COLOR_MODERN,
@@ -82,17 +81,16 @@ enum GnomeCmdColorMode
GNOME_CMD_COLOR_CAFEZINHO,
GNOME_CMD_COLOR_GREEN_TIGER,
GNOME_CMD_COLOR_WINTER,
- GNOME_CMD_COLOR_CUSTOM,
- GNOME_CMD_NUM_COLOR_MODES
-};
+ GNOME_CMD_COLOR_CUSTOM
+}GnomeCmdColorMode;
-enum GnomeCmdConfirmOverwriteMode // The (reversed) order of following enums is significant
+typedef enum // The (reversed) order of following enums is significant
{
GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL,
GNOME_CMD_CONFIRM_OVERWRITE_QUERY,
GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY
-};
+}GnomeCmdConfirmOverwriteMode;
struct GnomeCmdColorTheme
diff --git a/src/intviewer/search-dlg.h b/src/intviewer/search-dlg.h
index e04f244..3cedf1f 100644
--- a/src/intviewer/search-dlg.h
+++ b/src/intviewer/search-dlg.h
@@ -31,11 +31,11 @@
struct GViewerSearchDlgPrivate;
-enum SEARCHMODE
+typedef enum
{
SEARCH_MODE_TEXT,
SEARCH_MODE_HEX
-};
+}SEARCHMODE;
struct GViewerSearchDlg
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]