[dconf-editor] Introduce AboutList.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Introduce AboutList.
- Date: Thu, 22 Nov 2018 12:36:00 +0000 (UTC)
commit 63b12726a1fd6144ccd66f1a00167a9f19bcf723
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Nov 21 22:25:12 2018 +0100
Introduce AboutList.
editor/about-list.vala | 166 ++++++++++++++++++++++++++++++++++++++++++
editor/browser-headerbar.ui | 22 ++++++
editor/browser-headerbar.vala | 54 ++++++++++++--
editor/browser-view.ui | 10 ++-
editor/browser-view.vala | 29 ++++++++
editor/dconf-editor.css | 18 +++++
editor/dconf-editor.vala | 22 ------
editor/dconf-window.vala | 114 +++++++++++++++++++++++++----
editor/meson.build | 1 +
editor/overlayed-list.vala | 2 +-
10 files changed, 394 insertions(+), 44 deletions(-)
---
diff --git a/editor/about-list.vala b/editor/about-list.vala
new file mode 100644
index 0000000..616d773
--- /dev/null
+++ b/editor/about-list.vala
@@ -0,0 +1,166 @@
+/*
+ This file is part of Dconf Editor
+
+ Dconf Editor is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Dconf Editor is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Dconf Editor. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+using Gtk;
+
+private class AboutList : OverlayedList
+{
+ construct
+ {
+ install_action_entries ();
+
+ main_list_box.selection_mode = SelectionMode.NONE;
+ get_style_context ().add_class ("about-list");
+
+ first_mode_name = _("About");
+ second_mode_name = _("Credits");
+ change_editability (true);
+
+ show_apropos ();
+ }
+
+ /*\
+ * * Action entries
+ \*/
+
+ private void install_action_entries ()
+ {
+ SimpleActionGroup action_group = new SimpleActionGroup ();
+ action_group.add_action_entries (action_entries, this);
+ insert_action_group ("about", action_group);
+ }
+
+ private const GLib.ActionEntry [] action_entries =
+ {
+ { "set-edit-mode", set_edit_mode, "b", "false" }
+ };
+
+ private void set_edit_mode (SimpleAction action, Variant? variant)
+ requires (variant != null)
+ {
+ bool new_state = ((!) variant).get_boolean ();
+ action.set_state (new_state);
+
+ if (new_state)
+ show_credits ();
+ else
+ show_apropos ();
+ }
+
+ private void show_apropos ()
+ {
+ main_list_store.remove_all ();
+ main_list_store.append (new AboutListItem.from_icon_name (AboutDialogInfos.logo_icon_name));
+ main_list_store.append (new AboutListItem.from_label (AboutDialogInfos.program_name,
"bold-label"));
+ main_list_store.append (new AboutListItem.from_label (AboutDialogInfos.version));
+ main_list_store.append (new AboutListItem.from_label (AboutDialogInfos.comments));
+ main_list_store.append (new AboutListItem.from_link (AboutDialogInfos.website,
+ AboutDialogInfos.website_label));
+ main_list_store.append (new AboutListItem.from_label (AboutDialogInfos.copyright,
"small-label"));
+
+ if (AboutDialogInfos.license_type != License.GPL_3_0)
+ assert_not_reached (); // TODO support all licenses type
+ main_list_store.append (new AboutListItem.from_link
("https://www.gnu.org/licenses/gpl-3.0.html", _("GNU General Public License\nversion 3 or later"))); //
TODO better
+ }
+
+ private void show_credits ()
+ {
+ main_list_store.remove_all ();
+ main_list_store.append (new AboutListItem.from_icon_name (AboutDialogInfos.logo_icon_name));
+ main_list_store.append (new AboutListItem.from_label (AboutDialogInfos.program_name,
"bold-label"));
+
+ string authors = "";
+ uint position = 0;
+ uint max_position = AboutDialogInfos.authors.length - 1;
+ foreach (string author in AboutDialogInfos.authors)
+ {
+ authors += author;
+ if (position < max_position)
+ authors += "\n";
+ position++;
+ }
+ main_list_store.append (new AboutListItem.with_title (authors, _("Creators")));
+
+ main_list_store.append (new AboutListItem.with_title (AboutDialogInfos.translator_credits,
_("Translators")));
+ }
+}
+
+private class AboutListItem : Grid
+{
+ internal AboutListItem.from_label (string text, string? css_class = null)
+ {
+ Label label = new Label (text);
+ label.visible = true;
+ label.hexpand = true;
+ label.wrap_mode = Pango.WrapMode.WORD_CHAR;
+ label.wrap = true;
+ label.justify = Justification.CENTER;
+ label.selectable = true;
+ if (css_class != null)
+ label.get_style_context ().add_class ((!) css_class);
+ add (label);
+ }
+
+ internal AboutListItem.from_icon_name (string icon_name)
+ {
+ Image image = new Image.from_icon_name (icon_name, IconSize.DIALOG);
+ image.pixel_size = 128;
+ image.visible = true;
+ image.hexpand = true;
+ add (image);
+ }
+
+ internal AboutListItem.from_link (string link, string text)
+ {
+ LinkButton button = new LinkButton.with_label (link, text);
+ button.visible = true;
+ button.hexpand = true;
+
+ Widget? widget = button.get_child ();
+ if (widget == null || !(((!) widget) is Label))
+ assert_not_reached ();
+ Label label = (Label) (!) widget;
+ label.wrap_mode = Pango.WrapMode.WORD_CHAR;
+ label.wrap = true;
+ label.justify = Justification.CENTER;
+
+ add (button);
+ }
+
+ internal AboutListItem.with_title (string text, string title)
+ {
+ this.orientation = Orientation.VERTICAL;
+
+ Label label = new Label (title);
+ label.visible = true;
+ label.hexpand = true;
+ label.wrap_mode = Pango.WrapMode.WORD_CHAR;
+ label.wrap = true;
+ label.get_style_context ().add_class ("bold-label");
+ add (label);
+
+ label = new Label (text);
+ label.visible = true;
+ label.hexpand = true;
+ label.wrap_mode = Pango.WrapMode.WORD_CHAR;
+ label.wrap = true;
+ label.selectable = true;
+ label.get_style_context ().add_class ("small-label");
+ label.justify = Justification.CENTER;
+ add (label);
+ }
+}
diff --git a/editor/browser-headerbar.ui b/editor/browser-headerbar.ui
index 29d8370..ff76edd 100644
--- a/editor/browser-headerbar.ui
+++ b/editor/browser-headerbar.ui
@@ -41,6 +41,22 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkButton" id="hide_about_button">
+ <property name="visible">False</property>
+ <property name="action-name">ui.hide-in-window-about</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">go-previous-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ </object>
+ </child>
<!-- child>
<object class="GtkButton" id="apply_modifications_button">
<property name="visible">False</property>
@@ -119,6 +135,12 @@
<property name="label" translatable="yes">Pending</property>
</object>
</child>
+ <child>
+ <object class="GtkLabel" id="about_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">About</property>
+ </object>
+ </child>
</object>
</child>
<child>
diff --git a/editor/browser-headerbar.vala b/editor/browser-headerbar.vala
index 9e65324..f4d1b63 100644
--- a/editor/browser-headerbar.vala
+++ b/editor/browser-headerbar.vala
@@ -51,6 +51,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
bookmarks_button.sensitive = true;
bookmarks_revealer.set_reveal_child (true);
hide_in_window_bookmarks ();
+ hide_in_window_about ();
}
update_hamburger_menu (delay_mode);
update_modifications_button ();
@@ -155,6 +156,41 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
construct_modifications_actions_button_menu ();
}
+ /*\
+ * * in-window about
+ \*/
+
+ [GtkChild] private Label about_label;
+ [GtkChild] private Button hide_about_button;
+
+ bool in_window_about = false;
+
+ internal void show_in_window_about ()
+ {
+ if (in_window_bookmarks)
+ hide_in_window_bookmarks ();
+ else if (in_window_modifications)
+ hide_in_window_modifications ();
+
+ in_window_about = true;
+ update_modifications_button ();
+ info_button.hide ();
+ hide_about_button.show ();
+ bookmarks_stack.hexpand = false; // hack 1/7
+ title_stack.set_visible_child (about_label);
+ }
+
+ internal void hide_in_window_about ()
+ {
+ hide_about_button.hide ();
+ bookmarks_stack.hexpand = false; // hack 2/7
+ title_stack.set_visible_child (path_widget);
+ in_window_about = false;
+ if (extra_small_window)
+ modifications_separator.show ();
+ info_button.show ();
+ }
+
/*\
* * in-window modifications
\*/
@@ -193,7 +229,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
show_modifications_button.hide ();
modifications_separator.hide ();
}
- else if (in_window_bookmarks)
+ else if (in_window_bookmarks || in_window_about)
{
show_modifications_button.show ();
modifications_separator.hide ();
@@ -218,6 +254,8 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
{
if (in_window_bookmarks)
hide_in_window_bookmarks ();
+ else if (in_window_about)
+ hide_in_window_about ();
in_window_modifications = true;
info_button.hide ();
@@ -225,7 +263,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
show_modifications_button.hide ();
modifications_actions_button.show ();
hide_modifications_button.show ();
- bookmarks_stack.hexpand = false; // hack 1/5
+ bookmarks_stack.hexpand = false; // hack 3/7
title_stack.set_visible_child (modifications_label);
}
@@ -238,7 +276,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
show_modifications_button.show ();
modifications_separator.show ();
}
- bookmarks_stack.hexpand = false; // hack 2/5
+ bookmarks_stack.hexpand = false; // hack 4/7
title_stack.set_visible_child (path_widget);
in_window_modifications = false;
info_button.show ();
@@ -268,12 +306,14 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
{
if (in_window_modifications)
hide_in_window_modifications ();
+ else if (in_window_about)
+ hide_in_window_about ();
in_window_bookmarks = true;
update_modifications_button ();
info_button.hide ();
bookmarks_actions_separator.hide ();
- bookmarks_stack.hexpand = false; // hack 3/5
+ bookmarks_stack.hexpand = false; // hack 5/7
title_stack.set_visible_child (bookmarks_stack);
bookmarks_stack.set_visible_child (bookmarks_label);
hide_in_window_bookmarks_button.show ();
@@ -285,7 +325,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
bookmarks_actions_separator.hide ();
in_window_bookmarks = false;
update_modifications_button ();
- bookmarks_stack.hexpand = false; // hack 4/5
+ bookmarks_stack.hexpand = false; // hack 6/7
title_stack.set_visible_child (path_widget);
bookmarks_stack.set_visible_child (bookmarks_label);
info_button.show ();
@@ -295,7 +335,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
internal void edit_in_window_bookmarks ()
requires (in_window_bookmarks == true)
{
- bookmarks_stack.hexpand = true; // hack 5/5
+ bookmarks_stack.hexpand = true; // hack 7/7
bookmarks_actions_separator.show ();
bookmarks_stack.set_visible_child (bookmarks_controller);
}
@@ -419,7 +459,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
append_or_not_night_mode_entry (night_time, dark_theme, auto_night, ref section);
if (!extra_small_window) // TODO else...
section.append (_("Keyboard Shortcuts"), "win.show-help-overlay");
- section.append (_("About Dconf Editor"), "app.about"); // TODO move as "win."
+ section.append (_("About Dconf Editor"), "ui.about");
section.freeze ();
menu.append_section (null, section);
}
diff --git a/editor/browser-view.ui b/editor/browser-view.ui
index 0a4f3f9..dd2c4c9 100644
--- a/editor/browser-view.ui
+++ b/editor/browser-view.ui
@@ -34,10 +34,18 @@
<child>
<object class="ModificationsList" id="modifications_list">
<property name="visible">True</property>
+ <property name="needs-shadows">False</property>
<property name="big-placeholder">True</property>
- <property name="edit-mode-action-prefix">bmk</property>
<signal name="selection-changed" handler="on_modifications_selection_changed"/>
</object>
</child>
+ <child>
+ <object class="AboutList" id="about_list">
+ <property name="visible">True</property>
+ <property name="needs-shadows">False</property>
+ <property name="big-placeholder">True</property>
+ <property name="edit-mode-action-prefix">about</property>
+ </object>
+ </child>
</template>
</interface>
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index db9b3d8..2bc7e6d 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -199,6 +199,31 @@ private class BrowserView : Stack, AdaptativeWidget
modifications_handler.set_gsettings_key_value (full_name, context_id, new Variant.boolean
(key_value_request));
}
+ /*\
+ * * in-window about
+ \*/
+
+ internal bool in_window_about { internal get; private set; default = false; }
+
+ [GtkChild] private AboutList about_list;
+
+ internal void show_in_window_about ()
+ {
+ if (in_window_bookmarks)
+ hide_in_window_bookmarks ();
+ else if (in_window_modifications)
+ hide_in_window_modifications ();
+
+ set_visible_child (about_list);
+ in_window_about = true;
+ }
+
+ internal void hide_in_window_about ()
+ {
+ in_window_about = false;
+ set_visible_child (current_child_grid);
+ }
+
/*\
* * modifications
\*/
@@ -211,6 +236,8 @@ private class BrowserView : Stack, AdaptativeWidget
{
if (in_window_bookmarks)
hide_in_window_bookmarks ();
+ else if (in_window_about)
+ hide_in_window_about ();
set_visible_child (modifications_list);
in_window_modifications = true;
@@ -304,6 +331,8 @@ private class BrowserView : Stack, AdaptativeWidget
{
if (in_window_modifications)
hide_in_window_modifications ();
+ else if (in_window_about)
+ hide_in_window_about ();
if (bookmarks != old_bookmarks)
{
diff --git a/editor/dconf-editor.css b/editor/dconf-editor.css
index 7cc33f9..f8d27b0 100644
--- a/editor/dconf-editor.css
+++ b/editor/dconf-editor.css
@@ -109,6 +109,18 @@
.delayed-list:dir(ltr) > scrolledwindow > viewport > list > row .value-label { padding-right:6px; }
.delayed-list:dir(rtl) > scrolledwindow > viewport > list > row .value-label { padding-left:6px; }
+/*\
+* * in-window about
+\*/
+
+.about-list > scrolledwindow > viewport > list {
+ padding-bottom:3rem;
+}
+.about-list > scrolledwindow > viewport > list > row {
+ padding:4px;
+ min-height:1.3rem;
+}
+
/*\
* * lists rows height and icon
\*/
@@ -411,6 +423,12 @@ window:not(.extra-small-window) .keys-list:dir(rtl) > row > .key > grid >
* * text formating
\*/
+.small-label {
+ font-size:small;
+}
+.bold-label {
+ font-weight:bold;
+}
.italic-label {
font-style:italic;
}
diff --git a/editor/dconf-editor.vala b/editor/dconf-editor.vala
index 357c568..d671eea 100644
--- a/editor/dconf-editor.vala
+++ b/editor/dconf-editor.vala
@@ -154,7 +154,6 @@ private class ConfigurationEditor : Gtk.Application
// 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)
- { "about", about_cb },
// quit
{ "quit", quit_if_no_pending_changes },
@@ -570,27 +569,6 @@ private class ConfigurationEditor : Gtk.Application
* * App-menu callbacks
\*/
- internal void about_cb ()
- {
- string [] authors = { "Robert Ancell", "Arnaud Bonatti" };
- Gtk.Window? window = get_active_window ();
- if (window == null)
- return;
- Gtk.show_about_dialog ((!) window,
- "program-name", _("dconf Editor"),
- "version", Config.VERSION,
- "comments", _("A graphical viewer and editor of applications’ internal
settings."),
- "copyright", _("Copyright \xc2\xa9 2010-2014 – Canonical Ltd\nCopyright
\xc2\xa9 2015-2018 – Arnaud Bonatti\nCopyright \xc2\xa9 2017-2018 – Davi da Silva Böger"),
- "license-type", Gtk.License.GPL_3_0, /* means "version 3.0 or later" */
- "wrap-license", true,
- "authors", authors,
- /* Translators: This string should be replaced by a text crediting yourselves
and your translation team, or should be left empty. Do not translate literally! */
- "translator-credits", _("translator-credits"),
- "logo-icon-name", "ca.desrt.dconf-editor",
- "website", "https://wiki.gnome.org/Apps/DconfEditor",
- null);
- }
-
private void quit_if_no_pending_changes ()
{
Gtk.Window? window = get_active_window ();
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 79ea0c4..2044aa1 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -619,6 +619,8 @@ private class DConfWindow : ApplicationWindow
{ "show-in-window-modifications", show_in_window_modifications },
{ "hide-in-window-modifications", hide_in_window_modifications },
+ { "hide-in-window-about", hide_in_window_about },
+
{ "reset-recursive", reset_recursively, "s" },
{ "reset-visible", reset_visible, "s" },
@@ -629,7 +631,8 @@ private class DConfWindow : ApplicationWindow
{ "dismiss-change", dismiss_change, "s" }, // here because needs to be accessed from
DelayedSettingView rows
{ "erase", erase_dconf_key, "s" }, // here because needs a reload_view as we enter
delay_mode
- { "hide-notification", hide_notification }
+ { "hide-notification", hide_notification },
+ { "about", about_cb }
};
private void empty (/* SimpleAction action, Variant? variant */) {}
@@ -670,6 +673,7 @@ private class DConfWindow : ApplicationWindow
headerbar.close_popovers ();
revealer.hide_modifications_list ();
hide_in_window_modifications ();
+ hide_in_window_about ();
string full_name;
uint16 context_id;
@@ -715,6 +719,7 @@ private class DConfWindow : ApplicationWindow
headerbar.close_popovers ();
revealer.hide_modifications_list ();
hide_in_window_modifications ();
+ hide_in_window_about ();
string full_name;
uint16 context_id;
@@ -854,6 +859,12 @@ private class DConfWindow : ApplicationWindow
browser_view.hide_in_window_modifications ();
}
+ private void hide_in_window_about (/* SimpleAction action, Variant? path_variant */)
+ {
+ headerbar.hide_in_window_about ();
+ browser_view.hide_in_window_about ();
+ }
+
private void reset_recursively (SimpleAction action, Variant? path_variant)
requires (path_variant != null)
{
@@ -912,6 +923,37 @@ private class DConfWindow : ApplicationWindow
notification_revealer.set_reveal_child (false);
}
+ private void about_cb () // register as "win.about"?
+ {
+ if (extra_small_window)
+ {
+ if (browser_view.in_window_about)
+ hide_in_window_about ();
+ else
+ {
+ headerbar.show_in_window_about ();
+ browser_view.show_in_window_about ();
+ }
+ }
+ else // TODO hide the dialog if visible
+ {
+ string [] authors = AboutDialogInfos.authors;
+ Gtk.show_about_dialog (this,
+ "program-name", AboutDialogInfos.program_name,
+ "version", AboutDialogInfos.version,
+ "comments", AboutDialogInfos.comments,
+ "copyright", AboutDialogInfos.copyright,
+ "license-type", AboutDialogInfos.license_type,
+ "wrap-license", true,
+ "authors", authors,
+ "translator-credits", AboutDialogInfos.translator_credits,
+ "logo-icon-name", AboutDialogInfos.logo_icon_name,
+ "website", AboutDialogInfos.website,
+ "website-label", AboutDialogInfos.website_label,
+ null);
+ }
+ }
+
/*\
* * bookmarks action entries
\*/
@@ -1106,6 +1148,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications) // TODO better
return;
+ if (browser_view.in_window_about) // TODO better
+ return;
browser_view.discard_row_popover ();
@@ -1129,6 +1173,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications) // TODO better
return;
+ if (browser_view.in_window_about) // TODO better
+ return;
browser_view.discard_row_popover ();
headerbar.bookmark_current_path ();
@@ -1140,6 +1186,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications) // TODO better
return;
+ if (browser_view.in_window_about) // TODO better
+ return;
browser_view.discard_row_popover ();
headerbar.unbookmark_current_path ();
@@ -1151,6 +1199,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications) // TODO better
return;
+ if (browser_view.in_window_about) // TODO better
+ return;
headerbar.close_popovers (); // should never be needed if headerbar.search_mode_enabled
browser_view.discard_row_popover (); // could be needed if headerbar.search_mode_enabled
@@ -1187,6 +1237,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications) // TODO better
return;
+ if (browser_view.in_window_about) // TODO better
+ return;
if (browser_view.current_view == ViewType.FOLDER)
request_config (current_path);
@@ -1214,6 +1266,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
if (!headerbar.search_mode_enabled)
request_search (true, PathEntry.SearchMode.EDIT_PATH_MOVE_END);
@@ -1225,6 +1279,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
if (!headerbar.search_mode_enabled)
request_search (true, PathEntry.SearchMode.EDIT_PATH_SELECT_LAST_WORD);
@@ -1236,6 +1292,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
go_backward (true);
}
@@ -1246,6 +1304,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
if (browser_view.current_view == ViewType.CONFIG)
request_folder (current_path);
@@ -1259,6 +1319,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
go_forward (false);
}
@@ -1269,6 +1331,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
go_forward (true);
}
@@ -1289,6 +1353,8 @@ private class DConfWindow : ApplicationWindow
}
else if (browser_view.in_window_modifications)
hide_in_window_modifications ();
+ else if (browser_view.in_window_about)
+ hide_in_window_about ();
else if (headerbar.search_mode_enabled)
stop_search ();
else if (current_type == ViewType.CONFIG)
@@ -1314,6 +1380,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
browser_view.discard_row_popover ();
browser_view.toggle_boolean_key ();
@@ -1327,6 +1395,8 @@ private class DConfWindow : ApplicationWindow
return;
if (browser_view.in_window_modifications)
return;
+ if (browser_view.in_window_about)
+ return;
if (revealer.dismiss_selected_modification ())
{
@@ -1556,14 +1626,23 @@ private class DConfWindow : ApplicationWindow
[GtkCallback]
private bool on_key_press_event (Widget widget, Gdk.EventKey event)
{
+ uint keyval = event.keyval;
+ string name = (!) (Gdk.keyval_name (keyval) ?? "");
+
+ if (name == "F1") // TODO fix dance done with the F1 & <Primary>F1 shortcuts that show help overlay
+ {
+ browser_view.discard_row_popover ();
+ if ((event.state & Gdk.ModifierType.SHIFT_MASK) == 0)
+ return false; // help overlay
+ about_cb ();
+ return true;
+ }
+
if (browser_view.in_window_bookmarks)
return false;
if (browser_view.in_window_modifications)
return false;
- uint keyval = event.keyval;
- string name = (!) (Gdk.keyval_name (keyval) ?? "");
-
Widget? focus = get_focus ();
bool focus_is_text_widget = focus != null && (((!) focus is Entry) || ((!) focus is TextView));
@@ -1606,15 +1685,6 @@ private class DConfWindow : ApplicationWindow
}
}
- if (name == "F1") // TODO fix dance done with the F1 & <Primary>F1 shortcuts that show help overlay
- {
- browser_view.discard_row_popover ();
- if ((event.state & Gdk.ModifierType.SHIFT_MASK) == 0)
- return false; // help overlay
- ((ConfigurationEditor) get_application ()).about_cb ();
- return true;
- }
-
/* don't use "else if", or some widgets will not be hidden on <ctrl>F10 or such things */
if (name == "F10" && (event.state & Gdk.ModifierType.SHIFT_MASK) != 0)
{
@@ -1742,3 +1812,21 @@ private class DConfWindow : ApplicationWindow
show_notification (_("There’s nothing in requested folder “%s”.").printf (full_name));
}
}
+
+namespace AboutDialogInfos
+{
+ // strings
+ internal const string program_name = _("dconf Editor");
+ internal const string version = Config.VERSION;
+ internal const string comments = _("A graphical viewer and editor of applications’ internal settings.");
+ internal const string copyright = _("Copyright \xc2\xa9 2010-2014 – Canonical Ltd\nCopyright \xc2\xa9
2015-2018 – Arnaud Bonatti\nCopyright \xc2\xa9 2017-2018 – Davi da Silva Böger");
+ /* Translators: This string should be replaced by a text crediting yourselves and your translation team,
or should be left empty. Do not translate literally! */
+ internal const string translator_credits = _("translator-credits");
+
+ // various
+ internal const string logo_icon_name = "ca.desrt.dconf-editor";
+ internal const string website = "https://wiki.gnome.org/Apps/DconfEditor";
+ internal const string website_label = "Page on GNOME wiki";
+ internal const string [] authors = { "Robert Ancell", "Arnaud Bonatti" };
+ internal const License license_type = License.GPL_3_0; /* means "version 3.0 or later" */
+}
diff --git a/editor/meson.build b/editor/meson.build
index 40c43bc..66b7f91 100644
--- a/editor/meson.build
+++ b/editor/meson.build
@@ -66,6 +66,7 @@ install_data(
)
sources = files(
+ 'about-list.vala',
'adaptative-pathbar.vala',
'bookmarks.vala',
'bookmarks-controller.vala',
diff --git a/editor/overlayed-list.vala b/editor/overlayed-list.vala
index 8c9f367..7bc9b8e 100644
--- a/editor/overlayed-list.vala
+++ b/editor/overlayed-list.vala
@@ -185,7 +185,7 @@ private abstract class OverlayedList : Overlay
protected ulong content_changed_handler = 0;
protected uint n_items { protected get; private set; default = 0; }
- private bool is_editable = true;
+ private bool is_editable = false;
protected void change_editability (bool new_value)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]