[gnome-calendar/gbsneto/gtk4: 4/10] XXX Temporarily disable year view




commit 335690c11400e5d42dc82252554351cecd709899
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jan 26 12:50:55 2022 -0300

    XXX Temporarily disable year view

 src/gui/gcal-window.c     | 15 ++++++++-------
 src/gui/gcal-window.ui    |  2 ++
 src/gui/views/meson.build |  2 +-
 3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/gui/gcal-window.c b/src/gui/gcal-window.c
index 7c2673d1..39ebc489 100644
--- a/src/gui/gcal-window.c
+++ b/src/gui/gcal-window.c
@@ -101,7 +101,7 @@ struct _GcalWindow
   AdwViewStack       *views_stack;
   GtkWidget          *week_view;
   GtkWidget          *month_view;
-  GtkWidget          *year_view;
+  //GtkWidget          *year_view;
 
   /* header_bar widets */
   GtkWidget          *back_button;
@@ -231,7 +231,7 @@ maybe_add_subscribers_to_timeline (GcalWindow *self)
   timeline = gcal_manager_get_timeline (gcal_context_get_manager (self->context));
   gcal_timeline_add_subscriber (timeline, GCAL_TIMELINE_SUBSCRIBER (self->week_view));
   gcal_timeline_add_subscriber (timeline, GCAL_TIMELINE_SUBSCRIBER (self->month_view));
-  gcal_timeline_add_subscriber (timeline, GCAL_TIMELINE_SUBSCRIBER (self->year_view));
+  //gcal_timeline_add_subscriber (timeline, GCAL_TIMELINE_SUBSCRIBER (self->year_view));
 
   self->subscribed = TRUE;
 }
@@ -250,7 +250,8 @@ update_active_date (GcalWindow *window,
 
   gcal_set_date_time (&window->active_date, new_date);
 
-  for (i = GCAL_WINDOW_VIEW_WEEK; i <= GCAL_WINDOW_VIEW_YEAR; i++)
+  //for (i = GCAL_WINDOW_VIEW_WEEK; i <= GCAL_WINDOW_VIEW_YEAR; i++)
+  for (i = GCAL_WINDOW_VIEW_WEEK; i < GCAL_WINDOW_VIEW_YEAR; i++)
     gcal_view_set_date (GCAL_VIEW (window->views[i]), new_date);
 
   update_today_button_sensitive (window);
@@ -843,7 +844,7 @@ gcal_window_constructed (GObject *object)
   g_object_bind_property (self, "context", self->calendar_management_dialog, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->week_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->month_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
-  g_object_bind_property (self, "context", self->year_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
+  //g_object_bind_property (self, "context", self->year_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->event_editor, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->quick_add_popover, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->search_button, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
@@ -980,7 +981,7 @@ gcal_window_class_init (GcalWindowClass *klass)
   g_type_ensure (GCAL_TYPE_SEARCH_BUTTON);
   g_type_ensure (GCAL_TYPE_WEATHER_SETTINGS);
   g_type_ensure (GCAL_TYPE_WEEK_VIEW);
-  g_type_ensure (GCAL_TYPE_YEAR_VIEW);
+  //g_type_ensure (GCAL_TYPE_YEAR_VIEW);
 
   object_class = G_OBJECT_CLASS (klass);
   object_class->finalize = gcal_window_finalize;
@@ -1041,7 +1042,7 @@ gcal_window_class_init (GcalWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_switcher);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, weather_settings);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, week_view);
-  gtk_widget_class_bind_template_child (widget_class, GcalWindow, year_view);
+  //gtk_widget_class_bind_template_child (widget_class, GcalWindow, year_view);
 
   gtk_widget_class_bind_template_callback (widget_class, view_changed);
 
@@ -1084,7 +1085,7 @@ gcal_window_init (GcalWindow *self)
 
   self->views[GCAL_WINDOW_VIEW_WEEK] = self->week_view;
   self->views[GCAL_WINDOW_VIEW_MONTH] = self->month_view;
-  self->views[GCAL_WINDOW_VIEW_YEAR] = self->year_view;
+  //self->views[GCAL_WINDOW_VIEW_YEAR] = self->year_view;
 
   self->active_date = g_date_time_new_from_unix_local (0);
   self->rtl = gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL;
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index 6f86408f..c23d6014 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -202,6 +202,7 @@
                         </property>
                       </object>
                     </child>
+                    <!-- TODO
                     <child>
                       <object class="AdwViewStackPage">
                         <property name="name">year</property>
@@ -217,6 +218,7 @@
                         </property>
                       </object>
                     </child>
+                    -->
                   </object>
                 </child>
               </object>
diff --git a/src/gui/views/meson.build b/src/gui/views/meson.build
index 2306458b..1edf6bab 100644
--- a/src/gui/views/meson.build
+++ b/src/gui/views/meson.build
@@ -16,5 +16,5 @@ sources += files(
   'gcal-week-hour-bar.c',
   'gcal-week-view.c',
   'gcal-week-view-common.c',
-  'gcal-year-view.c',
+  #'gcal-year-view.c',
 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]