[chronojump] preferences power/stiffness help moved to a new tab (do not open dialogMessage)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] preferences power/stiffness help moved to a new tab (do not open dialogMessage)
- Date: Wed, 4 Aug 2021 09:17:44 +0000 (UTC)
commit 8dde44a74cce279434ddb2f5e92a9271f6ca69a3
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Aug 4 11:17:18 2021 +0200
preferences power/stiffness help moved to a new tab (do not open dialogMessage)
glade/preferences_win.glade | 307 +++++++++++++++++++++++++++++++++++++++++++-
src/gui/preferences.cs | 44 ++++++-
2 files changed, 344 insertions(+), 7 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 0c4775213..49fa0620e 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -7235,7 +7235,7 @@ version:</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox49">
+ <widget class="GtkVBox" id="vbox_select_tabs">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
@@ -7516,6 +7516,311 @@ version:</property>
<property name="type">tab</property>
</packing>
</child>
+ <child>
+ <widget class="GtkVBox" id="vbox_help">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="spacing">20</property>
+ <child>
+ <widget class="GtkVBox" id="vbox22">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkHBox" id="hbox_stiffness_formula">
+ <property name="can_focus">False</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkLabel" id="label134">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="yalign">0.30000001192092896</property>
+ <property name="label" translatable="yes">Stiffness</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label142">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="yalign">0.30000001192092896</property>
+ <property name="label"> = </property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox49">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkLabel" id="label155">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"><u>M * ᴨ ( Tf + Tc )</u></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">4</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox64">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">3</property>
+ <child>
+ <widget class="GtkLabel" id="label156">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Tc² (</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox50">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkLabel" id="label163">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"><u>Tf + Tc</u
></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label165">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">ᴨ</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label166">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">-</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox51">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkLabel" id="label167">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"><u>Tc</u></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label168">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">4</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label169">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">)</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow_by_software">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">4</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkLabel" id="label_help_message">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">4</property>
+ <property name="ypad">4</property>
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ <property name="selectable">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkButton" id="button_help_close">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <signal name="clicked" handler="on_button_help_close_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkHBox" id="hbox63">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkImage" id="image_help_close">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label164">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Close</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label128">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">page 3</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
</widget>
</child>
<child>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 49e54c3d2..d91ee51b4 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -59,6 +59,11 @@ public class PreferencesWindow
[Widget] Gtk.Label label_mandatory_tabs;
[Widget] Gtk.Label label_selectable_tabs;
+ //help widgets
+ [Widget] Gtk.HBox hbox_stiffness_formula;
+ [Widget] Gtk.Label label_help_message;
+ [Widget] Gtk.Image image_help_close;
+
//appearance tab
[Widget] Gtk.CheckButton check_appearance_maximized;
[Widget] Gtk.CheckButton check_appearance_maximized_undecorated;
@@ -284,6 +289,8 @@ public class PreferencesWindow
ListStore langsStore;
+ private enum notebook_top_pages { PREFERENCES, SELECTTABS, HELP }
+
const int JUMPSPAGE = 2;
const int RUNSPAGE = 3;
const int ENCODERCAPTUREPAGE = 4;
@@ -320,7 +327,7 @@ public class PreferencesWindow
PreferencesWindowBox = new PreferencesWindow ();
}
- PreferencesWindowBox.notebook_top.CurrentPage = 0;
+ PreferencesWindowBox.notebook_top.CurrentPage =
Convert.ToInt32(notebook_top_pages.PREFERENCES);
PreferencesWindowBox.operatingSystem = UtilAll.GetOSEnum();
if(compujump)
@@ -779,6 +786,9 @@ public class PreferencesWindow
PreferencesWindowBox.label_selectable_tabs.Text = "<b>" +
PreferencesWindowBox.label_selectable_tabs.Text + "</b>";
PreferencesWindowBox.label_selectable_tabs.UseMarkup = true;
+ //help
+ PreferencesWindowBox.image_help_close.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
"image_close.png");
+
PreferencesWindowBox.preferences_win.Show ();
return PreferencesWindowBox;
}
@@ -787,12 +797,12 @@ public class PreferencesWindow
private void on_button_view_more_tabs_clicked (object o, EventArgs args)
{
- notebook_top.CurrentPage = 1;
+ PreferencesWindowBox.notebook_top.CurrentPage =
Convert.ToInt32(notebook_top_pages.SELECTTABS);
hbox_buttons_bottom.Sensitive = false;
}
private void on_button_view_more_tabs_close_clicked (object o, EventArgs args)
{
- notebook_top.CurrentPage = 0;
+ PreferencesWindowBox.notebook_top.CurrentPage =
Convert.ToInt32(notebook_top_pages.PREFERENCES);
hbox_buttons_bottom.Sensitive = true;
}
@@ -831,6 +841,29 @@ public class PreferencesWindow
// <---- endo of view more tabs
+ // help ---->
+
+ private enum helpTypes { NORMAL, STIFFNESS }
+ private void showHelp (string str, helpTypes helpType)
+ {
+ PreferencesWindowBox.notebook_top.CurrentPage = Convert.ToInt32(notebook_top_pages.HELP);
+ hbox_buttons_bottom.Sensitive = false;
+
+ hbox_stiffness_formula.Visible = (helpType == helpTypes.STIFFNESS);
+
+ label_help_message.Text = str;
+ label_help_message.UseMarkup = true;
+ }
+
+ private void on_button_help_close_clicked (object o, EventArgs args)
+ {
+ PreferencesWindowBox.notebook_top.CurrentPage =
Convert.ToInt32(notebook_top_pages.PREFERENCES);
+ hbox_buttons_bottom.Sensitive = true;
+ }
+
+
+ // <---- end of help
+
private void paintColorDrawingAreaAndBg (Gdk.Color color)
{
@@ -925,13 +958,12 @@ public class PreferencesWindow
//both valid for jumps and jumps_rj
private void on_button_jumps_power_help_clicked (object o, EventArgs args) {
- new DialogMessage(Constants.MessageTypes.INFO, Constants.HelpPowerStr());
+ showHelp(Constants.HelpPowerStr(), helpTypes.NORMAL);
}
private void on_button_jumps_stiffness_help_clicked (object o, EventArgs args) {
- new DialogMessage(Constants.MessageTypes.INFO, Constants.HelpStiffnessStr(),
"hbox_stiffness_formula");
+ showHelp(Constants.HelpStiffnessStr(), helpTypes.STIFFNESS);
}
-
/*
* triggers stuff
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]