[dconf-editor] Select on open_parent_path call.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Select on open_parent_path call.
- Date: Mon, 8 Jan 2018 22:46:48 +0000 (UTC)
commit c58c0a05c7af91594c721ae923100d9b74289133
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Mon Jan 8 01:34:18 2018 +0100
Select on open_parent_path call.
editor/dconf-window.vala | 11 +++++++++++
editor/key-list-box-row.vala | 12 ++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index b66f454..04ea498 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -23,6 +23,7 @@ class DConfWindow : ApplicationWindow
private const GLib.ActionEntry [] action_entries =
{
{ "open-path", open_path, "s" },
+ { "open-path-with-selection", open_path_with_selection, "(ss)" },
{ "reset-recursive", reset_recursively },
{ "reset-visible", reset_visible },
@@ -377,6 +378,16 @@ class DConfWindow : ApplicationWindow
request_path (((!) path_variant).get_string ());
}
+ private void open_path_with_selection (SimpleAction action, Variant? path_variant)
+ requires (path_variant != null)
+ {
+ string full_name;
+ string selection;
+ ((!) path_variant).@get ("(ss)", out full_name, out selection);
+ request_path (selection); // TODO better
+ request_path (full_name);
+ }
+
private void reset_visible ()
{
browser_view.reset (false);
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index 026c731..8ee2592 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -186,8 +186,8 @@ private class FolderListBoxRow : ClickableListBoxRow
if (search_result_mode)
{
- variant = new Variant.string (parent_path);
- popover.new_gaction ("open_parent", "ui.open-path(" + variant.print (false) + ")"); // TODO
selection 1/3
+ variant = new Variant ("(ss)", parent_path, full_name);
+ popover.new_gaction ("open_parent", "ui.open-path-with-selection(" + variant.print (false) +
")");
popover.new_section ();
}
@@ -358,8 +358,8 @@ private class KeyListBoxRowEditableNoSchema : KeyListBoxRow
if (search_result_mode)
{
- variant = new Variant.string (key.parent_path);
- popover.new_gaction ("open_parent", "ui.open-path(" + variant.print (false) + ")"); // TODO
selection 2/3
+ variant = new Variant ("(ss)", key.parent_path, key.full_name);
+ popover.new_gaction ("open_parent", "ui.open-path-with-selection(" + variant.print (false) +
")");
popover.new_section ();
}
@@ -492,8 +492,8 @@ private class KeyListBoxRowEditable : KeyListBoxRow
if (search_result_mode)
{
- variant = new Variant.string (key.parent_path);
- popover.new_gaction ("open_parent", "ui.open-path(" + variant.print (false) + ")"); // TODO
selection 3/3
+ variant = new Variant ("(ss)", key.parent_path, key.full_name);
+ popover.new_gaction ("open_parent", "ui.open-path-with-selection(" + variant.print (false) +
")");
popover.new_section ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]