[chronojump] ForceSensor export messages in label, instead of dialog



commit 97574ae1be0a2c07fede735fb18c8db023fde3ad
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 18 19:08:50 2021 +0100

    ForceSensor export messages in label, instead of dialog

 glade/app1.glade   | 42 ++++++++++++++++++++++++++++++------------
 src/forceSensor.cs | 16 +++++++++-------
 2 files changed, 39 insertions(+), 19 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 9f33f2bd..bfc85d3b 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -24062,6 +24062,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24681,6 +24684,18 @@ Concentric</property>
                                                             <property name="position">2</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_force_sensor_export_result">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="xalign">0</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">3</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">1</property>
@@ -29213,18 +29228,6 @@ 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>
@@ -29261,6 +29264,18 @@ 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>
@@ -37576,6 +37591,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 67d5dddd..3b735989 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -2536,6 +2536,7 @@ public class ForceSensorExport
        //passed variables
        private Gtk.Notebook notebook;
        private Gtk.ProgressBar progressbar;
+       private Gtk.Label labelResult;
        private string exportFilename;
        private bool isWindows;
        private int personID; // -1: all
@@ -2569,6 +2570,7 @@ public class ForceSensorExport
        public ForceSensorExport (
                        Gtk.Notebook notebook,
                        Gtk.ProgressBar progressbar,
+                       Gtk.Label labelResult,
                        bool isWindows, int personID, int sessionID,
                        List<ForceSensorRFD> rfdList, ForceSensorImpulse impulse,
                        double duration, int durationPercent,
@@ -2583,6 +2585,7 @@ public class ForceSensorExport
        {
                this.notebook = notebook;
                this.progressbar = progressbar;
+               this.labelResult = labelResult;
                this.isWindows = isWindows;
                this.personID = personID;
                this.sessionID = sessionID;
@@ -2649,14 +2652,13 @@ public class ForceSensorExport
                        notebook.CurrentPage = 0;
 
                        if(cancel)
-                               new DialogMessage(Constants.MessageTypes.INFO, 
Catalog.GetString("Cancelled."));
+                               labelResult.Text = Catalog.GetString("Cancelled.");
                        else if (noData)
-                               new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Missing 
data."));
+                               labelResult.Text = Catalog.GetString("Missing data.");
                        else
-                               new DialogMessage(Constants.MessageTypes.INFO,
-                                               string.Format("Exported to {0}", exportFilename)// +
+                               labelResult.Text = string.Format(Catalog.GetString("Exported to {0}"), 
exportFilename);// +
                                                //Constants.GetSpreadsheetString(CSVExportDecimalSeparator)
-                                               );
+                                               //);
 
                        return false;
                }
@@ -2669,7 +2671,7 @@ public class ForceSensorExport
                        progressbar.Text = messageToProgressbar;
                        progressbar.Pulse();
                } else {
-                       progressbar.Text = string.Format("Exporting {0}/{1}", files, fs_l.Count);
+                       progressbar.Text = string.Format(Catalog.GetString("Exporting {0}/{1}"), files, 
fs_l.Count);
                        progressbar.Fraction = UtilAll.DivideSafeFraction(files, fs_l.Count);
                }
 
@@ -2715,7 +2717,7 @@ public class ForceSensorExport
                int count = 1;
                foreach(ForceSensor fs in fs_l)
                {
-                       messageToProgressbar = string.Format("Preparing {0}/{1}", count++, fs_l.Count);
+                       messageToProgressbar = string.Format(Catalog.GetString("Preparing {0}/{1}"), count++, 
fs_l.Count);
 
                        if(cancel)
                                return false;


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