[gnome-system-monitor/libreajans/gnome-system-monitor-helpoverlay: 2/2] Fixes to the help overlay



commit 9d3a9cb49cbcd59877914af49c2a6bdbb6af9c4f
Author: Robert Roth <robert roth off gmail com>
Date:   Sun May 31 09:11:51 2020 +0300

    Fixes to the help overlay

 data/help-overlay.ui | 15 +++++----------
 src/application.cpp  |  1 +
 src/interface.cpp    | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/data/help-overlay.ui b/data/help-overlay.ui
index 457e7f1d..1198ac05 100644
--- a/data/help-overlay.ui
+++ b/data/help-overlay.ui
@@ -2,6 +2,7 @@
 <interface>
   <object class="GtkShortcutsWindow" id="help_overlay">
     <property name="modal">true</property>
+    <property name="resizable">true</property>
     <child>
       <object class="GtkShortcutsSection">
         <property name="visible">true</property>
@@ -112,38 +113,32 @@
               <object class="GtkShortcutsShortcut">
                 <property name="visible">true</property>
                 <property name="accelerator">&lt;Primary&gt;S</property>
-                <property name="title" translatable="yes" context="shortcut window">Send stop 
signal</property>
+                <property name="title" translatable="yes" context="shortcut window">Stop process</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
                 <property name="visible">true</property>
                 <property name="accelerator">&lt;Primary&gt;C</property>
-                <property name="title" translatable="yes" context="shortcut window">Send continue 
signal</property>
+                <property name="title" translatable="yes" context="shortcut window">Continue 
process</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
                 <property name="visible">true</property>
                 <property name="accelerator">&lt;Primary&gt;E</property>
-                <property name="title" translatable="yes" context="shortcut window">Send End 
signal</property>
+                <property name="title" translatable="yes" context="shortcut window">End process</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
                 <property name="visible">true</property>
                 <property name="accelerator">&lt;Primary&gt;K</property>
-                <property name="title" translatable="yes" context="shortcut window">Send Kill 
signal</property>
+                <property name="title" translatable="yes" context="shortcut window">Kill process</property>
               </object>
             </child>
           </object>
         </child>
-        <child>
-          <object class="GtkShortcutsGroup">
-            <property name="visible">true</property>
-            <property name="title" translatable="yes" context="shortcut window">File Systems</property>
-          </object>
-        </child>
       </object>
     </child>
   </object>
diff --git a/src/application.cpp b/src/application.cpp
index 7dff723f..3eb25097 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -398,6 +398,7 @@ void GsmApplication::on_startup()
     add_accelerator("<Primary>k", "win.send-signal-kill", g_variant_new_int32 (SIGKILL));
     add_accelerator("<Primary>m", "win.memory-maps", NULL);
     add_accelerator("<Primary>o", "win.open-files", NULL);
+    add_accelerator("<Primary>question", "win.show-help-overlay", NULL);
     add_accelerator("<Alt>Return", "win.process-properties", NULL);
     add_accelerator("<Primary>f", "win.search", g_variant_new_boolean (TRUE));
     add_accelerator("F1", "app.help", NULL);
diff --git a/src/interface.cpp b/src/interface.cpp
index 2e3e5d4b..b5e38b3a 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -453,6 +453,19 @@ on_activate_open_files (GSimpleAction *, GVariant *, gpointer data)
     create_openfiles_dialog (app);
 }
 
+static void
+on_activate_keyboard_shortcuts (GSimpleAction *, GVariant *, gpointer data)
+{
+    GsmApplication *app = (GsmApplication *) data;
+
+    GtkBuilder *builder = gtk_builder_new();
+    gtk_builder_add_from_resource (builder, "/org/gnome/gnome-system-monitor/gtk/help-overlay.ui", NULL);
+
+    GtkWidget *shortcuts_window = GTK_WIDGET (gtk_builder_get_object (builder, "help_overlay"));
+    gtk_window_set_transient_for (GTK_WINDOW (shortcuts_window), GTK_WINDOW (app->main_window));
+    gtk_widget_show (shortcuts_window);
+}
+
 static void
 on_activate_process_properties (GSimpleAction *, GVariant *, gpointer data)
 {
@@ -725,6 +738,7 @@ create_main_window (GsmApplication *app)
         { "priority", on_activate_priority, "i", "@i 0", change_priority_state },
         { "memory-maps", on_activate_memory_maps, NULL, NULL, NULL },
         { "open-files", on_activate_open_files, NULL, NULL, NULL },
+        { "show-help-overlay", on_activate_keyboard_shortcuts, NULL, NULL, NULL },
         { "process-properties", on_activate_process_properties, NULL, NULL, NULL },
         { "refresh", on_activate_refresh, NULL, NULL, NULL },
         { "show-page", on_activate_radio, "s", "'resources'", change_show_page_state },


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