aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-model.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-08-07 08:46:56 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-08-07 08:46:56 +0800
commit9d8f94804917a0338a08be9f36a8e047ccedd939 (patch)
tree4e29f6218af7cbdc4a84933d9cffddd1b7caa61c /calendar/gui/calendar-model.c
parent5949b39e3437ebbf7e7461c58df50424e0993809 (diff)
downloadgsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.gz
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.bz2
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.lz
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.xz
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.zst
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.zip
added 'different_timezone' fields to EDayViewEvent and EWeekViewEvent, to
2001-08-06 Damon Chaplin <damon@ximian.com> * gui/e-week-view.h: * gui/e-day-view.h: added 'different_timezone' fields to EDayViewEvent and EWeekViewEvent, to note that the event is in a different timezone. We now compute this once when we add the event to the array, rather than each time we draw the event. If it is set, we will draw the timezone icon next to the event. * gui/e-day-view-main-item.c: take transparency into account when drawing the blue vertical bars to represent busy time. * gui/tag-calendar.c: take transparency into account when tagging the mini calendar. * gui/e-calendar-table.c (e_calendar_table_init): removed the "None" options for transparency and classification, since these properties have defaults anyway, so we may as well use those to keep it simple. Also use "Free" and "Busy" for transparency, rather than "Transparent" and "Opaque". * gui/calendar-model.c: updated classification & transparency code as above. * gui/e-calendar-table.etspec: changed "Transparency" to "Show Time As" since people have a chance of understanding that. * gui/e-week-view.c: * gui/e-day-view.c: * gui/gnome-cal.c: added functions to get the visible time range. * gui/calendar-commands.c: finished stuff to set the folder bar label to the dates currently displayed. * gui/control-factory.c (control_factory_new_control): connected signal to update the folder title bar label when the dates shown are changed. I had to connect it here since we need the BonoboControl in the callback, and I don't know how to get the control from the widget. * gui/tasks-control.c (tasks_control_activate): clear the folder bar label. We could display something here at some point. * gui/dialogs/recurrence-page.glade: changed "_Add" to "A_dd", since we have an "_Actions" menu. (These also use Alt+key, right?) * gui/dialogs/event-page.glade: * gui/dialogs/event-page.c: added 'Show Time As' field, which is really the TRANSP property but with a better name! Also changed one of the "_Confidential" to "Con_fidential" since we already have "_Contacts" using the same 'C' key. * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): skip events that are TRANSPARENT. Also added comment as this code looks inefficient. * cal-util/cal-component.c: removed stuff for comparing timezones. * gui/comp-util.c (cal_comp_util_compare_event_timezones): moved the above function here, and updated it to compare the UTC offsets of the times as well as the TZIDs. svn path=/trunk/; revision=11717
Diffstat (limited to 'calendar/gui/calendar-model.c')
-rw-r--r--calendar/gui/calendar-model.c90
1 files changed, 11 insertions, 79 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 43195071f0..f61b76cd88 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -351,24 +351,14 @@ get_classification (CalComponent *comp)
cal_component_get_classification (comp, &classif);
switch (classif) {
- case CAL_COMPONENT_CLASS_NONE:
- return "";
-
- case CAL_COMPONENT_CLASS_PUBLIC:
- return _("Public");
-
case CAL_COMPONENT_CLASS_PRIVATE:
return _("Private");
case CAL_COMPONENT_CLASS_CONFIDENTIAL:
return _("Confidential");
- case CAL_COMPONENT_CLASS_UNKNOWN:
- return _("Unknown");
-
default:
- g_assert_not_reached ();
- return "";
+ return _("Public");
}
}
@@ -535,21 +525,10 @@ get_transparency (CalComponent *comp)
cal_component_get_transparency (comp, &transp);
- switch (transp) {
- case CAL_COMPONENT_TRANSP_NONE:
- case CAL_COMPONENT_TRANSP_UNKNOWN:
- return "";
-
- case CAL_COMPONENT_TRANSP_TRANSPARENT:
- return _("Transparent");
-
- case CAL_COMPONENT_TRANSP_OPAQUE:
- return _("Opaque");
-
- default:
- g_assert_not_reached ();
- return NULL;
- }
+ if (transp == CAL_COMPONENT_TRANSP_TRANSPARENT)
+ return _("Free");
+ else
+ return _("Busy");
}
/* Builds a string for the URL property of a calendar component */
@@ -937,40 +916,18 @@ set_categories (CalComponent *comp, const char *value)
}
-/* FIXME: We won't need this eventually, since the user won't be allowed to
- * edit the field.
- */
-static void
-show_classification_warning (void)
-{
- GtkWidget *dialog;
-
- dialog = gnome_message_box_new (_("The classification must be 'Public', 'Private', 'Confidential' or 'None'"),
- GNOME_MESSAGE_BOX_ERROR,
- GNOME_STOCK_BUTTON_OK, NULL);
- gtk_widget_show (dialog);
-}
-
-
static void
set_classification (CalComponent *comp,
const char *value)
{
CalComponentClassification classif;
- /* An empty string is the same as 'None'. */
- if (!value[0] || !g_strcasecmp (value, _("None")))
- classif = CAL_COMPONENT_CLASS_NONE;
- else if (!g_strcasecmp (value, _("Public")))
- classif = CAL_COMPONENT_CLASS_PUBLIC;
- else if (!g_strcasecmp (value, _("Private")))
+ if (!g_strcasecmp (value, _("Private")))
classif = CAL_COMPONENT_CLASS_PRIVATE;
else if (!g_strcasecmp (value, _("Confidential")))
classif = CAL_COMPONENT_CLASS_CONFIDENTIAL;
- else {
- show_classification_warning ();
- return;
- }
+ else
+ classif = CAL_COMPONENT_CLASS_PUBLIC;
cal_component_set_classification (comp, classif);
}
@@ -1178,41 +1135,16 @@ set_summary (CalComponent *comp, const char *value)
cal_component_set_summary (comp, &text);
}
-/* FIXME: We won't need this eventually, since the user won't be allowed to
- * edit the field.
- */
-static void
-show_transparency_warning (void)
-{
- GtkWidget *dialog;
-
- dialog = gnome_message_box_new (_("The transparency must be 'Transparent', 'Opaque', or 'None'."),
- GNOME_MESSAGE_BOX_ERROR,
- GNOME_STOCK_BUTTON_OK, NULL);
- gtk_widget_show (dialog);
-}
-
-/* Sets the URI of a calendar component */
+/* Sets the transparency of a calendar component */
static void
set_transparency (CalComponent *comp, const char *value)
{
CalComponentTransparency transp;
- g_print ("In calendar model set_transparency: %s\n", value);
-
- /* An empty string is the same as 'None'. */
- if (!value[0] || !g_strcasecmp (value, _("None")))
- transp = CAL_COMPONENT_TRANSP_NONE;
- else if (!g_strcasecmp (value, _("Transparent")))
+ if (!g_strcasecmp (value, _("Free")))
transp = CAL_COMPONENT_TRANSP_TRANSPARENT;
- else if (!g_strcasecmp (value, _("Opaque"))) {
+ else
transp = CAL_COMPONENT_TRANSP_OPAQUE;
- } else {
- show_transparency_warning ();
- return;
- }
-
- g_print (" transp: %i\n", transp);
cal_component_set_transparency (comp, transp);
}