[dconf-editor] Allow copying in in-window bookmarks.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Allow copying in in-window bookmarks.
- Date: Thu, 22 Nov 2018 12:36:26 +0000 (UTC)
commit 4f44143167e0bf446c1ff6fb504b53671305becc
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Nov 21 21:49:29 2018 +0100
Allow copying in in-window bookmarks.
editor/bookmarks-list.vala | 11 +++++++++++
editor/browser-view.vala | 2 ++
editor/dconf-window.vala | 6 ++++--
3 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/editor/bookmarks-list.vala b/editor/bookmarks-list.vala
index 6dfc130..35cc008 100644
--- a/editor/bookmarks-list.vala
+++ b/editor/bookmarks-list.vala
@@ -107,6 +107,17 @@ private class BookmarksList : OverlayedList
return give_focus_to_switch;
}
+ 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);
+ if (!(row is Bookmark))
+ assert_not_reached ();
+ return ((Bookmark) row).bookmark_name; // FIXME row should keep focus
+ }
+
internal Variant get_bookmarks_as_variant ()
{
return settings.get_value ("bookmarks");
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index a98abd9..ad2b09b 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -566,6 +566,8 @@ private class BrowserView : Stack, AdaptativeWidget
internal string get_selected_row_name () { return current_child.get_selected_row_name (); }
internal string? get_copy_text ()
{
+ if (in_window_bookmarks)
+ return bookmarks_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 4797d2f..27d2f1c 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -1638,8 +1638,6 @@ private class DConfWindow : ApplicationWindow
return true;
}
- if (browser_view.in_window_bookmarks)
- return false;
if (browser_view.in_window_modifications)
return false;
@@ -1666,6 +1664,8 @@ private class DConfWindow : ApplicationWindow
return true;
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_about)
return false;
@@ -1688,6 +1688,8 @@ private class DConfWindow : ApplicationWindow
}
}
+ if (browser_view.in_window_bookmarks)
+ return false;
if (browser_view.in_window_about)
return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]