[dconf-editor] Allow copying in in-window modifications.



commit 9916aade26a95174f48e5f6af4b5db0a473a3d24
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Nov 21 21:54:23 2018 +0100

    Allow copying in in-window modifications.

 editor/browser-view.vala       |  2 ++
 editor/dconf-window.vala       |  7 ++++---
 editor/modifications-list.vala | 12 ++++++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index ad2b09b..a5635dc 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -568,6 +568,8 @@ private class BrowserView : Stack, AdaptativeWidget
     {
         if (in_window_bookmarks)
             return bookmarks_list.get_copy_text ();
+        if (in_window_modifications)
+            return modifications_list.get_copy_text ();
         if (in_window_about)
             return about_list.get_copy_text (); // TODO copying logo...
         else
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 27d2f1c..ccec151 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -1638,9 +1638,6 @@ private class DConfWindow : ApplicationWindow
             return true;
         }
 
-        if (browser_view.in_window_modifications)
-            return false;
-
         Widget? focus = get_focus ();
         bool focus_is_text_widget = focus != null && (((!) focus is Entry) || ((!) focus is TextView));
 
@@ -1666,6 +1663,8 @@ private class DConfWindow : ApplicationWindow
                 case "v":   // https://bugzilla.gnome.org/show_bug.cgi?id=762257 is WONTFIX // TODO 
<Shift><Primary>v something?
                     if (browser_view.in_window_bookmarks)
                         return false;
+                    if (browser_view.in_window_modifications)
+                        return false;
                     if (browser_view.in_window_about)
                         return false;
 
@@ -1690,6 +1689,8 @@ private class DConfWindow : ApplicationWindow
 
         if (browser_view.in_window_bookmarks)
             return false;
+        if (browser_view.in_window_modifications)
+            return false;
         if (browser_view.in_window_about)
             return false;
 
diff --git a/editor/modifications-list.vala b/editor/modifications-list.vala
index 05c4e6d..5167f97 100644
--- a/editor/modifications-list.vala
+++ b/editor/modifications-list.vala
@@ -105,6 +105,18 @@ private class ModificationsList : OverlayedList
             main_list_box.select_row ((!) first_row);
     }
 
+    internal string? get_copy_text ()
+    {
+        List<weak ListBoxRow> selected_rows = main_list_box.get_selected_rows ();
+        if (selected_rows.length () != 1)
+            return null;
+        ListBoxRow row = selected_rows.nth_data (0);
+        Widget? child = row.get_child ();
+        if (child == null || !((!) child is DelayedSettingView))
+            assert_not_reached ();
+        return ((DelayedSettingView) (!) child).full_name;  // FIXME row should keep focus
+    }
+
     /*\
     * * Updating values; TODO only works for watched keys...
     \*/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]