[chronojump] gui: server gui in main window done



commit dd6183de0f72f0bfe9f62bcf4a52de5076fbe6e4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 28 12:39:51 2011 +0200

    gui: server gui in main window done

 glade/chronojump.glade |  436 +++++++++++++++++++++++++++++++++---------------
 src/gui/chronojump.cs  |   40 ++----
 src/gui/stats.cs       |    2 +
 3 files changed, 318 insertions(+), 160 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index ca3b43d..a4ddf75 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -13647,134 +13647,6 @@ by you</property>
               </widget>
             </child>
             <child>
-              <widget class="GtkMenuItem" id="menu_tools">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_Tools</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu_view_menu">
-                    <child>
-                      <widget class="GtkImageMenuItem" id="menuitem_server">
-                        <property name="label" translatable="yes">_Server</property>
-                        <property name="visible">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">False</property>
-                        <child>
-                          <widget class="GtkMenu" id="menuitem_server_menu">
-                            <child>
-                              <widget class="GtkImageMenuItem" id="menuitem_server_ping">
-                                <property name="label" translatable="yes">Check connection</property>
-                                <property name="visible">True</property>
-                                <property name="use_stock">False</property>
-                                <signal name="activate" handler="on_menuitem_server_ping"/>
-                                <child internal-child="image">
-                                  <widget class="GtkImage" id="image39">
-                                    <property name="visible">True</property>
-                                    <property name="stock">gtk-info</property>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkSeparatorMenuItem" id="separador23">
-                                <property name="visible">True</property>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkImageMenuItem" id="menuitem_server_evaluator_data">
-                                <property name="label" translatable="yes">Evaluator data</property>
-                                <property name="visible">True</property>
-                                <property name="use_stock">False</property>
-                                <signal name="activate" handler="on_menuitem_server_evaluator_data_only"/>
-                                <child internal-child="image">
-                                  <widget class="GtkImage" id="image41">
-                                    <property name="visible">True</property>
-                                    <property name="stock">gtk-edit</property>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkImageMenuItem" id="menuitem_server_upload_session">
-                                <property name="label" translatable="yes">Upload (or update) session to server</property>
-                                <property name="visible">True</property>
-                                <property name="use_stock">False</property>
-                                <signal name="activate" handler="on_menuitem_server_upload_session_pre"/>
-                                <child internal-child="image">
-                                  <widget class="GtkImage" id="image42">
-                                    <property name="visible">True</property>
-                                    <property name="stock">gtk-go-up</property>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkSeparatorMenuItem" id="separador24">
-                                <property name="visible">True</property>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkImageMenuItem" id="menuitem_server_query">
-                                <property name="label" translatable="yes">Query</property>
-                                <property name="visible">True</property>
-                                <property name="use_stock">False</property>
-                                <signal name="activate" handler="on_menuitem_server_query_activate"/>
-                                <child internal-child="image">
-                                  <widget class="GtkImage" id="image37">
-                                    <property name="visible">True</property>
-                                    <property name="stock">gtk-find</property>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkImageMenuItem" id="menuitem_server_stats">
-                                <property name="label" translatable="yes">Stats</property>
-                                <property name="visible">True</property>
-                                <property name="use_stock">False</property>
-                                <signal name="activate" handler="on_menuitem_server_stats"/>
-                                <child internal-child="image">
-                                  <widget class="GtkImage" id="image38">
-                                    <property name="visible">True</property>
-                                    <property name="stock">gtk-missing-image</property>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkSeparatorMenuItem" id="separador25">
-                                <property name="visible">True</property>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkImageMenuItem" id="menuitem_goto_server_website">
-                                <property name="label" translatable="yes">Goto server website</property>
-                                <property name="visible">True</property>
-                                <property name="use_stock">False</property>
-                                <signal name="activate" handler="on_menuitem_goto_server_website_activate"/>
-                                <child internal-child="image">
-                                  <widget class="GtkImage" id="image40">
-                                    <property name="visible">True</property>
-                                    <property name="stock">gtk-jump-to</property>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child internal-child="image">
-                          <widget class="GtkImage" id="image19">
-                            <property name="visible">True</property>
-                            <property name="stock">gtk-connect</property>
-                          </widget>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-            <child>
               <widget class="GtkMenuItem" id="help1">
                 <property name="visible">True</property>
                 <property name="label" translatable="yes">_Help</property>
