aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/goto.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-12-23 11:26:30 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-12-23 11:26:30 +0800
commitbf39da80e51a03ff8f6eb712d18a97d98d67e116 (patch)
treea74d487f118a10c3b1a3de2c8446ec78363cfa56 /calendar/gui/goto.c
parent9b02c881ef67ec81d137f6478d783e2b1f4efbf1 (diff)
downloadgsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.tar
gsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.tar.gz
gsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.tar.bz2
gsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.tar.lz
gsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.tar.xz
gsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.tar.zst
gsoc2013-evolution-bf39da80e51a03ff8f6eb712d18a97d98d67e116.zip
New function to keep the ecal marked properly (create_ecal): move more
2000-12-22 JP Rosevear <jpr@helixcode.com> * gui/goto.c (ecal_date_range_changed): New function to keep the ecal marked properly (create_ecal): move more creation code here, update marks (goto_dialog_init_widgets): listen for date_range_changed signal in the ecal * gui/calendar-commands.c (init_calendar): Remove ancient gnomecal cruft * gui/mark.[hc], gui/prop.c: Remove ancient gnomecal code that is no longer needed, last bit of bug 904 svn path=/trunk/; revision=7133
Diffstat (limited to 'calendar/gui/goto.c')
-rw-r--r--calendar/gui/goto.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c
index 71d377f2b8..d726544f98 100644
--- a/calendar/gui/goto.c
+++ b/calendar/gui/goto.c
@@ -11,6 +11,7 @@
#include <gnome.h>
#include <glade/glade.h>
#include "calendar-commands.h"
+#include "tag-calendar.h"
#include "goto.h"
typedef struct
@@ -56,6 +57,17 @@ month_changed (GtkToggleButton *toggle, gpointer data)
e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val);
}
+static void
+ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data)
+{
+ GoToDialog *dlg = user_data;
+ CalClient *client;
+
+ client = gnome_calendar_get_cal_client (dlg->gcal);
+ if (client)
+ tag_calendar_by_client (dlg->ecal, client);
+}
+
/* Event handler for day groups in the month item. A button press makes the calendar jump to the
* selected day and destroys the Go-to dialog box.
*/
@@ -76,17 +88,16 @@ ecal_event (ECalendarItem *calitem, gpointer user_data)
gnome_dialog_close (GNOME_DIALOG (dlg->dialog));
}
-/* Creates the canvas with the month item for selecting days */
-static ECalendar *
-create_ecal (void)
+/* Creates the ecalendar */
+static void
+create_ecal (GoToDialog *dlg)
{
- ECalendar *ecal;
-
- ecal = E_CALENDAR (e_calendar_new ());
+ dlg->ecal = E_CALENDAR (e_calendar_new ());
+ e_calendar_item_set_display_popup (dlg->ecal->calitem, FALSE);
+ gtk_widget_show (GTK_WIDGET (dlg->ecal));
+ gtk_box_pack_start (GTK_BOX (dlg->vbox), GTK_WIDGET (dlg->ecal), TRUE, TRUE, 0);
- e_calendar_item_set_display_popup (ecal->calitem, FALSE);
-
- return ecal;
+ ecal_date_range_changed (dlg->ecal->calitem, dlg);
}
static void
@@ -95,8 +106,7 @@ goto_today (GoToDialog *dlg)
gnome_calendar_goto_today (dlg->gcal);
}
-/* Gets the widgets from the XML file and returns if they are all available.
- */
+/* Gets the widgets from the XML file and returns if they are all available. */
static gboolean
get_widgets (GoToDialog *dlg)
{
@@ -133,6 +143,10 @@ goto_dialog_init_widgets (GoToDialog *dlg)
(GtkSignalFunc) year_changed, dlg);
gtk_signal_connect (GTK_OBJECT (dlg->ecal->calitem),
+ "date_range_changed",
+ GTK_SIGNAL_FUNC (ecal_date_range_changed),
+ dlg);
+ gtk_signal_connect (GTK_OBJECT (dlg->ecal->calitem),
"selection_changed",
(GtkSignalFunc) ecal_event,
dlg);
@@ -176,9 +190,7 @@ goto_dialog (GnomeCalendar *gcal)
gtk_option_menu_set_history (GTK_OPTION_MENU (dlg->month), dlg->month_val);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->year), dlg->year_val);
- dlg->ecal = create_ecal ();
- gtk_box_pack_start (GTK_BOX (dlg->vbox), GTK_WIDGET (dlg->ecal), TRUE, TRUE, 0);
- gtk_widget_show (GTK_WIDGET (dlg->ecal));
+ create_ecal (dlg);
goto_dialog_init_widgets (dlg);