[chronojump] Accelerators stuff moved to gui/app1/shortcuts.cs



commit be2e7f700e4bb972cd014a08e9d5b7558f23a286
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri May 8 10:51:48 2020 +0200

    Accelerators stuff moved to gui/app1/shortcuts.cs

 chronojump.csproj          |  1 +
 glade/app1.glade           | 19 +++++++-------
 po/POTFILES.in             |  1 +
 src/Makefile.am            |  1 +
 src/gui/app1/chronojump.cs | 37 ---------------------------
 src/gui/app1/icons.cs      |  4 +--
 src/gui/app1/menu.cs       | 12 ++++-----
 src/gui/app1/menu_tiny.cs  |  6 ++---
 src/gui/app1/shortcuts.cs  | 64 ++++++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 87 insertions(+), 58 deletions(-)
---
diff --git a/chronojump.csproj b/chronojump.csproj
index 7f7d0cb2..a7858a23 100644
--- a/chronojump.csproj
+++ b/chronojump.csproj
@@ -1244,6 +1244,7 @@
     <Compile Include="src\gui\person\addMultiple.cs" />
     <Compile Include="src\gui\person\addModify.cs" />
     <Compile Include="src\gui\person\personSelect.cs" />
+    <Compile Include="src\gui\app1\shortcuts.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="src\" />
diff --git a/glade/app1.glade b/glade/app1.glade
index b89551c3..de1a44eb 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -557,7 +557,6 @@
                         <property name="tooltip" translatable="yes">Use Chronojump faster</property>
                         <property name="label" translatable="yes">_Accelerators</property>
                         <property name="use_underline">True</property>
-                        <signal name="activate" handler="on_menuitem_accelerators_activate" swapped="no"/>
                       </widget>
                     </child>
                     <child>
@@ -1060,17 +1059,17 @@
                                                       </packing>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkButton" 
id="button_menu_help_accelerators1">
+                                                      <widget class="GtkButton" id="button_menu_shortcuts1">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">True</property>
                                                         <property name="receives_default">True</property>
-                                                        <signal name="clicked" 
handler="on_menuitem_accelerators_activate" swapped="no"/>
+                                                        <signal name="clicked" 
handler="on_shortcuts_clicked" swapped="no"/>
                                                         <child>
-                                                          <widget class="GtkEventBox" 
id="eventbox_button_menu_help_accelerators1">
+                                                          <widget class="GtkEventBox" 
id="eventbox_button_menu_help_shortcuts1">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_menu_help_accelerators1">
+                                                            <widget class="GtkImage" 
id="image_menu_help_shortcuts1">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
@@ -1915,13 +1914,13 @@
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_menu_help_accelerators">
+                                                            <widget class="GtkButton" 
id="button_menu_help_shortcuts">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_menuitem_accelerators_activate" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_shortcuts_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkEventBox" 
id="eventbox_button_menu_help_accelerators">
+                                                            <widget class="GtkEventBox" 
id="eventbox_button_menu_help_shortcuts">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
@@ -1929,7 +1928,7 @@
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_menu_help_accelerators">
+                                                            <widget class="GtkImage" 
id="image_menu_help_shortcuts">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
@@ -1941,7 +1940,7 @@
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_menu_help_accelerators">
+                                                            <widget class="GtkLabel" 
id="label_menu_help_shortcuts">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="label" 
translatable="yes">Shortcuts</property>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f7ad28da..4dfe13ce 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -73,6 +73,7 @@ src/gui/app1/runEncoder.cs
 src/gui/app1/runEncoderAnalyze.cs
 src/gui/app1/session/loadAndImport.cs
 src/gui/app1/session/addEdit.cs
+src/gui/app1/shortcuts.cs
 src/gui/chronopic.cs
 src/gui/chronopicRegister.cs
 src/gui/confirm.cs
diff --git a/src/Makefile.am b/src/Makefile.am
index 3f6089ff..7e291398 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,6 +21,7 @@ SOURCES = \
        gui/app1/session/addEdit.cs\
        gui/app1/session/loadAndImport.cs\
        gui/app1/session/main.cs\