@@ -22226,10 +22098,312 @@ on current Chronojump version.</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label11">
+                          <widget class="GtkVBox" id="vbox46">
                             <property name="visible">True</property>
-                            <property name="label">pending
-Here it will be server stuff</property>
+                            <property name="border_width">7</property>
+                            <property name="spacing">14</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox59">
+                                <property name="visible">True</property>
+                                <child>
+                                  <widget class="GtkTextView" id="textview1">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="pixels_above_lines">4</property>
+                                    <property name="editable">False</property>
+                                    <property name="wrap_mode">word</property>
+                                    <property name="text" translatable="yes">Chronojump has a server in order to share data between users.
+Data is collected by users contributions and server generates statistics and graphs. 
+Anyone can check server stats and graphs and easily make querys to the server.
+Privacy is respected:
+- Names and comments are not uploaded.
+- Date of birth is hidden</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkVButtonBox" id="vbuttonbox3">
+                                    <property name="visible">True</property>
+                                    <child>
+                                      <widget class="GtkButton" id="button_server_check_connection">
+                                        <property name="height_request">50</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="border_width">10</property>
+                                        <signal name="clicked" handler="on_server_ping"/>
+                                        <child>
+                                          <widget class="GtkHBox" id="hbox63">
+                                            <property name="visible">True</property>
+                                            <property name="spacing">6</property>
+                                            <child>
+                                              <widget class="GtkImage" id="image20">
+                                                <property name="visible">True</property>
+                                                <property name="stock">gtk-info</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label55">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes">Check connection</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkVBox" id="vbox50">
+                                <property name="visible">True</property>
+                                <property name="spacing">10</property>
+                                <child>
+                                  <widget class="GtkFrame" id="frame_share_data">
+                                    <property name="visible">True</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="shadow_type">out</property>
+                                    <child>
+                                      <widget class="GtkHButtonBox" id="hbuttonbox8">
+                                        <property name="visible">True</property>
+                                        <child>
+                                          <widget class="GtkButton" id="button_upload_session">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="border_width">10</property>
+                                            <signal name="clicked" handler="on_server_upload_session_pre"/>
+                                            <child>
+                                              <widget class="GtkVBox" id="vbox48">
+                                                <property name="visible">True</property>
+                                                <property name="spacing">6</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image7">
+                                                    <property name="visible">True</property>
+                                                    <property name="stock">gtk-go-up</property>
+                                                    <property name="icon-size">5</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label58">
+                                                    <property name="visible">True</property>
+                                                    <property name="label" translatable="yes">Upload (or update) session to server</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label53">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">&lt;b&gt;Share data!&lt;/b&gt;</property>
+                                        <property name="use_markup">True</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="type">label_item</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkFrame" id="frame10">
+                                    <property name="visible">True</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="shadow_type">out</property>
+                                    <child>
+                                      <widget class="GtkHButtonBox" id="hbuttonbox7">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">12</property>
+                                        <property name="layout_style">center</property>
+                                        <child>
+                                          <widget class="GtkButton" id="button_server_query">
+                                            <property name="height_request">50</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="border_width">10</property>
+                                            <signal name="clicked" handler="on_menuitem_server_query"/>
+                                            <child>
+                                              <widget class="GtkHBox" id="hbox62">
+                                                <property name="visible">True</property>
+                                                <property name="spacing">6</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image14">
+                                                    <property name="visible">True</property>
+                                                    <property name="stock">gtk-find</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label54">
+                                                    <property name="visible">True</property>
+                                                    <property name="label" translatable="yes">Query to the server</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkButton" id="button_server_stats">
+                                            <property name="height_request">50</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="border_width">10</property>
+                                            <signal name="clicked" handler="on_menuitem_server_stats"/>
+                                            <child>
+                                              <widget class="GtkHBox" id="hbox64">
+                                                <property name="visible">True</property>
+                                                <property name="spacing">6</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image_stats_win_graph2">
+                                                    <property name="visible">True</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label56">
+                                                    <property name="visible">True</property>
+                                                    <property name="label" translatable="yes">Check basic stats</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label11">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">&lt;b&gt;Check data&lt;/b&gt;</property>
+                                        <property name="use_markup">True</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="type">label_item</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkHButtonBox" id="hbuttonbox6">
+                                <property name="visible">True</property>
+                                <child>
+                                  <widget class="GtkButton" id="button_server_website">
+                                    <property name="height_request">50</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <signal name="clicked" handler="on_menuitem_goto_server_website"/>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox65">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <widget class="GtkImage" id="image21">
+                                            <property name="visible">True</property>
+                                            <property name="stock">gtk-jump-to</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label57">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Open server website (on browser)</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="pack_type">end</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="pack_type">end</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
                           </widget>
                           <packing>
                             <property name="position">3</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 5b09ea4..11b4eff 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -162,12 +162,6 @@ public partial class ChronoJumpWindow
 	[Widget] Gtk.Entry entry_multi_chronopic_cp2;
 
 	//tools
