From 4dc81f2eda865c9d457b9a8c0db910cc7aedb240 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sun, 19 Jul 2009 02:58:23 +0000 Subject: [PATCH] fixing bug with changing sites on remap --- TODO | 5 +++++ src/main.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 1821e46..9f8711f 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,11 @@ Road plan * Default site * Keybindings? +0.x - Docs + * Man page with key commands + * UI docs?? + * GTK docs + 0.x - Volume scans * Display iso surfaces of volume scans diff --git a/src/main.c b/src/main.c index 67df7a6..4923b37 100644 --- a/src/main.c +++ b/src/main.c @@ -33,10 +33,12 @@ static void log_func(const gchar *log_domain, GLogLevelFlags log_level, g_log_default_handler(log_domain, log_level, message, udata); } +static gulong on_map_id = 0; static gboolean on_map(AWeatherGui *gui, GdkEvent *event, gchar *site) { AWeatherView *view = aweather_gui_get_view(gui); aweather_view_set_site(view, site); + g_signal_handler_disconnect(gui, on_map_id); return FALSE; } @@ -79,7 +81,7 @@ int main(int argc, char *argv[]) AWeatherGui *gui = aweather_gui_new(); AWeatherView *view = aweather_gui_get_view(gui); aweather_view_set_offline(view, opt_offline); - g_signal_connect(gui, "map-event", G_CALLBACK(on_map), opt_site); + on_map_id = g_signal_connect(gui, "map-event", G_CALLBACK(on_map), opt_site); /* Load plugins */ aweather_gui_register_plugin(gui, AWEATHER_PLUGIN(aweather_example_new(gui))); -- 2.43.2