+       gui/app1/shortcuts.cs\
        gui/app1/jump.cs\
        gui/app1/menu.cs\
        gui/app1/menu_tiny.cs\
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 95341814..e262fcc3 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -6524,43 +6524,6 @@ LogB.Debug("mc finished 5");
                new DialogMessage(Constants.MessageTypes.INFO, "Here there will be bibliographic information 
about formulas and some notes.\n\nProbably this will be a window and not a dialog\n\nNote text is 
selectable");
        }
 
-       private void on_menuitem_accelerators_activate (object o, EventArgs args) {
-               new DialogMessage(
-                               Catalog.GetString("Use these keys in order to work faster."),
-                               Constants.MessageTypes.NONE,  //NONE because window is vertically big and the 
INFO icon looks weird there
-                               Catalog.GetString("Persons") + ":\n" +
-                               "\t<tt><b>CTRL+p</b></tt> " + Catalog.GetString("Edit selected person") + 
"\n" +
-                               "\t<tt><b>CTRL+" + Catalog.GetString("CURSOR_UP") + "</b></tt> " + 
Catalog.GetString("Select previous person") + "\n" +
-                               "\t<tt><b>CTRL+" + Catalog.GetString("CURSOR_DOWN") + "</b></tt> " + 
Catalog.GetString("Select next person") + "\n" +
-
-                               "\n" + Catalog.GetString("Capture tests") + ":\n" +
-                               "\t<tt><b>CTRL+Space</b></tt> " + Catalog.GetString("Execute test") + "\n" +
-                               "\t<tt><b>Enter</b></tt> " + Catalog.GetString("Finish test") + "\n" +
-                               "\t<tt><b>Escape</b></tt> " + Catalog.GetString("Cancel test") + "\n" +
-
-                               "\n" + Catalog.GetString("Jumps") + "/" +  Catalog.GetString("Races") + ". " +
-                               Catalog.GetString("On capture tab:") + "\n" +
-                               "\t<tt><b>CTRL+v</b></tt> " + Catalog.GetString("Play video of this test") + 
" " + Catalog.GetString("(if available)")+ "\n" +
-                               "\t<tt><b>CTRL+d</b></tt> " + Catalog.GetString("Delete this test") + "\n" +
-
-                               "\n" + Catalog.GetString("Jumps") + "/" +  Catalog.GetString("Races") + ". " +
-                               Catalog.GetString("On analyze tab:") + "\n" +
-                               "\t<tt><b>z</b></tt> " + Catalog.GetString("Zoom change") + "\n" +
-                               "\t<tt><b>CTRL+v</b></tt> " + Catalog.GetString("Play video of selected 
test") + " " + Catalog.GetString("(if available)")+ "\n" +
-                               "\t<tt><b>e</b></tt> " + Catalog.GetString("Edit selected test") + "\n" +
-                               "\t<tt><b>d</b></tt> " + Catalog.GetString("Delete selected test") + "\n" +
-                               "\t<tt><b>r</b></tt> " + Catalog.GetString("Repair selected test") + " " + 
Catalog.GetString("(if available)") + "\n" +
-
-                               "\n" + Catalog.GetString("On encoder capture:") + "\n" +
-                               "\t<tt><b>+</b></tt> " + Catalog.GetString("Add weight") + "\n" +
-                               "\t<tt><b>-</b></tt> " + Catalog.GetString("Remove weight") + "\n" +
-
-                               "\n<tt><b>Escape</b></tt>\n" +
-                               "\t" + Catalog.GetString("Close any window") + "\n" +
-                               "\t" + Catalog.GetString("Open menu")
-                               );
-       }
-       
        private void on_menuitem_check_last_version_activate (object o, EventArgs args) 
        {
                Json js = new Json();
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index fade9897..0492d3e0 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -291,8 +291,8 @@ public partial class ChronoJumpWindow
                image_menu_help_documents.Pixbuf = pixbuf;
                image_menu_help_documents1.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_keyboard.png");
-               image_menu_help_accelerators.Pixbuf = pixbuf;
-               image_menu_help_accelerators1.Pixbuf = pixbuf;
+               image_menu_help_shortcuts.Pixbuf = pixbuf;
+               image_menu_help_shortcuts1.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_about.png");
                image_menu_help_about.Pixbuf = pixbuf;
                image_menu_help_about1.Pixbuf = pixbuf;
diff --git a/src/gui/app1/menu.cs b/src/gui/app1/menu.cs
index bf9ca088..515698b2 100644
--- a/src/gui/app1/menu.cs
+++ b/src/gui/app1/menu.cs
@@ -54,7 +54,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.EventBox eventbox_button_menu_preferences;
        [Widget] Gtk.EventBox eventbox_check_menu_help;
        [Widget] Gtk.EventBox eventbox_button_menu_help_documents;
-       [Widget] Gtk.EventBox eventbox_button_menu_help_accelerators;
+       [Widget] Gtk.EventBox eventbox_button_menu_help_shortcuts;
        [Widget] Gtk.EventBox eventbox_button_menu_help_about;
        [Widget] Gtk.EventBox eventbox_button_menu_exit;
        [Widget] Gtk.CheckButton check_menu_session;
@@ -75,7 +75,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_menu_preferences;
        [Widget] Gtk.Button button_menu_exit;
        [Widget] Gtk.Button button_menu_help_documents;
-       [Widget] Gtk.Button button_menu_help_accelerators;
+       [Widget] Gtk.Button button_menu_help_shortcuts;
        [Widget] Gtk.Button button_menu_help_about;
 
        [Widget] Gtk.Image image_session_import;
@@ -93,7 +93,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_menu_preferences;
        [Widget] Gtk.Image image_menu_help;
        [Widget] Gtk.Image image_menu_help_documents;
-       [Widget] Gtk.Image image_menu_help_accelerators;
+       [Widget] Gtk.Image image_menu_help_shortcuts;
        [Widget] Gtk.Image image_menu_help_about;
        [Widget] Gtk.Image image_menu_quit;
 
@@ -157,7 +157,7 @@ public partial class ChronoJumpWindow
                l.Add(button_menu_session_load.SizeRequest().Width + 16);
                l.Add(button_menu_session_more.SizeRequest().Width + 16);
                l.Add(button_menu_help_documents.SizeRequest().Width + 16);
-               l.Add(button_menu_help_accelerators.SizeRequest().Width + 16);
+               l.Add(button_menu_help_shortcuts.SizeRequest().Width + 16);
                l.Add(button_menu_help_about.SizeRequest().Width + 16);
 
                int maxWidth = getMenuButtonsMaxWidth(l) + 4 + 6; //4, 6 are alignments spaces.
@@ -220,7 +220,7 @@ public partial class ChronoJumpWindow
                image_menu_preferences.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_menu_help.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_menu_help_documents.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
-               image_menu_help_accelerators.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
+               image_menu_help_shortcuts.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_menu_help_about.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_menu_quit.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
        }
@@ -255,7 +255,7 @@ public partial class ChronoJumpWindow
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_session_load, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_session_more, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_documents, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
-               UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_accelerators, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_shortcuts, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_about, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
        }
 
