[chronojump] Networks: hidden camera at contacts/encoder/preferences/person(add/modify)



commit c58a4c63f2fa1c0f1d732beffc74224c55699197
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jul 2 13:30:23 2019 +0200

    Networks: hidden camera at contacts/encoder/preferences/person(add/modify)

 glade/preferences_win.glade | 2 +-
 src/gui/chronojump.cs       | 7 ++++---
 src/gui/networks.cs         | 4 ++++
 src/gui/person.cs           | 9 +++------
 src/gui/preferences.cs      | 5 +++++
 src/gui/webcam.cs           | 2 +-
 6 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 33688f45..1b264fc5 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -3195,7 +3195,7 @@ Other</property>
                 <property name="border_width">16</property>
                 <property name="spacing">20</property>
                 <child>
-                  <widget class="GtkNotebook" id="notebook1">
+                  <widget class="GtkNotebook" id="notebook_multimedia">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="tab_hborder">10</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 87182ebb..a220fac1 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2726,7 +2726,7 @@ public partial class ChronoJumpWindow
                                currentSession, new Person(-1), 
                                //preferences.digitsNumber, checkbutton_video, configChronojump.UseVideo,
                                preferences.digitsNumber, checkbutton_video,
-                               preferences.videoDevice
+                               preferences.videoDevice, configChronojump.Compujump
                                );
                //-1 means we are adding a new person
                //if we were modifying it will be it's uniqueID
@@ -2853,7 +2853,7 @@ public partial class ChronoJumpWindow
                personAddModifyWin = PersonAddModifyWindow.Show(app1, currentSession, currentPerson, 
                                //preferences.digitsNumber, checkbutton_video, configChronojump.UseVideo,
                                preferences.digitsNumber, checkbutton_video,
-                               preferences.videoDevice
+                               preferences.videoDevice, configChronojump.Compujump
                                ); 
                personAddModifyWin.FakeButtonAccept.Clicked += new 
EventHandler(on_edit_current_person_accepted);
        }
@@ -3511,7 +3511,8 @@ public partial class ChronoJumpWindow
        {
                hbox_capture_phases_time.Visible = (m != Constants.Menuitem_modes.FORCESENSOR && m != 
Constants.Menuitem_modes.RUNSENCODER);
 
-               showWebcamCapture (m != Constants.Menuitem_modes.FORCESENSOR && m != 
Constants.Menuitem_modes.RUNSENCODER);
+               if(! configChronojump.Compujump)
+                       showWebcamCaptureContactsControls (m != Constants.Menuitem_modes.FORCESENSOR && m != 
Constants.Menuitem_modes.RUNSENCODER);
 
                menuitem_force_sensor_open_folder.Visible = (m == Constants.Menuitem_modes.FORCESENSOR);
                menuitem_force_sensor_check_version.Visible = (m == Constants.Menuitem_modes.FORCESENSOR);
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 57f9fc61..d1308d64 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -156,6 +156,10 @@ public partial class ChronoJumpWindow
                        viewport_chronopics.Sensitive = false;
                        button_activate_chronopics_encoder.Sensitive = false;
 
+                       //do not allow camera controls
+                       showWebcamCaptureContactsControls (false); //contacts
+                       hbox_video_encoder.Visible = false;
+
                        if(configChronojump.CompujumpStationMode != Constants.Menuitem_modes.UNDEFINED)
                        {
                                //select_menuitem_mode_toggled(configChronojump.CompujumpStationMode);
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 3dc858db..b8b75d68 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -930,11 +930,6 @@ public class PersonAddModifyWindow
                image_photo_preview.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + 
"image_photo_preview.png");
                image_photo_do.Pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_photo_do.png");
 
-               //if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.LINUX)
-                       hbox_camera.Visible = true;
-               //else
-               //      hbox_camera.Visible = showCapturePhoto;
-
                //delete a -1.png or -1.jpg added before on a new user where "accept" button was not pressed 
and window was closed
                deleteOldPhotosIfAny(-1);
 
@@ -1224,7 +1219,7 @@ public class PersonAddModifyWindow
                        Session mySession, Person currentPerson, int pDN, 
                        //Gtk.CheckButton app1_checkbutton_video, bool showCapturePhoto,
                        Gtk.CheckButton app1_checkbutton_video,
-                       string videoDevice)
+                       string videoDevice, bool compujump)
        {
                if (PersonAddModifyWindowBox == null) {
                        //PersonAddModifyWindowBox = new PersonAddModifyWindow (parent, mySession, 
currentPerson, showCapturePhoto);
@@ -1234,6 +1229,8 @@ public class PersonAddModifyWindow
                PersonAddModifyWindowBox.pDN = pDN;
                PersonAddModifyWindowBox.app1_checkbutton_video = app1_checkbutton_video;
                PersonAddModifyWindowBox.videoDevice = videoDevice;
+               //do not allow camera on compujump
+               PersonAddModifyWindowBox.hbox_camera.Visible = ! compujump;
 
                PersonAddModifyWindowBox.person_win.Show ();
 
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 650c9b73..32e32e89 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -146,6 +146,7 @@ public class PreferencesWindow
        [Widget] Gtk.RadioButton radio_sound_systemsounds;
        [Widget] Gtk.HBox hbox_not_recommended_when_not_on_windows;
        [Widget] Gtk.Label label_test_sound_result;
+       [Widget] Gtk.Notebook notebook_multimedia;
        [Widget] Gtk.Box hbox_combo_camera;
        [Widget] Gtk.ComboBox combo_camera;
        [Widget] Gtk.HBox hbox_camera_resolution_framerate;
@@ -306,6 +307,10 @@ public class PreferencesWindow
                else 
                        PreferencesWindowBox.checkbutton_volume.Active = false; 
 
+               //hide video for compujump
+               if(compujump)
+                       PreferencesWindowBox.notebook_multimedia.GetNthPage(1).Hide();
+
                PreferencesWindowBox.label_no_cameras.Visible = false;
 
                if(UtilAll.IsWindows())
diff --git a/src/gui/webcam.cs b/src/gui/webcam.cs
index a8bb1fc3..301429e5 100644
--- a/src/gui/webcam.cs
+++ b/src/gui/webcam.cs
@@ -56,7 +56,7 @@ public partial class ChronoJumpWindow
 
        //should be visible on all contacts, but right now hide it on force sensor and runEncoder
        //but we need database stuff first
-       public void showWebcamCapture (bool show)
+       public void showWebcamCaptureContactsControls (bool show)
        {
                vseparator_force_sensor_camera_space.Visible = false; //extra space before camera on force 
sensor
                vbox_contacts_camera.Visible = show;


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