From cf325864a622b3c2457ca8524fc25f144cd5f7b6 Mon Sep 17 00:00:00 2001
From: "Jan \"Yenya\" Kasprzak" <kas@fi.muni.cz>
Date: Tue, 7 Dec 2010 17:12:39 +0100
Subject: [PATCH] Avg lap time and other GUI updates.

---
 SCX/Car.pm       |  11 +
 SCX/GUI.pm       |  15 +-
 slotcarman.glade | 750 ++++++++++++++++++++++++++++-------------------
 3 files changed, 472 insertions(+), 304 deletions(-)

diff --git a/SCX/Car.pm b/SCX/Car.pm
index 23caad6..165d09e 100644
--- a/SCX/Car.pm
+++ b/SCX/Car.pm
@@ -78,6 +78,15 @@ sub set_lap {
 
 	$self->{lap} = $lap_nr;
 	$self->gui->set_lap($self->{order}, defined $lap_nr ? $lap_nr : '--');
+	if ($self->track->{race_running} && $self->{lap} > 1) {
+		my $now = gettimeofday;
+		my $avg = ($now - $self->track->{race_running_since})
+			/ ($self->{lap} - 1);
+		$self->{avg_lap} = $avg;
+		$self->gui->set_avg_lap($self->{order}, $avg);
+	} else {
+		$self->gui->set_avg_lap($self->{order}, '--');
+	}
 }
 
 sub set_laptime {
@@ -156,6 +165,8 @@ sub set_order {
 		? $self->{laptime} : '--');
 	$self->gui->set_best_lap($self->{order}, defined $self->{best_lap}
 		? $self->{best_lap} : '--');
+	$self->gui->set_avg_lap($self->{order}, defined $self->{avg_lap}
+		? $self->{avg_lap} : '--');
 	$self->gui->set_fuel($self->{order}, $self->{fuel});
 }
 	
diff --git a/SCX/GUI.pm b/SCX/GUI.pm
index 93e76b7..0e01d17 100755
--- a/SCX/GUI.pm
+++ b/SCX/GUI.pm
@@ -153,6 +153,15 @@ sub set_laptime {
 	$label->set_markup('<span font_desc="18" weight="bold">'.$text.'</span>');
 }
 