diff --git a/src/gui/app1/menu_tiny.cs b/src/gui/app1/menu_tiny.cs
index 3c6a0a3e..bb15986e 100644
--- a/src/gui/app1/menu_tiny.cs
+++ b/src/gui/app1/menu_tiny.cs
@@ -42,7 +42,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.EventBox eventbox_button_menu_preferences1;
        [Widget] Gtk.EventBox eventbox_check_menu_help1;
        [Widget] Gtk.EventBox eventbox_button_menu_help_documents1;
-       [Widget] Gtk.EventBox eventbox_button_menu_help_accelerators1;
+       [Widget] Gtk.EventBox eventbox_button_menu_help_shortcuts1;
        [Widget] Gtk.EventBox eventbox_button_menu_help_about1;
        [Widget] Gtk.EventBox eventbox_button_menu_exit1;
        [Widget] Gtk.EventBox eventbox_button_contacts_person_change;
@@ -64,7 +64,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_menu_preferences1;
        [Widget] Gtk.Image image_menu_help1;
        [Widget] Gtk.Image image_menu_help_documents1;
-       [Widget] Gtk.Image image_menu_help_accelerators1;
+       [Widget] Gtk.Image image_menu_help_shortcuts1;
        [Widget] Gtk.Image image_menu_help_about1;
        [Widget] Gtk.Image image_menu_quit1;
 
