From aef92676713d7853cc943a7c5c5e51175b836d99 Mon Sep 17 00:00:00 2001 From: wellu Date: Thu, 25 Sep 2008 17:59:02 +0000 Subject: [PATCH] Minor thingies.. git-svn-id: file:///svnroot/speedometer/trunk@37 df364472-da61-43ef-8a67-511c89aa921b --- ui.c | 2 +- util.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui.c b/ui.c index df4f4b9..0fa47fc 100644 --- a/ui.c +++ b/ui.c @@ -74,6 +74,7 @@ void repaint_all_digits(AppData* appdata) { gtk_widget_queue_draw(GTK_WIDGET(appdata->digit_array[2])); } +// used only in testing... void randomize(AppData* appdata) { g_assert(appdata); gint32 n = g_random_int_range(0, 3); @@ -130,7 +131,6 @@ void create_ui(AppData* appdata) { gtk_container_add(GTK_CONTAINER(appdata->window), GTK_WIDGET(vbox)); - // set backgrounds black set_widget_bg_black(GTK_WIDGET(appdata->window)); set_widget_bg_black(bottom_e); diff --git a/util.c b/util.c index ed20591..a20f0b1 100644 --- a/util.c +++ b/util.c @@ -14,7 +14,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - ****/ +****/ + #include #include #include @@ -25,6 +26,9 @@ #include "callbacks.h" #include "ui.h" + +gdouble unit_array[] = {3.6}; + #define GCONF_KEY "/apps/Maemo/speedometer/disclaimer" static LocationGPSDevice *device = NULL; @@ -66,11 +70,13 @@ void interpret_speed_from_gps(AppData* appdata, gdouble speed) { g_print("Speed is %s km/h\n", charspeed); + // set the main digits guint i = 3; while(i) { i--; set_nth_digit(appdata, i, g_ascii_digit_value(charspeed[i])); } + repaint_all_digits(appdata); g_free(charspeed); @@ -87,7 +93,7 @@ static show_dialog() { "which means (among other things) that you don't have to pay " "a dime for it. " "If you think, however, that this software is worth it, you " - "can always drop me a postcard.\n\n" + "can always drop me a postcard. (or a speeding ticket :)\n\n" "Wellu Mäkinen\n" "PO BOX\n" "33580 Tampere\n" -- 1.7.9.5