aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-12-04 19:08:15 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-12-04 19:08:15 +0800
commit7dafe33520316eadd8ee9df234ba8eb5e6333160 (patch)
tree7997ba4b8ce7f26bff810a7ef84a0282c5a8c31b
parentf4d3ee5d5923e8a91b45fc6dd8eb8fb2857f41de (diff)
downloadgsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.tar
gsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.tar.gz
gsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.tar.bz2
gsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.tar.lz
gsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.tar.xz
gsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.tar.zst
gsoc2013-evolution-7dafe33520316eadd8ee9df234ba8eb5e6333160.zip
** Fix for bug #220846
2007-12-04 Milan Crha <mcrha@redhat.com> ** Fix for bug #220846 * itip-view.h: * itip-view.c: (itip_view_set_show_free_time_check), (itip_view_get_free_time_check_state), (struct _ItipViewPrivate), (itip_view_init): * itip-formatter.c: (view_response_cb), (format_itip_object): New option to accept meeting request as free time. svn path=/trunk/; revision=34640
-rw-r--r--plugins/itip-formatter/ChangeLog11
-rw-r--r--plugins/itip-formatter/itip-formatter.c16
-rw-r--r--plugins/itip-formatter/itip-view.c32
-rw-r--r--plugins/itip-formatter/itip-view.h3
4 files changed, 58 insertions, 4 deletions
diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog
index bb4ae062d5..d4132aeb8f 100644
--- a/plugins/itip-formatter/ChangeLog
+++ b/plugins/itip-formatter/ChangeLog
@@ -1,3 +1,14 @@
+2007-12-04 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #220846
+
+ * itip-view.h:
+ * itip-view.c: (itip_view_set_show_free_time_check),
+ (itip_view_get_free_time_check_state), (struct _ItipViewPrivate),
+ (itip_view_init):
+ * itip-formatter.c: (view_response_cb), (format_itip_object):
+ New option to accept meeting request as free time.
+
2007-11-23 Milan Crha <mcrha@redhat.com>
** Fix for bug #458237
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 4dabf551a8..a3bb6c2e80 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -1617,11 +1617,17 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
ECalComponentTransparency trans;
gboolean flag;
- e_cal_component_get_transparency (pitip->comp, &trans);
- /* FIXME we should be providing an option to accept as free or busy */
- if (trans == E_CAL_COMPONENT_TRANSP_NONE)
- e_cal_component_set_transparency (pitip->comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
+ if (pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) {
+ if (itip_view_get_free_time_check_state (ITIP_VIEW (pitip->view)))
+ e_cal_component_set_transparency (pitip->comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
+ else
+ e_cal_component_set_transparency (pitip->comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
+ } else {
+ e_cal_component_get_transparency (pitip->comp, &trans);
+ if (trans == E_CAL_COMPONENT_TRANSP_NONE)
+ e_cal_component_set_transparency (pitip->comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
+ }
if (!pitip->to_address && pitip->current_ecal != NULL)
e_cal_get_cal_address (pitip->current_ecal, &pitip->to_address, NULL);
@@ -2140,6 +2146,8 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject
if (response_enabled) {
g_signal_connect (pitip->view, "response", G_CALLBACK (view_response_cb), pitip);
+ itip_view_set_show_free_time_check (ITIP_VIEW (pitip->view), pitip->type == E_CAL_SOURCE_TYPE_EVENT && (pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST));
+
if (pitip->calendar_uid)
pitip->current_ecal = start_calendar_server_by_uid (pitip, pitip->calendar_uid, pitip->type);
else {
diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c
index fb60c4fa31..28596c2fba 100644
--- a/plugins/itip-formatter/itip-view.c
+++ b/plugins/itip-formatter/itip-view.c
@@ -122,6 +122,9 @@ struct _ItipViewPrivate {
GtkWidget *update_check;
gboolean update_show;
+ GtkWidget *options_box;
+ GtkWidget *free_time_check;
+
GtkWidget *button_box;
gboolean buttons_sensitive;
@@ -1109,6 +1112,13 @@ itip_view_init (ItipView *view)
g_signal_connect (priv->recur_check, "toggled", G_CALLBACK (recur_toggled_cb), view);
+ priv->options_box = gtk_vbox_new (FALSE, 2);
+ gtk_widget_show (priv->options_box);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->options_box, FALSE, FALSE, 0);
+
+ priv->free_time_check = gtk_check_button_new_with_mnemonic (_("Show time as _free"));
+ gtk_box_pack_start (GTK_BOX (priv->options_box), priv->free_time_check, FALSE, FALSE, 0);
+
/* The buttons for actions */
priv->button_box = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_END);
@@ -2095,3 +2105,25 @@ itip_view_set_show_recur_check (ItipView *view, gboolean show)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->recur_check), FALSE);
}
}
+
+void
+itip_view_set_show_free_time_check (ItipView *view, gboolean show)
+{
+ g_return_if_fail (view != NULL);
+ g_return_if_fail (ITIP_IS_VIEW (view));
+
+ if (show)
+ gtk_widget_show (view->priv->free_time_check);
+ else {
+ gtk_widget_hide (view->priv->free_time_check);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->free_time_check), FALSE);
+ }
+}
+
+gboolean
+itip_view_get_free_time_check_state (ItipView *view)
+{
+ g_return_val_if_fail (view != NULL, FALSE);
+
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (view->priv->free_time_check));
+}
diff --git a/plugins/itip-formatter/itip-view.h b/plugins/itip-formatter/itip-view.h
index a93da5c53c..2e9f119642 100644
--- a/plugins/itip-formatter/itip-view.h
+++ b/plugins/itip-formatter/itip-view.h
@@ -177,6 +177,9 @@ gboolean itip_view_get_recur_check_state (ItipView *view);
void itip_view_set_needs_decline (ItipView *view, gboolean needs_decline);
+void itip_view_set_show_free_time_check (ItipView *view, gboolean show);
+gboolean itip_view_get_free_time_check_state (ItipView *view);
+
G_END_DECLS
#endif