[gnome-calendar/new-year-view] year-view: connect current_date to window
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/new-year-view] year-view: connect current_date to window
- Date: Tue, 20 Jan 2015 15:01:28 +0000 (UTC)
commit 07d0e7ca71697aa0d563a99eb2b1c034acb135c8
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon Jan 19 22:17:19 2015 -0500
year-view: connect current_date to window
Update sidebar whenever the current_date is updated.
This current_date mechanism is going to be moved completely into GcalWindow.
src/gcal-window.c | 3 +++
src/gcal-year-view.c | 22 +++++++++++++++-------
src/gcal-year-view.h | 2 ++
3 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index cca2167..ad6a1eb 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1299,6 +1299,9 @@ gcal_window_constructed (GObject *object)
gcal_search_view_connect (GCAL_SEARCH_VIEW (priv->search_view), priv->manager);
gcal_search_view_set_time_format (GCAL_SEARCH_VIEW (priv->search_view), use_24h_format);
+ /* current date hook */
+ gcal_year_view_set_current_date (GCAL_YEAR_VIEW (priv->views[GCAL_WINDOW_VIEW_YEAR]), NULL);
+
/* signals connection/handling */
/* only GcalView implementations */
for (i = 0; i < 4; ++i)
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index df9460d..3cc87d5 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -1130,13 +1130,6 @@ gcal_year_view_set_manager (GcalYearView *year_view,
GcalManager *manager)
{
year_view->priv->manager = manager;
-
- /* FIXME: move into window */
- year_view->priv->current_date = g_new0 (icaltimetype, 1);
- *(year_view->priv->current_date) =
- icaltime_current_time_with_zone (gcal_manager_get_system_timezone (year_view->priv->manager));
- *(year_view->priv->current_date) = icaltime_set_timezone (year_view->priv->current_date,
- gcal_manager_get_system_timezone
(year_view->priv->manager));
}
void
@@ -1152,3 +1145,18 @@ gcal_year_view_set_use_24h_format (GcalYearView *year_view,
{
year_view->priv->use_24h_format = use_24h_format;
}
+
+void
+gcal_year_view_set_current_date (GcalYearView *year_view,
+ icaltimetype *current_date)
+{
+ /* FIXME: move into window */
+ year_view->priv->current_date = g_new0 (icaltimetype, 1);
+ *(year_view->priv->current_date) =
+ icaltime_current_time_with_zone (gcal_manager_get_system_timezone (year_view->priv->manager));
+ *(year_view->priv->current_date) = icaltime_set_timezone (year_view->priv->current_date,
+ gcal_manager_get_system_timezone
(year_view->priv->manager));
+
+ /* Launches update */
+ update_sidebar (year_view);
+}
diff --git a/src/gcal-year-view.h b/src/gcal-year-view.h
index 27eb409..14b3b62 100644
--- a/src/gcal-year-view.h
+++ b/src/gcal-year-view.h
@@ -62,6 +62,8 @@ void gcal_year_view_set_first_weekday (GcalYearView *year_view,
gint nr_day);
void gcal_year_view_set_use_24h_format (GcalYearView *year_view,
gboolean use_24h_format);
+void gcal_year_view_set_current_date (GcalYearView *year_view,
+ icaltimetype *current_date);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]