- /* TODO: Figure out a better way to do plugins
- * AWeatherPlugin interface for tabs?
- * GisPlugin interface for expose? */
- AWeatherGui *gui = aweather_gui_new();
- GisWorld *world = aweather_gui_get_world(gui);
- GisOpenGL *opengl = aweather_gui_get_opengl(gui);
- gis_world_set_offline(world, opt_offline);
- 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)));
- aweather_gui_register_plugin(gui, AWEATHER_PLUGIN(aweather_ridge_new(gui)));
- aweather_gui_register_plugin(gui, AWEATHER_PLUGIN(aweather_radar_new(gui)));
- opengl->plugins = gui->plugins;
+ AWeatherGui *gui = aweather_gui_new();
+
+ gint prefs_debug = gis_prefs_get_integer(gui->prefs, "aweather/log_level");
+ gchar *prefs_site = gis_prefs_get_string(gui->prefs, "aweather/initial_site");
+ gboolean prefs_offline = gis_prefs_get_boolean(gui->prefs, "gis/offline");
+
+ debug = (opt_debug ?: prefs_debug ?: debug);
+ site = (opt_site ?: prefs_site ?: site);
+ offline = (opt_offline ?: prefs_offline ?: offline);
+
+ gis_world_set_offline(gui->world, offline);
+ log_levels = (1 << (debug+1))-1;
+
+ GObject *action = aweather_gui_get_object(gui, "prefs_general_log");
+ g_signal_connect(action, "changed", G_CALLBACK(on_log_level_changed), NULL);