[dconf-editor] Readd “Sort preferences changed” warning.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Readd “Sort preferences changed” warning.
- Date: Fri, 15 Dec 2017 05:49:52 +0000 (UTC)
commit 16192d26e22d0a2d89671a75ef8b8f94c35d0f98
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Dec 15 06:48:33 2017 +0100
Readd “Sort preferences changed” warning.
It’s easier to accept to click there, and the behaviour of the two “reload”
buttons might be different at one point (regarding pending changes).
editor/browser-view.ui | 46 +++++++++++++++++++++++++++++++++++++++++++++-
editor/browser-view.vala | 37 ++++++++++++++++++++++++++++---------
editor/dconf-window.vala | 2 +-
po/es.po | 9 +++++++--
po/id.po | 7 ++++++-
5 files changed, 87 insertions(+), 14 deletions(-)
---
diff --git a/editor/browser-view.ui b/editor/browser-view.ui
index 85454c6..0d0e057 100644
--- a/editor/browser-view.ui
+++ b/editor/browser-view.ui
@@ -4,7 +4,51 @@
<template class="BrowserView" parent="GtkGrid">
<property name="orientation">vertical</property>
<child>
- <object class="GtkRevealer" id="need_reload_warning_revealer">
+ <object class="GtkRevealer" id="need_soft_reload_warning_revealer">
+ <property name="visible">True</property>
+ <property name="reveal-child">False</property>
+ <child>
+ <object class="GtkInfoBar">
+ <property name="visible">True</property>
+ <property name="message-type">info</property>
+ <child internal-child="action_area">
+ <object class="GtkBox">
+ <property name="visible">False</property>
+ </object>
+ </child>
+ <child internal-child="content_area">
+ <object class="GtkBox">
+ <child>
+ <object class="RegistryWarning">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="max-width-chars">40</property>
+ <property name="wrap">True</property>
+ <property name="label" translatable="yes">Sort preferences have changed. Do you want
to reload the view?</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Reload</property>
+ <signal name="clicked" handler="reload"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="need_hard_reload_warning_revealer">
<property name="visible">True</property>
<property name="reveal-child">False</property>
<child>
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index 45df85a..01641c8 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -33,7 +33,8 @@ class BrowserView : Grid, PathElement
private GLib.Settings settings = new GLib.Settings ("ca.desrt.dconf-editor.Settings");
private Directory current_directory;
- [GtkChild] private Revealer need_reload_warning_revealer;
+ [GtkChild] private Revealer need_soft_reload_warning_revealer;
+ [GtkChild] private Revealer need_hard_reload_warning_revealer;
[GtkChild] private Stack stack;
[GtkChild] private RegistryView browse_view;
@@ -95,7 +96,7 @@ class BrowserView : Grid, PathElement
return;
GLib.ListStore? key_model = browse_view.get_key_model ();
if (key_model != null && !sorting_options.is_key_model_sorted ((!) key_model))
- need_reload_warning_revealer.set_reveal_child (true);
+ show_soft_reload_warning ();
// TODO reload search results too
});
@@ -131,11 +132,6 @@ class BrowserView : Grid, PathElement
}
}
- public void show_reload_warning ()
- {
- need_reload_warning_revealer.set_reveal_child (true);
- }
-
private void show_browse_view (string path, string? selected)
{
_show_browse_view (path);
@@ -145,7 +141,7 @@ class BrowserView : Grid, PathElement
{
stack.set_transition_type (current_path.has_prefix (path) && pre_search_view == null ?
StackTransitionType.CROSSFADE : StackTransitionType.NONE);
pre_search_view = null;
- need_reload_warning_revealer.set_reveal_child (false);
+ hide_reload_warning ();
browse_view.show_multiple_schemas_warning (current_directory.warning_multiple_schemas);
update_current_path (path);
@@ -164,7 +160,7 @@ class BrowserView : Grid, PathElement
{
properties_view.populate_properties_list_box (key, warning_multiple_schemas);
- need_reload_warning_revealer.set_reveal_child (false);
+ hide_reload_warning ();
browse_view.show_multiple_schemas_warning (false);
stack.set_transition_type (current_path == SettingsModel.get_parent_path (path) && pre_search_view
== null ? StackTransitionType.CROSSFADE : StackTransitionType.NONE);
@@ -267,6 +263,29 @@ class BrowserView : Grid, PathElement
}
/*\
+ * * Reload warnings
+ \*/
+
+ private void hide_reload_warning ()
+ {
+ need_soft_reload_warning_revealer.set_reveal_child (false);
+ need_hard_reload_warning_revealer.set_reveal_child (false);
+ }
+
+ private void show_soft_reload_warning ()
+ {
+ if (!need_hard_reload_warning_revealer.get_reveal_child ())
+ need_soft_reload_warning_revealer.set_reveal_child (true);
+ }
+
+ public void show_hard_reload_warning ()
+ {
+ if (need_soft_reload_warning_revealer.get_reveal_child ())
+ need_soft_reload_warning_revealer.set_reveal_child (false);
+ need_hard_reload_warning_revealer.set_reveal_child (true);
+ }
+
+ /*\
* * Keyboard calls
\*/
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index f610c6a..edc3021 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -87,7 +87,7 @@ class DConfWindow : ApplicationWindow
current_path_modified = true;
});
if (current_path_modified)
- browser_view.show_reload_warning ();
+ browser_view.show_hard_reload_warning ();
});
if (!disable_warning && settings.get_boolean ("show-warning"))
diff --git a/po/es.po b/po/es.po
index 178c8f6..e5d93d2 100644
--- a/po/es.po
+++ b/po/es.po
@@ -55,8 +55,13 @@ msgstr "Quitar"
msgid "Remove this bookmark"
msgstr "Quitar este marcador"
-#: editor/browser-view.ui:22
-#| msgid "Sort preferences have changed. Do you want to reload the view?"
+#: editor/browser-view.ui:32
+msgid "Sort preferences have changed. Do you want to reload the view?"
+msgstr ""
+"La ordenación de las preferencias ha cambiado. ¿Quiere volver a cargar la "
+"vista?"
+
+#: editor/browser-view.ui:76
msgid "This content has changed. Do you want to reload the view?"
msgstr "El contenido ha cambiado. ¿Quiere volver a cargar la vista?"
diff --git a/po/id.po b/po/id.po
index 3db54c2..2a5c86f 100644
--- a/po/id.po
+++ b/po/id.po
@@ -56,7 +56,12 @@ msgstr "Hapus"
msgid "Remove this bookmark"
msgstr "Buang penanda taut ini"
-#: editor/browser-view.ui:22
+#: editor/browser-view.ui:32
+msgid "Sort preferences have changed. Do you want to reload the view?"
+msgstr ""
+"Preferensi pengurutan telah berubah. Apakah Anda hendak memuat ulang tilikan?"
+
+#: editor/browser-view.ui:76
msgid "This content has changed. Do you want to reload the view?"
msgstr "Isi ini telah berubah. Apakah Anda hendak memuat ulang tilikan?"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]