[chronojump] On raspberry not camera (personal photos) cannot be done



commit ab58d744587fb5ccdfce5aed1fb633a231216877
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri May 22 10:32:36 2015 +0200

    On raspberry not camera (personal photos) cannot be done

 glade/chronojump.glade |   59 +++++++++++++++++++++++++++++++++++++++++++++++-
 src/gui/chronojump.cs  |    8 +++++-
 src/gui/person.cs      |   47 ++++++++++++++++++++++----------------
 3 files changed, 91 insertions(+), 23 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index f5ed8bd..b2c66f6 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -7893,6 +7893,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -8818,6 +8821,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -9995,6 +10001,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -10813,6 +10822,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -21673,6 +21685,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -22399,6 +22414,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -23617,6 +23635,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -23892,6 +23913,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -34198,6 +34222,24 @@ options</property>
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -35780,7 +35822,7 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkVBox" id="vbox3">
+                              <widget class="GtkVBox" id="vbox_photo">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="spacing">4</property>
@@ -36304,6 +36346,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -37068,6 +37113,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -39798,6 +39846,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -40188,6 +40239,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -40593,6 +40647,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 4c61ba1..f6f3663 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2616,7 +2616,9 @@ public partial class ChronoJumpWindow
        private void on_person_add_single_activate (object o, EventArgs args) {
                personAddModifyWin = PersonAddModifyWindow.Show(app1, 
                                currentSession, new Person(-1), 
-                               preferences.digitsNumber, checkbutton_video);
+                               preferences.digitsNumber, checkbutton_video,
+                               (linuxType == linuxTypeEnum.RASPBERRY || linuxType == linuxTypeEnum.NETWORKS)
+                               );
                //-1 means we are adding a new person
                //if we were modifying it will be it's uniqueID
                
@@ -2699,7 +2701,9 @@ public partial class ChronoJumpWindow
                LogB.Information("modify person");
 
                personAddModifyWin = PersonAddModifyWindow.Show(app1, currentSession, currentPerson, 
-                               preferences.digitsNumber, checkbutton_video); 
+                               preferences.digitsNumber, checkbutton_video,
+                               (linuxType == linuxTypeEnum.RASPBERRY || linuxType == linuxTypeEnum.NETWORKS)
+                               ); 
                personAddModifyWin.FakeButtonAccept.Clicked += new 
EventHandler(on_edit_current_person_accepted);
        }
        
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 85dd36f..d7f4111 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -802,6 +802,8 @@ public class PersonAddModifyWindow
        [Widget] Gtk.TextView textview_description;
        [Widget] Gtk.TextView textview_ps_comments;
        
+       [Widget] Gtk.Box vbox_photo;
+       
        [Widget] Gtk.Label label_date;
        //[Widget] Gtk.Button button_change_date;
        [Widget] Gtk.Button button_calendar;
@@ -876,7 +878,8 @@ public class PersonAddModifyWindow
        //
        //if we are adding a person, currentPerson.UniqueID it's -1
        //if we are modifying a person, currentPerson.UniqueID is obviously it's ID
-       PersonAddModifyWindow (Gtk.Window parent, Session currentSession, Person currentPerson) {
+       //hidePhotoStuff is true on raspberry to not use camera
+       PersonAddModifyWindow (Gtk.Window parent, Session currentSession, Person currentPerson, bool 
hidePhotoStuff) {
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "person_win", 
null);
                gladeXML.Autoconnect(this);
@@ -908,25 +911,29 @@ public class PersonAddModifyWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomInIcon);
                image_zoom.Pixbuf = pixbuf;
 
-               string photoFile = Util.GetPhotoFileName(true, currentPerson.UniqueID);
-               if(File.Exists(photoFile)) {
-                       try {
-                               pixbuf = new Pixbuf (photoFile); //from a file
-                               image_photo_mini.Pixbuf = pixbuf;
-                       } catch {
-                               //on windows there are problem using the fileNames that are not on temp
-                               string tempFileName = Path.Combine(Path.GetTempPath(), 
Constants.PhotoSmallTemp +
-                                       Util.GetMultimediaExtension(Constants.MultimediaItems.PHOTO));
-                               File.Copy(photoFile, tempFileName, true);
-                               pixbuf = new Pixbuf (tempFileName);
-                               image_photo_mini.Pixbuf = pixbuf;
+               if(hidePhotoStuff)
+                       vbox_photo.Visible = false;
+               else {
+                       string photoFile = Util.GetPhotoFileName(true, currentPerson.UniqueID);
+                       if(File.Exists(photoFile)) {
+                               try {
+                                       pixbuf = new Pixbuf (photoFile); //from a file
+                                       image_photo_mini.Pixbuf = pixbuf;
+                               } catch {
+                                       //on windows there are problem using the fileNames that are not on 
temp
+                                       string tempFileName = Path.Combine(Path.GetTempPath(), 
Constants.PhotoSmallTemp +
+                                                       
Util.GetMultimediaExtension(Constants.MultimediaItems.PHOTO));
+                                       File.Copy(photoFile, tempFileName, true);
+                                       pixbuf = new Pixbuf (tempFileName);
+                                       image_photo_mini.Pixbuf = pixbuf;
+                               }
                        }
+                       //show zoom button only if big image exists
+                       if(File.Exists(Util.GetPhotoFileName(false, currentPerson.UniqueID)))
+                               button_zoom.Sensitive = true;
+                       else
+                               button_zoom.Sensitive = false;
                }
-               //show zoom button only if big image exists
-               if(File.Exists(Util.GetPhotoFileName(false, currentPerson.UniqueID)))
-                       button_zoom.Sensitive = true;
-               else
-                       button_zoom.Sensitive = false;
                        
                fakeButtonAccept = new Gtk.Button();
 
@@ -1090,10 +1097,10 @@ public class PersonAddModifyWindow
        
        static public PersonAddModifyWindow Show (Gtk.Window parent, 
                        Session mySession, Person currentPerson, int pDN, 
-                       Gtk.CheckButton app1_checkbutton_video)
+                       Gtk.CheckButton app1_checkbutton_video, bool hidePhotoStuff)
        {
                if (PersonAddModifyWindowBox == null) {
-                       PersonAddModifyWindowBox = new PersonAddModifyWindow (parent, mySession, 
currentPerson);
+                       PersonAddModifyWindowBox = new PersonAddModifyWindow (parent, mySession, 
currentPerson, hidePhotoStuff);
                }
 
                PersonAddModifyWindowBox.pDN = pDN;


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