[chronojump] webcam check (and stop button) if is recording at Chronojump boot.



commit 226337e79298b69cba98831193ba102357881aee
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jul 16 16:08:17 2019 +0200

    webcam check (and stop button) if is recording at Chronojump boot.

 glade/app1.glade           | 117 +++++++++++++++++++++++++++++++++++++++++----
 src/chronojump.cs          |   4 +-
 src/gui/chronojump.cs      |  15 +++---
 src/gui/chronojumpIcons.cs |   7 ++-
 src/gui/webcam.cs          |   5 ++
 5 files changed, 129 insertions(+), 19 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 48506866..35b7af1b 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -765,29 +765,108 @@
                                                 <property name="can_focus">False</property>
                                                 <property name="bottom_padding">10</property>
                                                 <child>
-                                                  <widget class="GtkHBox" id="hbox_message_at_start">
+                                                  <widget class="GtkVBox" id="vbox141">
+                                                    <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
-                                                    <property name="spacing">12</property>
+                                                    <property name="spacing">4</property>
                                                     <child>
-                                                      <widget class="GtkLabel" id="label_message_at_start">
-                                                        <property name="visible">True</property>
+                                                      <widget class="GtkHBox" 
id="hbox_message_permissions_at_boot">
                                                         <property name="can_focus">False</property>
+                                                        <property name="spacing">12</property>
+                                                        <child>
+                                                          <widget class="GtkLabel" 
id="label_message_permissions_at_boot">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkImage" 
id="image_message_permissions_at_boot">
+                                                            <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">1</property>
+                                                          </packing>
+                                                        </child>
                                                       </widget>
                                                       <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
                                                         <property name="position">0</property>
                                                       </packing>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkImage" id="image_message_at_start">
-                                                        <property name="visible">True</property>
+                                                      <widget class="GtkHBox" 
id="hbox_message_camera_at_boot">
                                                         <property name="can_focus">False</property>
-                                                        <property name="stock">gtk-missing-image</property>
+                                                        <property name="spacing">8</property>
+                                                        <child>
+                                                          <widget class="GtkLabel" id="label405">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Camera 
seem to be recording</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_camera_stop_at_boot">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_camera_stop_at_boot_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox326">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label406">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Stop</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_camera_at_boot">
+                                                            <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">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</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="fill">True</property>
                                                         <property name="position">1</property>
                                                       </packing>
                                                     </child>
@@ -1977,6 +2056,12 @@
                                                             <placeholder/>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_start_selector_jumps">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -21219,6 +21304,12 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -29994,6 +30085,12 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 9906962a..1afb0cdc 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -576,7 +576,9 @@ public class ChronoJump
                        topMessage = Catalog.GetString("Need dialout permissions to read from device.") + 
"\n" +
                                Catalog.GetString("Check software page on Chronojump website");
 
-               new ChronoJumpWindow(progVersion, progName, runningFileName, splashWin, sendLog, 
messageToShowOnBoot, topMessage);
+               bool showCameraStop = (ExecuteProcess.IsRunning3 (-1, 
WebcamFfmpeg.GetExecutableCapture(UtilAll.GetOSEnum())));
+
+               new ChronoJumpWindow(progVersion, progName, runningFileName, splashWin, sendLog, 
messageToShowOnBoot, topMessage, showCameraStop);
        }
 
        private bool linuxUserHasDialout()
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 8fbf8341..32ea84e0 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -73,8 +73,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Notebook notebook_capture_analyze; //not encoder
        [Widget] Gtk.Notebook notebook_analyze; //not encoder
        [Widget] Gtk.Notebook notebook_capture_graph_table;
-       [Widget] Gtk.HBox hbox_message_at_start;
-       [Widget] Gtk.Label label_message_at_start;
+       [Widget] Gtk.HBox hbox_message_permissions_at_boot;
+       [Widget] Gtk.Label label_message_permissions_at_boot;
+       [Widget] Gtk.HBox hbox_message_camera_at_boot;
 
        [Widget] Gtk.HBox hbox_contacts_sup_capture_analyze_two_buttons;
 