-	//from SportsTracker code
-	[Glade.WidgetAttribute]
-		private ImageMenuItem
-			menuitem_server_stats = null;
-	[Widget] Gtk.MenuItem menuitem_server_evaluator_data;
-	[Widget] Gtk.MenuItem menuitem_server_upload_session;
 	[Widget] Gtk.MenuItem menuitem_preferences;
 
 
@@ -206,6 +200,8 @@ public partial class ChronoJumpWindow
 	[Widget] Gtk.Notebook notebook_execute;
 	[Widget] Gtk.Notebook notebook_results;
 	[Widget] Gtk.Notebook notebook_options;
+		
+	[Widget] Gtk.Frame frame_share_data;
 	
 	[Widget] Gtk.EventBox eventbox_image_test;
 	[Widget] Gtk.Box vbox_image_test;
@@ -670,14 +666,6 @@ public partial class ChronoJumpWindow
 		image_reaction_times_zoom.Pixbuf = pixbuf;
 		image_pulses_zoom.Pixbuf = pixbuf;
 		image_multi_chronopic_zoom.Pixbuf = pixbuf;
-		
-
-		//menuitems (done differently)
-		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "gpm-statistics.png");
-		//menuitem_view_stats.Image = new Gtk.Image(pixbuf);
-		menuitem_server_stats.Image = new Gtk.Image(pixbuf);
-		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_task-assigned.png");
-		//menuitem_report_window.Image = new Gtk.Image(pixbuf);
 	}
 
 	private void loadPreferences () 
@@ -1024,7 +1012,7 @@ public partial class ChronoJumpWindow
 
 	bool serverEvaluatorDoing;
 	// upload session and it's persons (callback)
-	private void on_menuitem_server_upload_session_pre (object o, EventArgs args) {
+	private void on_server_upload_session_pre (object o, EventArgs args) {
 		//evaluator stuff
 		//Server.ServerUploadEvaluator();
 		string evalMessage = "";
@@ -1069,7 +1057,7 @@ public partial class ChronoJumpWindow
 		}
 	}
 	
