[chronojump/michrolab] Several improvements on discover window to show clearly the mode compatible
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump/michrolab] Several improvements on discover window to show clearly the mode compatible
- Date: Thu, 6 Oct 2022 10:53:09 +0000 (UTC)
commit c90648e08366e6f4f100ece5f0425b399fcec5b6
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Oct 3 11:11:32 2022 +0200
Several improvements on discover window to show clearly the mode compatible
glade/app1.glade | 138 ++++++++++++++++++++++++++++++++++---------
src/constants.cs | 25 ++++++++
src/gui/app1/chronojump.cs | 14 ++++-
src/gui/app1/icons.cs | 4 ++
src/gui/chronopicRegister.cs | 19 ++++--
5 files changed, 163 insertions(+), 37 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index f5212e2c1..9e71d96b9 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -21823,6 +21823,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -27151,6 +27154,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -33950,6 +33956,18 @@ Concentric</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
+ <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Tests
will be filmed</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox"
id="hbox_video_encoder_capturing">
<property name="can_focus">False</property>
<property name="spacing">4</property>
@@ -33986,18 +34004,6 @@ Concentric</property>
</packing>
</child>
<child>
- <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Tests
will be filmed</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<widget class="GtkHBox"
id="hbox_video_encoder_no_capturing">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -43472,6 +43478,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -51386,16 +51395,81 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
<property name="can_focus">False</property>
<property name="spacing">25</property>
<child>
- <widget class="GtkFrame" id="frame_micro_discover">
- <property name="width_request">450</property>
- <property name="height_request">350</property>
+ <widget class="GtkVBox" id="vbox143">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">1</property>
- <property name="shadow_type">in</property>
<child>
- <widget class="GtkViewport" id="viewport27">
+ <widget class="GtkHBox" id="hbox578">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkHBox" id="hbox575">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkImage"
id="image_micro_discover_device">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property
name="stock">gtk-missing-image</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="label407">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Detect
device</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">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel"
id="label_micro_discover_title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Compatible
with...</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</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="GtkFrame" id="frame_micro_discover">
+ <property name="width_request">450</property>
+ <property name="height_request">350</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">1</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkViewport" id="viewport27">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">4</property>
@@ -51408,7 +51482,7 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">20</property>
- <property name="spacing">20</property>
+ <property name="spacing">12</property>
<child>
<widget class="GtkLabel"
id="label_micro_discover_not_found">
<property name="can_focus">False</property>
@@ -51578,6 +51652,9 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -51598,22 +51675,25 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
</child>
</widget>
</child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel"
id="label_micro_discover_title">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Detect
device</property>
+ </widget>
+ </child>
+ <child>
+ <placeholder/>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="type">label_item</property>
+ <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">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
diff --git a/src/constants.cs b/src/constants.cs
index d6a71a5e1..581c05e71 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -1094,6 +1094,31 @@ public class Constants
return ""; //should never happen
}
+ //used on detect device
+ public static string ModeIcon (Constants.Modes mode)
+ {
+ if (mode == Constants.Modes.JUMPSSIMPLE)
+ return "image_jump_simple.png";
+ else if (mode == Constants.Modes.JUMPSREACTIVE)
+ return "image_jump_reactive.png";
+ else if (mode == Constants.Modes.RUNSSIMPLE)
+ return "image_run_simple.png";
+ else if (mode == Constants.Modes.RUNSINTERVALLIC)
+ return "image_run_multiple.png";
+ else if (mode == Constants.Modes.RUNSENCODER)
+ return "race_encoder_icon.png";
+ else if (mode == Constants.Modes.POWERGRAVITATORY)
+ return "image_weight.png";
+ else if (mode == Constants.Modes.POWERINERTIAL)
+ return "image_inertia.png";
+ else if (mode == Constants.Modes.FORCESENSORISOMETRIC)
+ return "force_sensor_icon.png"; //TODO: change this
+ else if (mode == Constants.Modes.FORCESENSORELASTIC)
+ return "force_sensor_icon.png"; //TODO: change this
+ else
+ return "image_jump_simple"; //to not crash if there is any future mode
+ }
+
public static string All = "All";
public static string None = "None";
public static string Invert = "Invert";
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 9ad02910e..81cfa01ee 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -309,6 +309,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.EventBox eventbox_button_micro_discover_cancel_close;
[Widget] Gtk.Image image_button_micro_discover_cancel_close;
[Widget] Gtk.Label label_button_micro_discover_cancel_close;
+ [Widget] Gtk.Image image_micro_discover_mode;
[Widget] Gtk.Label label_threshold;
@@ -956,6 +957,13 @@ public partial class ChronoJumpWindow
UtilGtk.ContrastLabelsNotebook (Config.ColorBackgroundIsDark, app1s_notebook);
UtilGtk.ContrastLabelsVBox (Config.ColorBackgroundIsDark, vbox_help);
UtilGtk.ContrastLabelsVBox (Config.ColorBackgroundIsDark, vbox_micro_discover);
+
+ if(Config.ColorBackgroundIsDark)
+ image_chronopic_connect_encoder2.Pixbuf =
+ new Pixbuf (null, Util.GetImagePath(false) +
"image_chronopic_connect_yellow.png");
+ else
+ image_chronopic_connect_encoder2.Pixbuf =
+ new Pixbuf (null, Util.GetImagePath(false) +
"image_chronopic_connect.png");
}
LogB.Information(string.Format("UseSystemColor: {0}, ColorBackgroundIsDark: {1}",
Config.UseSystemColor, Config.ColorBackgroundIsDark));
@@ -4662,7 +4670,6 @@ public partial class ChronoJumpWindow
}
}
- //right now implemented only contacts
DiscoverWindow discoverWin;
private void on_button_detect_clicked (object o, EventArgs args)
{
@@ -4674,14 +4681,15 @@ public partial class ChronoJumpWindow
chronopicRegisterUpdate (false);
label_micro_discover_title.Text = string.Format (Catalog.GetString (
- "Detect device for mode: <b>{0}</b>"), modePrint(current_mode));
+ "Compatible with: <b>{0}</b>"), modePrint(current_mode));
label_micro_discover_title.UseMarkup = true;
discoverWin = new DiscoverWindow (current_mode, chronopicRegister,
label_micro_discover_not_found,
table_micro_discover,
image_button_micro_discover_cancel_close,
- label_button_micro_discover_cancel_close);
+ label_button_micro_discover_cancel_close,
+ Constants.ModeIcon (current_mode));
discoverWin.FakeButtonClose.Clicked += new EventHandler (on_discoverWindow_closed);
}
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index b73780b8a..22e300c8b 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -60,6 +60,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_chronopic_connect_encoder;
[Widget] Gtk.Image image_chronopic_connect_encoder1;
[Widget] Gtk.Image image_chronopic_connect_encoder2;
+ [Widget] Gtk.Image image_micro_discover_device;
[Widget] Gtk.Image image_button_contacts_detect;
[Widget] Gtk.Image image_button_encoder_detect;
[Widget] Gtk.Image image_button_execute;
@@ -468,6 +469,9 @@ public partial class ChronoJumpWindow
image_chronopic_connect_encoder1.Pixbuf = pixbuf;
image_chronopic_connect_encoder2.Pixbuf = pixbuf;
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_chronopic_connect_yellow.png");
+ image_micro_discover_device.Pixbuf = pixbuf;
+
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_recalculate.png");
image_recalculate.Pixbuf = pixbuf;
image_contacts_recalculate.Pixbuf = pixbuf;
diff --git a/src/gui/chronopicRegister.cs b/src/gui/chronopicRegister.cs
index 83c64547d..a01de08f6 100644
--- a/src/gui/chronopicRegister.cs
+++ b/src/gui/chronopicRegister.cs
@@ -136,6 +136,7 @@ public class DiscoverWindow
private Gtk.Table table_micro_discover;
private Gtk.Image image_button_micro_discover_cancel_close;
private Gtk.Label label_button_micro_discover_cancel_close;
+ private Gtk.Image image_discover_mode;
private ChronopicRegisterPort portSelected;
@@ -143,7 +144,9 @@ public class DiscoverWindow
Gtk.Label label_micro_discover_not_found,
Gtk.Table table_micro_discover,
Gtk.Image image_button_micro_discover_cancel_close,
- Gtk.Label label_button_micro_discover_cancel_close)
+ Gtk.Label label_button_micro_discover_cancel_close,
+ string iconModeStr
+ )
{
this.current_mode = current_mode;
this.chronopicRegister = chronopicRegister;
@@ -155,6 +158,7 @@ public class DiscoverWindow
FakeButtonClose = new Gtk.Button();
portSelected = new ChronopicRegisterPort ("");
+ image_discover_mode = new Gtk.Image (new Pixbuf (null, Util.GetImagePath(false) +
iconModeStr));
//ChronoDebug cDebug = new ChronoDebug("Discover " + current_mode.ToString());
//cDebug.Start();
@@ -225,13 +229,18 @@ public class DiscoverWindow
// 3) create widgets, lists, attach to table and show all
// 3a) create table header row
- Gtk.Label l0 = new Gtk.Label ("<b>Device</b>");
- Gtk.Label l1 = new Gtk.Label ("<b>Type</b>");
+ Gtk.Label l0 = new Gtk.Label ("<b>" + Catalog.GetString ("Device") + "</b>");
l0.UseMarkup = true;
+
+ Gtk.Label l1 = new Gtk.Label ("<b>" + Catalog.GetString ("Compatible") + "</b>");
l1.UseMarkup = true;
+ Gtk.HBox hbox_l1 = new Gtk.HBox (false, 4);
+ hbox_l1.PackStart (l1);
+ hbox_l1.PackStart (image_discover_mode);
+
table_micro_discover.Attach (l0, (uint) 0, (uint) 1, (uint) 0, (uint) 1,
AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
- table_micro_discover.Attach (l1, (uint) 1, (uint) 2, (uint) 0, (uint) 1,
+ table_micro_discover.Attach (hbox_l1, (uint) 1, (uint) 2, (uint) 0, (uint) 1,
AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
// 3b) create a row for each device
@@ -347,7 +356,7 @@ public class DiscoverWindow
if ( ! (i < microDiscover.Discovered_l.Count &&
discoverMatchCurrentMode
(microDiscover.Discovered_l[i])) )
- (progressbar_microNotDiscovered_l[i]).Text = "----";
+ (progressbar_microNotDiscovered_l[i]).Text = Catalog.GetString ("No");
}
image_button_micro_discover_cancel_close.Pixbuf =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]