Skip to content
Commits on Source (52)
# for all subdirectories
*~
include:
- project: 'gnome/citemplates'
file: 'flatpak/flatpak_ci_initiative.yml'
flatpak:
variables:
BUNDLE: "dconf-editor-dev.flatpak"
MANIFEST_PATH: "build-aux/ca.desrt.dconf-editor.json"
FLATPAK_MODULE: "dconf-editor"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
APP_ID: "ca.desrt.dconf-editor"
extends: ".flatpak"
dconf-editor 3.38.3
===================
dconf-editor 43.beta
=====================
Fix build with newer vala
New beta release! Adds support for the dark color-scheme.
Translations updated:
Norwegian Bokmål: Kjartan Maraas
dconf-editor 43.alpha
=====================
This release contains a new app icon, various fixes to build with newer vala,
support for building with meson 0.61, and many translation updates.
dconf-editor 3.38.2
=====================
......
{
"id": "ca.desrt.dconf-editor",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "start-dconf-editor",
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=ca.desrt.dconf",
"--filesystem=xdg-run/dconf",
"--filesystem=host:ro",
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
"--env=GIO_EXTRA_MODULES=/app/lib/gio/modules/",
"--talk-name=org.freedesktop.Flatpak"
],
"modules": [
{
"name": "dconf",
"buildsystem": "meson",
"config-opts": ["-Dbash_completion=false", "-Dman=false"],
"cleanup": [
"/include",
"/lib/pkgconfig",
"/libexec",
"/share/dbus-1"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/dconf/0.40/dconf-0.40.0.tar.xz",
"sha256": "cf7f22a4c9200421d8d3325c5c1b8b93a36843650c9f95d6451e20f0bcb24533"
},
{
"type": "patch",
"path": "dconf-override.patch"
}
]
},
{
"name": "scripts",
"buildsystem": "simple",
"build-commands": [
"install -Dm 755 start-dconf-editor.sh /app/bin/start-dconf-editor"
],
"sources": [
{
"type": "file",
"path": "start-dconf-editor.sh"
}
]
},
{
"name": "dconf-editor",
"buildsystem": "meson",
"sources": [
{
"type": "dir",
"path": "../"
}
]
}
]
}
diff --git a/engine/dconf-engine-source-user.c b/engine/dconf-engine-source-user.c
index 1657875..e4f8786 100644
--- a/engine/dconf-engine-source-user.c
+++ b/engine/dconf-engine-source-user.c
@@ -39,11 +39,17 @@ dconf_engine_source_user_open_gvdb (const gchar *name)
{
GvdbTable *table;
gchar *filename;
+ const gchar *override;
+
+ override = g_getenv ("DCONF_USER_CONFIG_DIR");
+ if (override == NULL)
+ filename = g_build_filename (g_get_user_config_dir (), "dconf", name, NULL);
+ else
+ filename = g_build_filename (g_get_home_dir (), override, name, NULL);
/* This can fail in the normal case of the user not having any
* settings. That's OK and it shouldn't be considered as an error.
*/
- filename = g_build_filename (g_get_user_config_dir (), "dconf", name, NULL);
table = gvdb_table_new (filename, FALSE, NULL);
g_free (filename);
#!/usr/bin/bash
IFS=: read -ra host_data_dirs < <(flatpak-spawn --host sh -c 'echo $XDG_DATA_DIRS')
# To avoid potentially muddying up $XDG_DATA_DIRS too much, we link the schema paths
# into a temporary directory.
bridge_dir=$XDG_RUNTIME_DIR/dconf-bridge
mkdir -p "$bridge_dir"
for dir in "${host_data_dirs[@]}"; do
if [[ "$dir" == /usr/* ]]; then
dir=/run/host/"$dir"
fi
schemas="$dir/glib-2.0/schemas"
if [[ -d "$schemas" ]]; then
bridged=$(mktemp -d XXXXXXXXXX -p "$bridge_dir")
mkdir -p "$bridged"/glib-2.0
ln -s "$schemas" "$bridged"/glib-2.0
XDG_DATA_DIRS=$XDG_DATA_DIRS:"$bridged"
fi
done
export XDG_DATA_DIRS
exec dconf-editor "$@"
......@@ -68,108 +68,18 @@ private interface AdaptativeWidget : Object
internal abstract void set_window_size (WindowSize new_size);
}
private abstract class NightTimeAwareHeaderBar : HeaderBar
{
private bool night_time = false; // no need to use NightTime here (that allows an "Unknown" value)
private bool dark_theme = false;
private bool automatic_night_mode = false;
/*\
* * construct
\*/
[CCode (notify = false)] public NightLightMonitor night_light_monitor
{
protected construct
{
night_time = NightLightMonitor.NightTime.should_use_dark_theme (value.night_time);
dark_theme = value.dark_theme;
automatic_night_mode = value.automatic_night_mode;
// menu is already updated three times at startup, let's not add one
ulong night_time_handler = value.notify ["night-time"].connect (night_time_changed);
ulong dark_theme_handler = value.notify ["dark-theme"].connect (dark_theme_changed);
ulong auto_night_handler = value.notify ["automatic-night-mode"].connect (automatic_night_mode_changed);
destroy.connect (() => {
value.disconnect (night_time_handler);
value.disconnect (dark_theme_handler);
value.disconnect (auto_night_handler);
});
}
}
private void night_time_changed (Object nlm, ParamSpec thing)
{
night_time = NightLightMonitor.NightTime.should_use_dark_theme (((NightLightMonitor) nlm).night_time);
update_hamburger_menu ();
}
private void dark_theme_changed (Object nlm, ParamSpec thing)
{
dark_theme = ((NightLightMonitor) nlm).dark_theme;
update_hamburger_menu ();
}
private void automatic_night_mode_changed (Object nlm, ParamSpec thing)
{
automatic_night_mode = ((NightLightMonitor) nlm).automatic_night_mode;
// menu update not needed
}
/*\
* * high-contrast state
\*/
private bool highcontrast_state = false;
internal void set_highcontrast_state (bool highcontrast_new_state)
{
if (highcontrast_state == highcontrast_new_state)
return;
highcontrast_state = highcontrast_new_state;
update_hamburger_menu ();
}
/*\
* * hamburger menu
\*/
protected abstract void update_hamburger_menu ();
protected void append_or_not_night_mode_entry (ref GLib.Menu section)
{
if (night_time && !highcontrast_state)
append_night_mode_entry (dark_theme, automatic_night_mode, ref section);
}
private static inline void append_night_mode_entry (bool dark_theme, bool auto_night, ref GLib.Menu section)
{
if (dark_theme)
/* Translators: there are three related actions: "use", "reuse" and "pause"; displayed in the hamburger menu at night */
section.append (_("Pause night mode"), "app.set-use-night-mode(false)");
else if (auto_night)
/* Translators: there are three related actions: "use", "reuse" and "pause"; displayed in the hamburger menu at night */
section.append (_("Reuse night mode"), "app.set-use-night-mode(true)");
else
/* Translators: there are three related actions: "use", "reuse" and "pause"; displayed in the hamburger menu at night */
section.append (_("Use night mode"), "app.set-use-night-mode(true)");
}
}
private const int LARGE_WINDOW_SIZE = 1042;
[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/adaptative-window.ui")]
private abstract class AdaptativeWindow : ApplicationWindow
{
private NightTimeAwareHeaderBar headerbar;
[CCode (notify = false)] public NightTimeAwareHeaderBar nta_headerbar
private BaseHeaderBar headerbar;
[CCode (notify = false)] public BaseHeaderBar nta_headerbar
{
protected get { return headerbar; }
protected construct
{
NightTimeAwareHeaderBar? _value = value;
BaseHeaderBar? _value = value;
if (_value == null)
assert_not_reached ();
......@@ -438,7 +348,7 @@ private abstract class AdaptativeWindow : ApplicationWindow
if (highcontrast_new_state == highcontrast_state)
return;
highcontrast_state = highcontrast_new_state;
headerbar.set_highcontrast_state (highcontrast_new_state);
headerbar.update_hamburger_menu ();
if (highcontrast_new_state)
window_style_context.add_class ("hc-theme");
......
......@@ -17,7 +17,7 @@
-->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="BaseHeaderBar" parent="NightTimeAwareHeaderBar">
<template class="BaseHeaderBar" parent="GtkHeaderBar">
<property name="show-close-button">True</property>
<property name="has-subtitle">False</property>
<child>
......
......@@ -18,7 +18,7 @@
using Gtk;
[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/base-headerbar.ui")]
private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
private class BaseHeaderBar : HeaderBar, AdaptativeWidget
{
[GtkChild] protected unowned Box center_box;
......@@ -72,7 +72,7 @@ private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
[CCode (notify = false)] public bool has_help { private get; protected construct; default = false; }
[CCode (notify = false)] public bool has_keyboard_shortcuts { private get; protected construct; default = false; }
protected override void update_hamburger_menu ()
public void update_hamburger_menu ()
{
GLib.Menu menu = new GLib.Menu ();
......@@ -96,7 +96,6 @@ private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
private void append_app_actions_section (ref GLib.Menu menu) // FIXME mnemonics?
{
GLib.Menu section = new GLib.Menu ();
append_or_not_night_mode_entry (ref section);
append_or_not_keyboard_shortcuts_entry (has_keyboard_shortcuts, !has_a_phone_size, ref section);
append_or_not_help_entry (has_help, ref section);
append_about_entry (about_action_label, ref section);
......
......@@ -21,7 +21,8 @@
<releases>
<!-- should be kept in versioning inverted order -->
<release version="3.38.3" date="2021-03-23" type="stable" urgency="low"/>
<release version="43~beta" date="2022-07-27" type="development" urgency="low"/>
<release version="43~alpha" date="2022-07-13" type="development" urgency="low"/>
<release version="3.38.2" date="2020-11-22" type="stable" urgency="medium"/>
<release version="3.37.91" date="2020-08-28" type="development" urgency="low"/>
</releases>
......
......@@ -83,13 +83,6 @@
<schemalist gettext-domain='dconf-editor'>
<schema id="ca.desrt.dconf-editor.Lib">
<key name="automatic-night-mode" type="b">
<default>false</default>
<!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/automatic-night-mode' -->
<summary>A flag to follow system night light</summary>
<!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/iagno/automatic-night-mode' -->
<description>Use GNOME night light setting to activate night-mode.</description>
</key>
<key name="window-width" type="i">
<default>540</default>
<!-- see AdaptativeWindow.width-request at data/ui/adaptative-window.ui:22 -->
......
......@@ -171,7 +171,6 @@ private class ConfigurationEditor : Gtk.Application, BaseApplication
private const GLib.ActionEntry [] action_entries =
{
// generic
{ "set-use-night-mode", set_use_night_mode, "b" },
{ "copy", copy_cb, "s" }, // TODO is that really the good way to do things? (see Taquin)
// quit
......@@ -330,9 +329,13 @@ private class ConfigurationEditor : Gtk.Application, BaseApplication
{
base.startup ();
Hdy.init ();
Environment.set_application_name (PROGRAM_NAME);
Gtk.Window.set_default_icon_name ("ca.desrt.dconf-editor");
Hdy.StyleManager.get_default ().set_color_scheme (PREFER_LIGHT);
add_action_entries (action_entries, this);
set_accels_for_action ("bw.toggle-bookmark", { "<Primary>b",
"<Shift><Primary>b" });
......@@ -377,8 +380,6 @@ private class ConfigurationEditor : Gtk.Application, BaseApplication
"<Primary>question",
"<Shift><Primary>question"}); // "<Primary>F1" is automatically done
init_night_mode ();
Gtk.CssProvider css_provider = new Gtk.CssProvider ();
css_provider.load_from_resource ("/ca/desrt/dconf-editor/ui/dconf-editor.css");
Gdk.Screen? screen = Gdk.Screen.get_default ();
......@@ -404,23 +405,6 @@ private class ConfigurationEditor : Gtk.Application, BaseApplication
info (_("Looks like the DConf settings backend is used, all looks good."));
} */
/*\
* * Night mode
\*/
NightLightMonitor night_light_monitor; // keep it here or it is unrefed
private void init_night_mode ()
{
night_light_monitor = new NightLightMonitor ("/ca/desrt/dconf-editor/");
}
private void set_use_night_mode (SimpleAction action, Variant? gvariant)
requires (gvariant != null)
{
night_light_monitor.set_use_night_mode (((!) gvariant).get_boolean ());
}
/*\
* * Window activation
\*/
......@@ -563,7 +547,7 @@ private class ConfigurationEditor : Gtk.Application, BaseApplication
private Gtk.Window get_new_window (string? schema, string? path, string? key_name)
{
DConfWindow window = new DConfWindow (disable_warning, schema, path, key_name, night_light_monitor);
DConfWindow window = new DConfWindow (disable_warning, schema, path, key_name);
add_window (window);
return (Gtk.Window) window;
......
......@@ -47,11 +47,10 @@ private class DConfHeaderBar : BookmarksHeaderBar, AdaptativeWidget
register_modifications_mode ();
}
internal static DConfHeaderBar (NightLightMonitor _night_light_monitor)
internal static DConfHeaderBar ()
{
/* Translators: usual menu entry of the hamburger menu */
Object (about_action_label: _("About Dconf Editor"),
night_light_monitor: _night_light_monitor,
has_help: false,
has_keyboard_shortcuts: true);
}
......
......@@ -41,14 +41,14 @@ private class DConfWindow : BookmarksWindow, AdaptativeWidget
private DConfHeaderBar headerbar;
private DConfView main_view;
internal DConfWindow (bool disable_warning, string? schema, string? path, string? key_name, NightLightMonitor night_light_monitor)
internal DConfWindow (bool disable_warning, string? schema, string? path, string? key_name)
{
SettingsModel _model = new SettingsModel ();
ModificationsHandler _modifications_handler = new ModificationsHandler (_model);
DConfHeaderBar _headerbar = new DConfHeaderBar (night_light_monitor);
DConfHeaderBar _headerbar = new DConfHeaderBar ();
DConfView _main_view = new DConfView (_modifications_handler);
Object (nta_headerbar : (NightTimeAwareHeaderBar) _headerbar,
Object (nta_headerbar : (BaseHeaderBar) _headerbar,
base_view : (BaseView) _main_view,
window_title : ConfigurationEditor.PROGRAM_NAME,
specific_css_class_or_empty : "dconf-editor",
......