-	private void on_menuitem_server_query_activate (object o, EventArgs args) {
+	private void on_menuitem_server_query (object o, EventArgs args) {
 		if(connectedAndCanI(Constants.ServerActionQuery)) {
 			ChronojumpServer myServer = new ChronojumpServer();
 			QueryServerWindow.Show(
@@ -1079,7 +1067,7 @@ public partial class ChronoJumpWindow
 		}
 	}
 	
-	private void on_menuitem_server_ping (object o, EventArgs args) {
+	private void on_server_ping (object o, EventArgs args) {
 		string str = Server.Ping(false, progName, progVersion); //don't do insertion (will show versionAvailable)
 		//show online or offline (not the next version of client available)
 		if(str != Constants.ServerOffline)
@@ -1095,12 +1083,14 @@ public partial class ChronoJumpWindow
 		uploadSessionAfter = true;
 		server_evaluator_data (); 
 	}
-	
+
+	/*	
 	//called when only has to be created/updated the evaluator (not update session)
 	private void on_menuitem_server_evaluator_data_only (object o, EventArgs args) {
 		uploadSessionAfter = false;
 		server_evaluator_data (); 
 	}
+	*/
 	
 	private void server_evaluator_data () {
 		ServerEvaluator myEval = SqliteServer.SelectEvaluator(1); 
@@ -1139,7 +1129,7 @@ public partial class ChronoJumpWindow
 		server_upload_session();
 	}
 
-	private void on_menuitem_goto_server_website_activate (object o, EventArgs args) {
+	private void on_menuitem_goto_server_website (object o, EventArgs args) {
 		if(Util.IsWindows())
 			new DialogMessage(Constants.MessageTypes.INFO, 
 					"http://www.chronojump.org/server.html"; + "\n" + 
@@ -5145,12 +5135,6 @@ Console.WriteLine("X");
 		menuitem_run_analysis.Sensitive = option;
 	}
 	
-	private void menuToolsSensitive(bool option)
-	{
-		menuitem_server_evaluator_data.Sensitive = option;
-		menuitem_server_upload_session.Sensitive = option;
-	}
-
 	private void sensitiveGuiNoSession () 
 	{
 		menuitem_preferences.Sensitive = true;
@@ -5160,7 +5144,6 @@ Console.WriteLine("X");
 		menuSessionSensitive(false);
 		menuPersonSelectedSensitive(false);
 		menuOtherSensitive(false);
-		menuToolsSensitive(false);
 		
 		vbox_image_test.Sensitive = false;
 		frame_persons.Sensitive = false;
@@ -5176,6 +5159,7 @@ Console.WriteLine("X");
 		notebook_results.Sensitive = false;
 		notebook_options.Sensitive = false;
 		vbox_stats.Sensitive = false;
+		frame_share_data.Sensitive = false;
 		
 		hbox_execute_test.Sensitive = false;
 		button_execute_test.Sensitive = false;
@@ -5191,8 +5175,8 @@ Console.WriteLine("X");
 		button_person_add_multiple.Sensitive = true;
 		
 		menuSessionSensitive(true);
-		menuToolsSensitive(true);
 		vbox_stats.Sensitive = true;
+		frame_share_data.Sensitive = true;
 		
 		hbox_execute_test.Sensitive = true;
 		
@@ -5212,7 +5196,6 @@ Console.WriteLine("X");
 		
 		menuPersonSelectedSensitive(false);
 		menuOtherSensitive(false);
-		menuToolsSensitive(false);
 	}
 	
 	private void sensitiveGuiYesPerson () {
@@ -5227,7 +5210,6 @@ Console.WriteLine("X");
 		
 		menuPersonSelectedSensitive(true);
 		menuOtherSensitive(true);
-		menuToolsSensitive(true);
 	
 		//unsensitive edit, delete, repair events because no event is initially selected
 		showHideActionEventButtons(false, "ALL");
diff --git a/src/gui/stats.cs b/src/gui/stats.cs
index a78c960..951ee9d 100644
--- a/src/gui/stats.cs
+++ b/src/gui/stats.cs
@@ -80,6 +80,7 @@ public partial class ChronoJumpWindow {
 	
 	[Widget] Gtk.Image image_stats_win_graph;
 	[Widget] Gtk.Image image_stats_win_graph1;
+	[Widget] Gtk.Image image_stats_win_graph2;
 	[Widget] Gtk.Image image_stats_win_report;
 	[Widget] Gtk.Image image_stats_win_report1;
 	[Widget] Gtk.Image image_results;
@@ -286,6 +287,7 @@ public partial class ChronoJumpWindow {
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "gpm-statistics.png");
 		image_stats_win_graph.Pixbuf = pixbuf;
 		image_stats_win_graph1.Pixbuf = pixbuf;
+		image_stats_win_graph2.Pixbuf = pixbuf;
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_task-assigned.png");
 		image_stats_win_report.Pixbuf = pixbuf;
 		image_stats_win_report1.Pixbuf = pixbuf;



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