@@ -534,7 +535,7 @@ public partial class ChronoJumpWindow
        bool needToShowChronopicRegisterWindow;
 
        public ChronoJumpWindow(string progVersion, string progName, string runningFileName, SplashWindow 
splashWin,
-                       bool showSendLog, string sendLogMessage, string topMessage)
+                       bool showSendLog, string sendLogMessage, string topMessage, bool showCameraStop)
        {
                this.progVersion = progVersion;
                this.progName = progName;
@@ -592,8 +593,8 @@ public partial class ChronoJumpWindow
                checkbutton_video.Visible = true;
 
                if(topMessage != "") {
-                       label_message_at_start.Text = topMessage;
-                       hbox_message_at_start.Visible = true;
+                       label_message_permissions_at_boot.Text = topMessage;
+                       hbox_message_permissions_at_boot.Visible = true;
                }
 
                //show send log if needed or other messages
@@ -604,6 +605,9 @@ public partial class ChronoJumpWindow
                        notebook_start.CurrentPage = 2; //send log
                }
 
+               if(showCameraStop)
+                       hbox_message_camera_at_boot.Visible = true;
+
                
                // ------ Creating widgets ------
 
@@ -652,7 +656,6 @@ public partial class ChronoJumpWindow
                on_extra_window_jumps_rj_test_changed(new object(), new EventArgs());
                on_extra_window_jumps_test_changed(new object(), new EventArgs());
                //changeTestImage("", "", "LOGO");
-
                //We have no session, mark some widgets as ".Sensitive = false"
                sensitiveGuiNoSession();
                definedSession = false;
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 830f1b56..2bf1f344 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -78,7 +78,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_add_test4;
        [Widget] Gtk.Image image_add_test5;
        [Widget] Gtk.Image image_test_inspect;
-       [Widget] Gtk.Image image_message_at_start;
 
        [Widget] Gtk.Image image_selector_start_jumps;
        [Widget] Gtk.Image image_selector_start_runs;
@@ -173,6 +172,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_forcesensor_analyze_image_save6;
        [Widget] Gtk.Image image_forcesensor_analyze_image_save7;
        [Widget] Gtk.Image image_sprint_analyze_image_save;
+       [Widget] Gtk.Image image_message_permissions_at_boot;
+       [Widget] Gtk.Image image_camera_at_boot;
 
        private void putNonStandardIcons()
        {
@@ -213,7 +214,7 @@ public partial class ChronoJumpWindow
                image_quit2.Pixbuf = pixbuf;
                image_quit_from_app1.Pixbuf = pixbuf;
 
-               image_message_at_start.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + 
"image_warning_red.png");
+               image_message_permissions_at_boot.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + 
"image_warning_red.png");
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "muscle-concentric.png");
                image_top_eccon.Pixbuf = pixbuf;
@@ -401,6 +402,8 @@ public partial class ChronoJumpWindow
                image_video_no.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "videocamera_off.png");
                image_video_encoder_no.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + 
"videocamera_off.png");
 
+               image_camera_at_boot.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + 
"videocamera_off.png");
+
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_photo_preview.png");
                image_video_preview.Pixbuf = pixbuf;
                image_video_encoder_preview.Pixbuf = pixbuf;
diff --git a/src/gui/webcam.cs b/src/gui/webcam.cs
index 205415a7..b8abee3f 100644
--- a/src/gui/webcam.cs
+++ b/src/gui/webcam.cs
@@ -455,6 +455,11 @@ public partial class ChronoJumpWindow
                button_video_play_selected_test(current_menuitem_mode);
        }
 
+       private void on_button_camera_stop_at_boot_clicked (object o, EventArgs args)
+       {
+               if(ExecuteProcess.KillExternalProcess 
(WebcamFfmpeg.GetExecutableCapture(UtilAll.GetOSEnum())))
+                       hbox_message_camera_at_boot.Visible = false;
+       }
 
        /*
         * videoOn


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