@@ -124,7 +124,7 @@ public partial class ChronoJumpWindow
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_session_load1, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_session_more1, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_documents1, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
-               UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_accelerators1, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_shortcuts1, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_help_about1, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
 
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_contacts_person_change, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
diff --git a/src/gui/app1/shortcuts.cs b/src/gui/app1/shortcuts.cs
new file mode 100644
index 00000000..bbf4914a
--- /dev/null
+++ b/src/gui/app1/shortcuts.cs
@@ -0,0 +1,64 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * Chronojump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * Chronojump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Copyright (C) 2004-2020   Xavier de Blas <xaviblas gmail com>
+ */
+
+using System;
+using Gtk;
+using Mono.Unix;
+
+public partial class ChronoJumpWindow 
+{
+       private void on_shortcuts_clicked (object o, EventArgs args)
+       {
+               new DialogMessage(
+                               Catalog.GetString("Use these keys in order to work faster."),
+                               Constants.MessageTypes.NONE,  //NONE because window is vertically big and the 
INFO icon looks weird there
+                               Catalog.GetString("Persons") + ":\n" +
+                               "\t<tt><b>CTRL+p</b></tt> " + Catalog.GetString("Edit selected person") + 
"\n" +
+                               "\t<tt><b>CTRL+" + Catalog.GetString("CURSOR_UP") + "</b></tt> " + 
Catalog.GetString("Select previous person") + "\n" +
+                               "\t<tt><b>CTRL+" + Catalog.GetString("CURSOR_DOWN") + "</b></tt> " + 
Catalog.GetString("Select next person") + "\n" +
+
+                               "\n" + Catalog.GetString("Capture tests") + ":\n" +
+                               "\t<tt><b>CTRL+Space</b></tt> " + Catalog.GetString("Execute test") + "\n" +
+                               "\t<tt><b>Enter</b></tt> " + Catalog.GetString("Finish test") + "\n" +
+                               "\t<tt><b>Escape</b></tt> " + Catalog.GetString("Cancel test") + "\n" +
+
+                               "\n" + Catalog.GetString("Jumps") + "/" +  Catalog.GetString("Races") + ". " +
+                               Catalog.GetString("On capture tab:") + "\n" +
+                               "\t<tt><b>CTRL+v</b></tt> " + Catalog.GetString("Play video of this test") + 
" " + Catalog.GetString("(if available)")+ "\n" +
+                               "\t<tt><b>CTRL+d</b></tt> " + Catalog.GetString("Delete this test") + "\n" +
+
+                               "\n" + Catalog.GetString("Jumps") + "/" +  Catalog.GetString("Races") + ". " +
+                               Catalog.GetString("On analyze tab:") + "\n" +
+                               "\t<tt><b>z</b></tt> " + Catalog.GetString("Zoom change") + "\n" +
+                               "\t<tt><b>CTRL+v</b></tt> " + Catalog.GetString("Play video of selected 
test") + " " + Catalog.GetString("(if available)")+ "\n" +
+                               "\t<tt><b>e</b></tt> " + Catalog.GetString("Edit selected test") + "\n" +
+                               "\t<tt><b>d</b></tt> " + Catalog.GetString("Delete selected test") + "\n" +
+                               "\t<tt><b>r</b></tt> " + Catalog.GetString("Repair selected test") + " " + 
Catalog.GetString("(if available)") + "\n" +
+
+                               "\n" + Catalog.GetString("On encoder capture:") + "\n" +
+                               "\t<tt><b>+</b></tt> " + Catalog.GetString("Add weight") + "\n" +
+                               "\t<tt><b>-</b></tt> " + Catalog.GetString("Remove weight") + "\n" +
+
+                               "\n<tt><b>Escape</b></tt>\n" +
+                               "\t" + Catalog.GetString("Close any window") + "\n" +
+                               "\t" + Catalog.GetString("Open menu")
+                               );
+       }
+}


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