[chronojump] webcam force stop at preferences show label_feedback instead of dialog



commit 76993131f4d607ba81428348b6ce9d65cc57432e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jun 25 14:31:05 2019 +0200

    webcam force stop at preferences show label_feedback instead of dialog

 glade/preferences_win.glade | 188 +++++++++++++++++++++++++-------------------
 src/gui/preferences.cs      |  10 ++-
 2 files changed, 111 insertions(+), 87 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index cb0de743..bc60c934 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -3987,110 +3987,132 @@ Other</property>
                                 <property name="can_focus">False</property>
                                 <property name="left_padding">12</property>
                                 <child>
-                                  <widget class="GtkHBox" id="hbox21">
+                                  <widget class="GtkVBox" id="vbox33">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="border_width">8</property>
-                                    <property name="spacing">20</property>
                                     <child>
-                                      <widget class="GtkButton" 
id="button_video_check_ffmpeg_ffplay_running">
+                                      <widget class="GtkHBox" id="hbox21">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">True</property>
-                                        <signal name="clicked" 
handler="on_button_video_check_ffmpeg_ffplay_running_clicked" swapped="no"/>
-                                        <child>
-                                          <widget class="GtkLabel" id="label11">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="label" translatable="yes">Check if camera is 
running</property>
-                                          </widget>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkTable" id="table_video_advanced_actions">
                                         <property name="can_focus">False</property>
-                                        <property name="n_rows">2</property>
-                                        <property name="n_columns">3</property>
-                                        <property name="column_spacing">12</property>
-                                        <property name="row_spacing">8</property>
-                                        <child>
-                                          <widget class="GtkLabel" id="label90">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="label" translatable="yes">Capture</property>
-                                          </widget>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkLabel" id="label91">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="label" translatable="yes">Play</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="top_attach">1</property>
-                                            <property name="bottom_attach">2</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkLabel" id="label_video_check_ffmpeg_running">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="left_attach">1</property>
-                                            <property name="right_attach">2</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkLabel" id="label_video_check_ffplay_running">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="left_attach">1</property>
-                                            <property name="right_attach">2</property>
-                                            <property name="top_attach">1</property>
-                                            <property name="bottom_attach">2</property>
-                                          </packing>
-                                        </child>
+                                        <property name="border_width">8</property>
+                                        <property name="spacing">20</property>
                                         <child>
-                                          <widget class="GtkButton" id="button_video_ffmpeg_kill">
-                                            <property name="label" translatable="yes">Force stop</property>
+                                          <widget class="GtkButton" 
id="button_video_check_ffmpeg_ffplay_running">
                                             <property name="visible">True</property>
                                             <property name="can_focus">True</property>
                                             <property name="receives_default">True</property>
-                                            <signal name="clicked" 
handler="on_button_video_ffmpeg_kill_clicked" swapped="no"/>
+                                            <signal name="clicked" 
handler="on_button_video_check_ffmpeg_ffplay_running_clicked" swapped="no"/>
+                                            <child>
+                                              <widget class="GtkLabel" id="label11">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Check if camera is 
running</property>
+                                              </widget>
+                                            </child>
                                           </widget>
                                           <packing>
-                                            <property name="left_attach">2</property>
-                                            <property name="right_attach">3</property>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
                                           </packing>
                                         </child>
                                         <child>
