[chronojump] ForceSensor analyze export can open result url
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor analyze export can open result url
- Date: Thu, 10 Jun 2021 09:32:52 +0000 (UTC)
commit ff59d25af4c4d82b93d831ab91cb45caab47a633
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Jun 10 11:31:51 2021 +0200
ForceSensor analyze export can open result url
glade/app1.glade | 61 ++++++++++++++++++++++++++++++--------
src/exportFiles/exportFiles.cs | 7 +++++
src/gui/app1/forceSensorAnalyze.cs | 20 +++++++++++++
3 files changed, 76 insertions(+), 12 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 47b0966cc..12ca392cd 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -25690,6 +25690,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -26645,6 +26648,37 @@ Concentric</property>
<property name="position">4</property>
</packing>
</child>
+ <child>
+ <widget class="GtkAlignment" id="alignment79">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">30</property>
+ <child>
+ <widget class="GtkHBox" id="hbox527">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkButton"
id="button_force_sensor_export_result_open">
+ <property name="label"
translatable="yes">Open</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked"
handler="on_button_force_sensor_export_result_open_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -31887,6 +31921,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>
@@ -31923,18 +31969,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>
@@ -41020,6 +41054,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/exportFiles/exportFiles.cs b/src/exportFiles/exportFiles.cs
index 4f5eb44eb..91b6a6415 100644
--- a/src/exportFiles/exportFiles.cs
+++ b/src/exportFiles/exportFiles.cs
@@ -218,4 +218,11 @@ public abstract class ExportFiles
current, total);
progressbar.Fraction = UtilAll.DivideSafeFraction(current, total);
}
+
+ //folder or .csv depending on includeImages
+ //this provides a way to open file or folder from the main gui
+ public string ExportURL {
+ get { return exportURL; }
+ }
+
}
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 946be778f..14de8dc94 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -159,6 +159,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.SpinButton spinbutton_force_sensor_export_image_height;
[Widget] Gtk.ProgressBar progressbar_force_sensor_export;
[Widget] Gtk.Label label_force_sensor_export_result;
+ [Widget] Gtk.Button button_force_sensor_export_result_open;
private RepetitionMouseLimits fsAIRepetitionMouseLimits;
@@ -702,6 +703,7 @@ public partial class ChronoJumpWindow
button_force_sensor_analyze_load.Visible = true;
notebook_force_sensor_analyze_top.CurrentPage =
Convert.ToInt32(notebook_force_sensor_analyze_top_pages.CURRENTSETSIGNAL);
label_force_sensor_export_result.Text = "";
+ button_force_sensor_export_result_open.Visible = false;
}
private void on_radio_force_sensor_analyze_individual_current_session_toggled (object o, EventArgs
args)
{
@@ -714,6 +716,7 @@ public partial class ChronoJumpWindow
notebook_force_sensor_analyze_top.CurrentPage =
Convert.ToInt32(notebook_force_sensor_analyze_top_pages.CURRENTSESSION);
label_force_sensor_export_result.Text = "";
+ button_force_sensor_export_result_open.Visible = false;
}
private void on_radio_force_sensor_analyze_groupal_current_session_toggled (object o, EventArgs args)
{
@@ -723,6 +726,7 @@ public partial class ChronoJumpWindow
notebook_force_sensor_analyze_top.CurrentPage =
Convert.ToInt32(notebook_force_sensor_analyze_top_pages.CURRENTSESSION);
label_force_sensor_export_result.Text = "";
+ button_force_sensor_export_result_open.Visible = false;
}
private void on_button_force_sensor_export_current_session_clicked (object o, EventArgs args)
@@ -751,6 +755,7 @@ public partial class ChronoJumpWindow
duration = Convert.ToDouble(spin_force_duration_seconds.Value);
label_force_sensor_export_result.Text = "";
+ button_force_sensor_export_result_open.Visible = false;
forceSensorButtonsSensitive(false);
hbox_force_sensor_analyze_top_modes.Sensitive = false;
button_force_sensor_analyze_options.Sensitive = false;
@@ -836,6 +841,21 @@ public partial class ChronoJumpWindow
hbox_force_sensor_analyze_top_modes.Sensitive = true;
button_force_sensor_analyze_options.Sensitive = true;
hbox_force_sensor_export_images.Sensitive = true;
+ button_force_sensor_export_result_open.Visible = true;
+ }
+
+ private void on_button_force_sensor_export_result_open_clicked (object o, EventArgs args)
+ {
+ if(forceSensorExport == null || forceSensorExport.ExportURL == "")
+ {
+ new DialogMessage(Constants.MessageTypes.WARNING,
+ Constants.DirectoryCannotOpenStr());
+ return;
+ }
+
+ if(! Util.OpenURL (forceSensorExport.ExportURL))
+ new DialogMessage(Constants.MessageTypes.WARNING,
+ Constants.DirectoryCannotOpenStr() + "\n\n" +
forceSensorExport.ExportURL);
}
private void forceSensorDoGraphAI(bool windowResizedAndZoom)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]