+sub set_avg_lap {
+	my ($self, $row, $text) = @_;
+
+	++$row;
+	my $label = $self->get_object("label_avg_lap$row")
+		or die "Can't get label_avg_lap$row";
+	$label->set_markup('<span font_desc="22" weight="bold">'.$text.'</span>');
+}
+
 sub set_best_lap {
 	my ($self, $row, $text, $global) = @_;
 
@@ -208,7 +217,7 @@ sub rounds {
 
 	my $label = $self->get_object("label_lap_global")
 		or die "Can't get label_lap_global";
-	$label->set_markup('<span font_desc="18" weight="bold">Lap: '.$text.'</span>');
+	$label->set_markup('<span font_desc="18" weight="bold">'.$text.'</span>');
 }
 
 sub time {
@@ -216,7 +225,7 @@ sub time {
 
 	my $label = $self->get_object("label_time_global")
 		or die "Can't get label_time_global";
-	$label->set_markup('<span font_desc="18" weight="bold">Time: '.$text.'</span>');
+	$label->set_markup('<span font_desc="18" weight="bold">'.$text.'</span>');
 }
 
 sub best_lap {
@@ -228,7 +237,7 @@ sub best_lap {
 
 	my $label = $self->get_object("label_best_lap_global")
 		or die "Can't get label_best_lap_global";
-	$label->set_markup('<span font_desc="18" weight="bold">Best lap: '.$text.'</span>');
+	$label->set_markup('<span font_desc="18" weight="bold">'.$text.'</span>');
 }
 
 1;
diff --git a/slotcarman.glade b/slotcarman.glade
index ca13b1a..4e1d0df 100644
--- a/slotcarman.glade
+++ b/slotcarman.glade
@@ -165,48 +165,102 @@
           <object class="GtkHBox" id="hbox1">
             <property name="visible">True</property>
             <child>
-              <object class="GtkLabel" id="label_lap_global">
+              <object class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
+                <property name="label_xalign">0.5</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment1">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkLabel" id="label_lap_global">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">0</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label7">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Lap</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="position">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_time_global">
+              <object class="GtkFrame" id="frame2">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
+                <property name="label_xalign">0.5</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkLabel" id="label_time_global">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">0:00</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label8">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Time</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap_global">
+              <object class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
+                <property name="label_xalign">0.5</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment3">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkLabel" id="label_best_lap_global">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">0</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label9">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Fastest lap</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="position">2</property>
               </packing>
             </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
           </object>
           <packing>
             <property name="position">1</property>
           </packing>
         </child>
+        <child>
+          <placeholder/>
+        </child>
         <child>
           <object class="GtkTable" id="table1">
             <property name="visible">True</property>
-            <property name="n_rows">7</property>
-            <property name="n_columns">11</property>
+            <property name="n_rows">13</property>
+            <property name="n_columns">8</property>
             <child>
               <object class="GtkLabel" id="label_pos1">
                 <property name="visible">True</property>
@@ -217,8 +271,8 @@
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -231,8 +285,8 @@
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
@@ -246,8 +300,8 @@
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
@@ -260,8 +314,8 @@
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
@@ -274,8 +328,8 @@
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
@@ -288,22 +342,23 @@
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_name1">
                 <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Click to modify</property>
                 <property name="ellipsize">end</property>
                 <property name="width_chars">25</property>
                 <property name="single_line_mode">True</property>
               </object>
               <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>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -312,10 +367,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -324,10 +379,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
@@ -336,10 +391,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
@@ -348,10 +403,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
@@ -360,10 +415,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
@@ -372,10 +427,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
@@ -384,10 +439,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -396,10 +451,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
@@ -408,10 +463,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
@@ -420,10 +475,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
@@ -432,10 +487,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
@@ -444,10 +499,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
@@ -456,10 +511,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <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="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -468,10 +523,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
@@ -480,10 +535,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
@@ -492,10 +547,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
@@ -504,10 +559,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
@@ -516,10 +571,10 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
@@ -531,10 +586,10 @@
                 <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="left_attach">4</property>
+                <property name="right_attach">5</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -545,10 +600,10 @@
                 <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="left_attach">4</property>
+                <property name="right_attach">5</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
@@ -559,10 +614,10 @@
                 <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="left_attach">4</property>
+                <property name="right_attach">5</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
@@ -573,10 +628,10 @@
                 <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="left_attach">4</property>
+                <property name="right_attach">5</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
@@ -587,10 +642,10 @@
                 <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="left_attach">4</property>
+                <property name="right_attach">5</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
@@ -601,308 +656,423 @@
                 <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="left_attach">4</property>
+                <property name="right_attach">5</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_name2">
                 <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Click to modify</property>
                 <property name="ellipsize">end</property>
                 <property name="width_chars">25</property>
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_name3">
                 <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Click to modify</property>
                 <property name="ellipsize">end</property>
                 <property name="width_chars">25</property>
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_name4">
                 <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Click to modify</property>
                 <property name="ellipsize">end</property>
                 <property name="width_chars">25</property>
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_name5">
                 <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Click to modify</property>
                 <property name="ellipsize">end</property>
                 <property name="width_chars">25</property>
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_name6">
                 <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Click to modify</property>
                 <property name="ellipsize">end</property>
                 <property name="width_chars">25</property>
                 <property name="single_line_mode">True</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label_laptime1">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
-              </object>
-              <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_laptime2">
+              <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
+                <property name="label" translatable="yes">Name</property>
               </object>
               <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_laptime3">
+              <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
+                <property name="label" translatable="yes">Lap</property>
               </object>
               <packing>
                 <property name="left_attach">4</property>
                 <property name="right_attach">5</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_laptime4">
+              <object class="GtkLabel" id="label3">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
+                <property name="label" translatable="yes">Last/Best/Avg</property>
               </object>
               <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="left_attach">5</property>
+                <property name="right_attach">6</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_laptime5">
+              <object class="GtkLabel" id="label5">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
+                <property name="label" translatable="yes">Throttle</property>
               </object>
               <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="left_attach">6</property>
+                <property name="right_attach">7</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_laptime6">
+              <object class="GtkLabel" id="label6">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
+                <property name="label" translatable="yes">Fuel</property>
               </object>
               <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="left_attach">7</property>
+                <property name="right_attach">8</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap1">
+              <object class="GtkHSeparator" id="hseparator1">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
+                <property name="right_attach">8</property>
                 <property name="top_attach">1</property>
                 <property name="bottom_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap2">
+              <object class="GtkHSeparator" id="hseparator2">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap3">
+              <object class="GtkHSeparator" id="hseparator3">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="right_attach">8</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap4">
+              <object class="GtkHSeparator" id="hseparator4">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">7</property>
+                <property name="bottom_attach">8</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap5">
+              <object class="GtkHSeparator" id="hseparator5">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">9</property>
+                <property name="bottom_attach">10</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label_best_lap6">
+              <object class="GtkHSeparator" id="hseparator6">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="justify">right</property>
-                <property name="width_chars">12</property>
               </object>
               <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="right_attach">7</property>
+                <property name="top_attach">11</property>
+                <property name="bottom_attach">12</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label1">
+              <object class="GtkVBox" id="vbox2">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Name</property>
+                <child>
+                  <object class="GtkLabel" id="label_laptime1">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_best_lap1">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_avg_lap1">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
+                <property name="left_attach">5</property>
+                <property name="right_attach">6</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label2">
+              <object class="GtkVBox" id="vbox3">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Lap</property>
+                <child>
+                  <object class="GtkLabel" id="label_laptime2">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_best_lap2">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_avg_lap2">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
+                <property name="left_attach">5</property>
+                <property name="right_attach">6</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label3">
+              <object class="GtkVBox" id="vbox4">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Last lap</property>
+                <child>
+                  <object class="GtkLabel" id="label_laptime3">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_best_lap3">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_avg_lap3">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
+                <property name="left_attach">5</property>
+                <property name="right_attach">6</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label4">
+              <object class="GtkVBox" id="vbox5">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Best lap</property>
+                <child>
+                  <object class="GtkLabel" id="label_laptime4">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_best_lap4">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_avg_lap4">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="left_attach">5</property>
                 <property name="right_attach">6</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label5">
+              <object class="GtkVBox" id="vbox6">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Throttle</property>
+                <child>
+                  <object class="GtkLabel" id="label_laptime5">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_best_lap5">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_avg_lap5">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
+                <property name="left_attach">5</property>
+                <property name="right_attach">6</property>
+                <property name="top_attach">10</property>
+                <property name="bottom_attach">11</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label6">
+              <object class="GtkVBox" id="vbox7">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Fuel</property>
+                <child>
+                  <object class="GtkLabel" id="label_laptime6">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_best_lap6">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_avg_lap6">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">0</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
+                <property name="left_attach">5</property>
+                <property name="right_attach">6</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
               </packing>
             </child>
             <child>
@@ -941,42 +1111,9 @@
             <child>
               <placeholder/>
             </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
           </object>
           <packing>
-            <property name="position">2</property>
+            <property name="position">3</property>
           </packing>
         </child>
         <child>
@@ -984,10 +1121,21 @@
             <property name="visible">True</property>
             <property name="spacing">2</property>
             <property name="has_resize_grip">False</property>
+            <child>
+              <object class="GtkImage" id="image1">
+                <property name="visible">True</property>
+                <property name="stock">gtk-connect</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="position">3</property>
+            <property name="position">4</property>
           </packing>
         </child>
       </object>
-- 
2.43.5