[chronojump] rasspberry and networks initial GUI
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] rasspberry and networks initial GUI
- Date: Thu, 12 Mar 2015 13:32:57 +0000 (UTC)
commit 029acde3adc2b865a8a8254794056fbd0230b831
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Mar 12 14:30:48 2015 +0100
rasspberry and networks initial GUI
glade/chronojump.glade | 74 +++++++++++++++++++++++++++++++++++++++++++++++-
src/gui/encoder.cs | 3 +-
src/gui/networks.cs | 65 ++++++++++++++++++++++++++++++++++++++----
src/util.cs | 6 ++++
src/utilAll.cs | 2 +-
5 files changed, 141 insertions(+), 9 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 9c300d5..83d967e 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6601,6 +6601,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -7451,6 +7454,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
@@ -8553,6 +8559,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -9296,6 +9305,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -13370,6 +13382,21 @@ on current Chronojump version.</property>
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="button_encoder_maximize">
+ <property name="label">gtk-zoom-fit</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked"
handler="on_button_encoder_maximize_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -14377,7 +14404,7 @@ on current Chronojump version.</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment37">
+ <widget class="GtkAlignment"
id="alignment_video_encoder">
<property name="width_request">275</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -19756,6 +19783,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -20407,6 +20437,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -21550,6 +21583,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>
@@ -21750,6 +21786,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -31595,6 +31634,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>
@@ -33626,6 +33683,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>
@@ -34315,6 +34375,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>
@@ -36970,6 +37033,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -37285,6 +37351,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -37615,6 +37684,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 6984c21..f885265 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -76,6 +76,7 @@ public partial class ChronoJumpWindow
//encoder video
+ [Widget] Gtk.Alignment alignment_video_encoder;
[Widget] Gtk.Notebook notebook_video_encoder;
[Widget] Gtk.Viewport viewport_video_capture_encoder;
[Widget] Gtk.Viewport viewport_video_play_encoder;
@@ -330,7 +331,7 @@ public partial class ChronoJumpWindow
//done here because in Glade we cannot use the TextBuffer.Changed
textview_encoder_signal_comment.Buffer.Changed += new
EventHandler(on_textview_encoder_signal_comment_key_press_event);
- networksInit();
+ raspberryOrNetworksInit();
}
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index ce43490..7ab5421 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -31,19 +31,72 @@ using System.Collections.Generic; //List
public partial class ChronoJumpWindow
{
//RFID
+ [Widget] Gtk.Button button_encoder_maximize;
[Widget] Gtk.Box hbox_rfid;
[Widget] Gtk.Label label_rfid;
+ private enum linuxTypeEnum { NOTLINUX, LINUX, RASPBERRY, NETWORKS }
+ private linuxTypeEnum linuxType;
+
+ //networks is a raspberry connected to the server
+ private static linuxTypeEnum getLinuxTypes()
+ {
+ if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.LINUX)
+ {
+ if(Util.FileExists(Util.GetChronojumpNetworksFile()))
+ return(linuxTypeEnum.NETWORKS);
+ else if(Util.FileExists(Util.GetChronojumpRaspberryFile()))
+ return(linuxTypeEnum.RASPBERRY);
+ else
+ return(linuxTypeEnum.LINUX);
+ }
+ return(linuxTypeEnum.NOTLINUX);
+ }
- private void networksInit() {
- Networks networks = new Networks();
- networks.Test();
-
- if(Util.FileExists(Util.GetChronojumpNetworksFile()))
+
+ private void raspberryOrNetworksInit() {
+ linuxType = getLinuxTypes();
+
+ if(linuxType == linuxTypeEnum.RASPBERRY || linuxType == linuxTypeEnum.NETWORKS) {
+ alignment_video_encoder.Visible = false;
+ //TODO: put the no connect video here.
+
+ button_encoder_maximize.Visible = true;
+ }
+
+ if(linuxType == linuxTypeEnum.NETWORKS) {
+ //mostrar directament el power
+ select_menuitem_mode_toggled(menuitem_modes.POWER);
+
+ //no mostrar menu
+ main_menu.Visible = false;
+
+ //no mostrar persones
+ vbox_persons.Visible = false;
+ //TODO: rfid can be here, also machine, maybe weight, other features
+ //time, gym, ...
+
+ //show rfid
hbox_rfid.Visible = true;
+
+ //to test display, just make sensitive the top controls, but beware there's no
session yet and no person
+ notebook_sup.Sensitive = true;
+ hbox_encoder_sup_capture_analyze.Sensitive = true;
+ notebook_encoder_sup.Sensitive = false;
+ }
+
+ //si es rapsberry o si es networks cal desactivar camera
}
-
+
+ void on_button_encoder_maximize_clicked (object o, EventArgs args) {
+ app1.Maximize();
+ }
+
//rfid
+ private void rfid_test() {
+ Networks networks = new Networks();
+ networks.Test();
+ }
void on_button_rfid_read_clicked (object o, EventArgs args) {
string file = "/tmp/chronojump_rfid.txt";
diff --git a/src/util.cs b/src/util.cs
index be74b0c..2492c42 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -800,6 +800,12 @@ public class Util
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Chronojump" + Path.DirectorySeparatorChar + "chronojump_networks.txt");
}
+ public static string GetChronojumpRaspberryFile() {
+ return Path.Combine(
+ Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+ "Chronojump" + Path.DirectorySeparatorChar + "chronojump_raspberry.txt");
+ }
+
/********** start of multimedia paths ************/
diff --git a/src/utilAll.cs b/src/utilAll.cs
index 7444098..6ee57ba 100644
--- a/src/utilAll.cs
+++ b/src/utilAll.cs
@@ -65,7 +65,7 @@ public class UtilAll
else
return OperatingSystems.LINUX;
}
-
+
public static string GetApplicationDataDir() {
return Path.Combine(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]