]> Pileus Git - grits/blobdiff - src/aweather-view.c
* Road plan (HACKING)
[grits] / src / aweather-view.c
index af83c4b7f14ebf537fd12e689bf93c97fef3d943..2f240a73d4bd0f059605b445d1b3c7d5d8c877bd 100644 (file)
@@ -30,6 +30,7 @@ enum {
 enum {
        SIG_TIME_CHANGED,
        SIG_LOCATION_CHANGED,
+       SIG_REFRESH,
        NUM_SIGNALS,
 };
 
@@ -134,6 +135,16 @@ static void aweather_view_class_init(AWeatherViewClass *klass)
                        G_TYPE_NONE,
                        1,
                        G_TYPE_STRING);
+       signals[SIG_REFRESH] = g_signal_new(
+                       "refresh",
+                       G_TYPE_FROM_CLASS(gobject_class),
+                       G_SIGNAL_RUN_LAST,
+                       0,
+                       NULL,
+                       NULL,
+                       g_cclosure_marshal_VOID__VOID,
+                       G_TYPE_NONE,
+                       0);
 
 }
 
@@ -148,6 +159,7 @@ void aweather_view_set_time(AWeatherView *view, const char *time)
 {
        g_assert(AWEATHER_IS_VIEW(view));
        //g_message("aweather_view:set_time: setting time to %s", time);
+       g_free(view->time);
        view->time = g_strdup(time);
        g_signal_emit(view, signals[SIG_TIME_CHANGED], 0, time);
 }
@@ -174,3 +186,19 @@ gchar *aweather_view_get_location(AWeatherView *view)
        //g_message("aweather_view_get_location");
        return view->location;
 }
+
+void aweather_view_refresh(AWeatherView *view)
+{
+       g_message("aweather_view_refresh: ..");
+       g_signal_emit(view, signals[SIG_REFRESH], 0);
+}
+
+void aweather_view_zoomin(AWeatherView *view)
+{
+       g_message("aweather_view_zoomin: ..");
+}
+
+void aweather_view_zoomout(AWeatherView *view)
+{
+       g_message("aweather_view_zoomout: ..");
+}