]> err.no Git - mapper/commitdiff
Add DOP information text label.
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 28 Jun 2007 12:39:33 +0000 (15:39 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 28 Jun 2007 12:39:33 +0000 (15:39 +0300)
src/gps-panels.c
src/ui-common.c
src/ui-common.h

index dd2e07c981295e943fc7eba810a6a9302f525c61..9d375685dc3bc140dca28bf8f5d0db3167d22f59 100644 (file)
@@ -36,6 +36,7 @@ if (_gps.fix < 2) {
        gtk_label_set_label(GTK_LABEL(_text_lon), " --- ");
        gtk_label_set_label(GTK_LABEL(_text_speed), " --- ");
        gtk_label_set_label(GTK_LABEL(_text_alt), " --- ");
+       gtk_label_set_label(GTK_LABEL(_text_dop), "0/0/0");
 } else {
        gfloat speed = _gps.speed * UNITS_CONVERT[_units];
 
@@ -74,6 +75,11 @@ if (_gps.fix < 2) {
        }
        gtk_label_set_label(GTK_LABEL(_text_alt), buffer);
        g_free(buffer);
+
+       /* DOP */
+       buffer = g_strdup_printf("%.1f/%.1f/%.1f", _gps.hdop, _gps.vdop, _gps.pdop);
+       gtk_label_set_label(GTK_LABEL(_text_dop), buffer);
+       g_free(buffer);
 }
 
 /* refresh sat panel */
@@ -262,10 +268,8 @@ if (widget->allocation.width > widget->allocation.height) {
        xoffset = 0;
        yoffset = (widget->allocation.height - widget->allocation.width) / 2;
 }
-pango_font_description_set_size(_heading_panel_fontdesc,
-                               12 * PANGO_SCALE);
-pango_layout_set_font_description(_heading_panel_layout,
-                                 _heading_panel_fontdesc);
+pango_font_description_set_size(_heading_panel_fontdesc, 12 * PANGO_SCALE);
+pango_layout_set_font_description(_heading_panel_layout, _heading_panel_fontdesc);
 pango_layout_set_alignment(_heading_panel_layout, PANGO_ALIGN_CENTER);
 
 text = g_strdup_printf("%3.0f°", _gps.heading);
index b5d8b63a0327dc76de2bb39c7aa386beec51e4f8..0c827d74bd5c1292c975e481c14be8df9c06515f 100644 (file)
@@ -970,6 +970,10 @@ void mapper_init(gint argc, gchar ** argv)
        gtk_widget_set_size_request(GTK_WIDGET(_text_alt), -1, 30);
        gtk_box_pack_start(GTK_BOX(vbox), _text_alt, FALSE, TRUE, 0);
 
+       _text_dop = gtk_label_new(" --- ");
+       gtk_widget_set_size_request(GTK_WIDGET(_text_dop), -1, 30);
+       gtk_box_pack_start(GTK_BOX(vbox), _text_dop, FALSE, TRUE, 0);
+
        label = gtk_label_new(" ");
        gtk_widget_set_size_request(GTK_WIDGET(label), -1, 10);
        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
index 9e1d059447a2b75e68c8170c1b8ece27c2dfdda3..9519773d1439d162300bd5eafcc298fe25a48c7d 100644 (file)
@@ -41,8 +41,10 @@ GtkWidget *_text_lat;
 GtkWidget *_text_lon;
 GtkWidget *_text_speed;
 GtkWidget *_text_alt;
-GtkWidget *_sat_panel;
+GtkWidget *_text_dop;
 GtkWidget *_text_time;
+
+GtkWidget *_sat_panel;
 GtkWidget *_heading_panel;
 
 GtkWidget *_sat_details_panel;