-                                          <widget class="GtkButton" id="button_video_ffplay_kill">
-                                            <property name="label" translatable="yes">Force stop</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">True</property>
-                                            <signal name="clicked" 
handler="on_button_video_ffplay_kill_clicked" swapped="no"/>
+                                          <widget class="GtkTable" id="table_video_advanced_actions">
+                                            <property name="can_focus">False</property>
+                                            <property name="n_rows">2</property>
+                                            <property name="n_columns">3</property>
+                                            <property name="column_spacing">12</property>
+                                            <property name="row_spacing">8</property>
+                                            <child>
+                                              <widget class="GtkLabel" id="label90">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Capture</property>
+                                              </widget>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label91">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Play</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="top_attach">1</property>
+                                                <property name="bottom_attach">2</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_video_check_ffmpeg_running">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="left_attach">1</property>
+                                                <property name="right_attach">2</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_video_check_ffplay_running">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="left_attach">1</property>
+                                                <property name="right_attach">2</property>
+                                                <property name="top_attach">1</property>
+                                                <property name="bottom_attach">2</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkButton" id="button_video_ffmpeg_kill">
+                                                <property name="label" translatable="yes">Force 
stop</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <signal name="clicked" 
handler="on_button_video_ffmpeg_kill_clicked" swapped="no"/>
+                                              </widget>
+                                              <packing>
+                                                <property name="left_attach">2</property>
+                                                <property name="right_attach">3</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkButton" id="button_video_ffplay_kill">
+                                                <property name="label" translatable="yes">Force 
stop</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <signal name="clicked" 
handler="on_button_video_ffplay_kill_clicked" swapped="no"/>
+                                              </widget>
+                                              <packing>
+                                                <property name="left_attach">2</property>
+                                                <property name="right_attach">3</property>
+                                                <property name="top_attach">1</property>
+                                                <property name="bottom_attach">2</property>
+                                              </packing>
+                                            </child>
                                           </widget>
                                           <packing>
-                                            <property name="left_attach">2</property>
-                                            <property name="right_attach">3</property>
-                                            <property name="top_attach">1</property>
-                                            <property name="bottom_attach">2</property>
+                                            <property name="expand">True</property>
+                                            <property name="fill">False</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>
+                                    <child>
+                                      <widget class="GtkLabel" id="label_camera_feedback">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 32e9d560..f9b07a10 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -172,6 +172,7 @@ public class PreferencesWindow
        [Widget] Gtk.Label label_video_check_ffplay_running;
        [Widget] Gtk.Button button_video_ffmpeg_kill;
        [Widget] Gtk.Button button_video_ffplay_kill;
+       [Widget] Gtk.Label label_camera_feedback;
 
        //language tab
        [Widget] Gtk.Box hbox_combo_language;
@@ -875,6 +876,7 @@ public class PreferencesWindow
                label_video_check_ffplay_running.Text = "Not running";
                button_video_ffmpeg_kill.Visible = false;
                button_video_ffplay_kill.Visible = false;
+               label_camera_feedback.Text = "";
 
                bool runningFfmpeg = false;
                bool runningFfplay = false;
@@ -900,23 +902,23 @@ public class PreferencesWindow
        {
                if(ExecuteProcess.KillExternalProcess (WebcamFfmpeg.GetExecutableCapture(operatingSystem)))
                {
-                       new DialogMessage(Constants.MessageTypes.INFO, "Killed camera process");
+                       label_camera_feedback.Text = "Killed camera process";
                        label_video_check_ffmpeg_running.Text = "Not running";
                        button_video_ffmpeg_kill.Visible = false;
                }
                else
-                       new DialogMessage(Constants.MessageTypes.WARNING, "Cannot kill camera process");
+                       label_camera_feedback.Text = "Cannot kill camera process";
        }
        private void on_button_video_ffplay_kill_clicked (object o, EventArgs args)
        {
                if(ExecuteProcess.KillExternalProcess (WebcamFfmpeg.GetExecutablePlay(operatingSystem)))
                {
-                       new DialogMessage(Constants.MessageTypes.INFO, "Killed play process");
+                       label_camera_feedback.Text = "Killed play process";
                        label_video_check_ffplay_running.Text = "Not running";
                        button_video_ffplay_kill.Visible = false;
                }
                else
-                       new DialogMessage(Constants.MessageTypes.WARNING, "Cannot kill play process");
+                       label_camera_feedback.Text = "Cannot kill play process";
        }
 
        // ---- end of multimedia stuff


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