From f59500bfe360dce317af6b3c24c9a71206e9011a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 19 Nov 2021 09:16:00 +0100 Subject: GSettings: Use org.ayatana.display.gschema.xml for non-Lomiri sessions and unit tests. Additionally, internationalize the org.ayatana.display GSettings schema. Fixes https://github.com/AyatanaIndicators/ayatana-indicator-display/issues/39 --- data/CMakeLists.txt | 17 +++++++++++++---- data/org.ayatana.display.gschema.xml | 24 ------------------------ data/org.ayatana.display.gschema.xml.in | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 28 deletions(-) delete mode 100644 data/org.ayatana.display.gschema.xml create mode 100644 data/org.ayatana.display.gschema.xml.in (limited to 'data') diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index acc462f..6f8cda1 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,12 +1,21 @@ find_package(GSettings) ## -## GSettings +## GSettings schema ## -if(NOT EXISTS /usr/share/glib-2.0/schemas/com.lomiri.touch.system.gschema.xml) - add_schema ("org.ayatana.indicator.display.gschema.xml") -endif() +set (SCHEMA_NAME "org.ayatana.display.gschema.xml") +set (SCHEMA_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}") +set (SCHEMA_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}.in") + +# generate the .xml file using intltool +find_package(Intltool REQUIRED) +set (ENV{LC_ALL} "C") +intltool_merge_translations("${SCHEMA_FILE_IN}" "${SCHEMA_FILE}" ALL UTF8 STYLE "xml" NO_TRANSLATIONS) + +# let GSettings do the rest +find_package(GSettings REQUIRED) +add_schema (${SCHEMA_NAME}) ## ## Systemd Unit File diff --git a/data/org.ayatana.display.gschema.xml b/data/org.ayatana.display.gschema.xml deleted file mode 100644 index 9afa253..0000000 --- a/data/org.ayatana.display.gschema.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - false - Lock rotation - - Lock automatic display rotation. - - - - "none" - Orientation lock - Locks orientation to a specific value. - - - diff --git a/data/org.ayatana.display.gschema.xml.in b/data/org.ayatana.display.gschema.xml.in new file mode 100644 index 0000000..afcd996 --- /dev/null +++ b/data/org.ayatana.display.gschema.xml.in @@ -0,0 +1,24 @@ + + + + + + + + + + + + false + <_summary>Lock rotation + <_description> + Lock automatic display rotation. + + + + "none" + <_summary>Orientation lock + <_description>Locks orientation to a specific value. + + + -- cgit v1.2.3