[gtranslator/gnome-3-30] Ctrl+space to copy original text into translated



commit 7e517ae2e9a374f0dda89e38b02b4251d9c90f84
Author: Daniel GarcĂ­a Moreno <danigm wadobo com>
Date:   Wed Nov 28 13:17:15 2018 +0100

    Ctrl+space to copy original text into translated
    
    Fix #36

 src/gtr-application.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/src/gtr-application.c b/src/gtr-application.c
index 1611e5d5..1922d95f 100644
--- a/src/gtr-application.c
+++ b/src/gtr-application.c
@@ -249,6 +249,17 @@ find_and_replace_activated (GSimpleAction *action,
   _gtr_actions_search_replace (NULL, priv->active_window);
 }
 
+static void
+copy_text_activated (GSimpleAction *action,
+                     GVariant      *parameter,
+                     gpointer       user_data)
+{
+  GtrApplication *app = GTR_APPLICATION (user_data);
+  GtrApplicationPrivate *priv = gtr_application_get_instance_private (app);
+
+  gtr_message_copy_to_translation (NULL, priv->active_window);
+}
+
 static void
 preferences_activated (GSimpleAction *action,
                        GVariant      *parameter,
@@ -525,6 +536,7 @@ static GActionEntry app_entries[] = {
   { "tm_8", tm_activated, NULL, NULL, NULL },
   { "tm_9", tm_activated, NULL, NULL, NULL },
 
+  { "copy_text", copy_text_activated, NULL, NULL, NULL },
   { "find_and_replace", find_and_replace_activated, NULL, NULL, NULL },
   { "find", find_activated, NULL, NULL, NULL },
   { "new_window", new_window_activated, NULL, NULL, NULL },
@@ -580,6 +592,8 @@ gtr_application_startup (GApplication *application)
   set_kb (application, "app.find", "<Ctrl>f");
   set_kb (application, "app.find_and_replace", "<Ctrl>h");
 
+  set_kb (application, "app.copy_text", "<Ctrl>space");
+
   set_kb (application, "app.build_tm", "<Ctrl>plus");
   set_kb (application, "app.tm_1", "<Ctrl>1");
   set_kb (application, "app.tm_2", "<Ctrl>2");


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