diff --git a/data/Makefile.am b/data/Makefile.am index 2cd4ceee..53f473d1 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -36,7 +36,6 @@ EXTRA_DIST= \ ui/date-selector.ui \ ui/edit-dialog.ui \ ui/menus.ui \ - ui/nav_bar.ui \ ui/search-view.ui \ ui/time-selector.ui \ ui/window.ui \ diff --git a/data/calendar.gresource.xml b/data/calendar.gresource.xml index c6712adc..cf6dd5cc 100644 --- a/data/calendar.gresource.xml +++ b/data/calendar.gresource.xml @@ -4,7 +4,6 @@ ui/date-selector.ui ui/edit-dialog.ui ui/menus.ui - ui/nav_bar.ui ui/search-view.ui ui/time-selector.ui ui/window.ui diff --git a/data/ui/nav_bar.ui b/data/ui/nav_bar.ui deleted file mode 100644 index 67129f79..00000000 --- a/data/ui/nav_bar.ui +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - diff --git a/src/Makefile.am b/src/Makefile.am index 6c9fc56b..a9f8bfc2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -50,8 +50,6 @@ gnome_calendar_SOURCES = \ gcal-date-selector.h \ gcal-manager.c \ gcal-manager.h \ - gcal-nav-bar.h \ - gcal-nav-bar.c \ gcal-utils.c \ gcal-utils.h diff --git a/src/gcal-nav-bar.c b/src/gcal-nav-bar.c deleted file mode 100644 index dabc3446..00000000 --- a/src/gcal-nav-bar.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * gcal-nav-bar.c - * - * Copyright (C) 2012 - Erick Pérez Castellanos - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "gcal-nav-bar.h" -#include "gcal-utils.h" - -#include - -typedef struct -{ - GtkWidget *back_button; - GtkWidget *forward_button; - - GtkWidget *left_label; - GtkWidget *right_label; -} GcalNavBarPrivate; - -enum -{ - PROP_0, - PROP_LEFT_HEADER, - PROP_RIGHT_HEADER -}; - -static void gcal_nav_bar_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); - -static void gcal_nav_bar_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); - -G_DEFINE_TYPE_WITH_PRIVATE (GcalNavBar, gcal_nav_bar, GTK_TYPE_GRID) - -static void -gcal_nav_bar_class_init (GcalNavBarClass *klass) -{ - GtkWidgetClass *widget_class; - GObjectClass *object_class; - - object_class = G_OBJECT_CLASS (klass); - object_class->set_property = gcal_nav_bar_set_property; - object_class->get_property = gcal_nav_bar_get_property; - - g_object_class_install_property ( - object_class, - PROP_LEFT_HEADER, - g_param_spec_string ("left-header", - "Left Header", - "The text of the left header", - "", - G_PARAM_CONSTRUCT | - G_PARAM_READWRITE)); - - g_object_class_install_property ( - object_class, - PROP_RIGHT_HEADER, - g_param_spec_string ("right-header", - "Right Header", - "The text of the right header", - "", - G_PARAM_CONSTRUCT | - G_PARAM_READWRITE)); - - widget_class = GTK_WIDGET_CLASS (klass); - - /* Setup the template GtkBuilder xml for this class */ - gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/nav_bar.ui"); - - /* Bind internals widgets */ - gtk_widget_class_bind_template_child_private (widget_class, GcalNavBar, left_label); - gtk_widget_class_bind_template_child_private (widget_class, GcalNavBar, right_label); -} - - - -static void -gcal_nav_bar_init (GcalNavBar *self) -{ - gtk_widget_init_template (GTK_WIDGET (self)); -} - -static void -gcal_nav_bar_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - GcalNavBarPrivate *priv; - priv = gcal_nav_bar_get_instance_private (GCAL_NAV_BAR (object)); - - switch (property_id) - { - case PROP_LEFT_HEADER: - gtk_label_set_text (GTK_LABEL (priv->left_label), - g_value_get_string (value)); - break; - case PROP_RIGHT_HEADER: - gtk_label_set_text (GTK_LABEL (priv->right_label), - g_value_get_string (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -gcal_nav_bar_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - GcalNavBarPrivate *priv; - priv = gcal_nav_bar_get_instance_private (GCAL_NAV_BAR (object)); - - switch (property_id) - { - case PROP_LEFT_HEADER: - g_value_set_string (value, - gtk_label_get_text (GTK_LABEL (priv->left_label))); - break; - case PROP_RIGHT_HEADER: - g_value_set_string (value, - gtk_label_get_text (GTK_LABEL (priv->right_label))); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -/* Public API */ -/** - * gcal_nav_bar_new: - * - * Since: 0.1 - * Return value: A new #GcalNavBar - * Returns: (transfer full): - **/ -GtkWidget* -gcal_nav_bar_new (void) -{ - return g_object_new (GCAL_TYPE_NAV_BAR, NULL); -} diff --git a/src/gcal-nav-bar.h b/src/gcal-nav-bar.h deleted file mode 100644 index c2a5886a..00000000 --- a/src/gcal-nav-bar.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * gcal-nav-bar.h - * - * Copyright (C) 2012 - Erick Pérez Castellanos - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef __GCAL_NAV_BAR_H__ -#define __GCAL_NAV_BAR_H__ - -#include - -G_BEGIN_DECLS - -#define GCAL_TYPE_NAV_BAR (gcal_nav_bar_get_type ()) -#define GCAL_NAV_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCAL_TYPE_NAV_BAR, GcalNavBar)) -#define GCAL_NAV_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCAL_TYPE_NAV_BAR, GcalNavBarClass)) -#define GCAL_IS_NAV_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCAL_TYPE_NAV_BAR)) -#define GCAL_IS_NAV_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCAL_TYPE_NAV_BAR)) -#define GCAL_NAV_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCAL_TYPE_NAV_BAR, GcalNavBarClass)) - -typedef struct _GcalNavBar GcalNavBar; -typedef struct _GcalNavBarClass GcalNavBarClass; - -struct _GcalNavBar -{ - GtkGrid parent; -}; - -struct _GcalNavBarClass -{ - GtkGridClass parent_class; -}; - -GType gcal_nav_bar_get_type (void); - -GtkWidget* gcal_nav_bar_new (void); - -G_END_DECLS - -#endif /* __GCAL_NAV_BAR_H__ */ diff --git a/src/gcal-window.c b/src/gcal-window.c index f4506273..23059fe0 100644 --- a/src/gcal-window.c +++ b/src/gcal-window.c @@ -20,7 +20,6 @@ #include "gcal-window.h" -#include "gcal-nav-bar.h" #include "gcal-manager.h" #include "gcal-view.h" #include "gcal-month-view.h"