[gnome-calendar] window: use edit-dialog on new event action
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: use edit-dialog on new event action
- Date: Fri, 26 Dec 2014 15:12:57 +0000 (UTC)
commit de2cb4c9b9b9e913f8815a83aedf39600e45287e
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Dec 25 13:34:30 2014 -0500
window: use edit-dialog on new event action
New event action triggered from the menu on the header bar or the app
menu should not use new-event popover.
src/gcal-window.c | 40 ++++++++++++----------------------------
1 files changed, 12 insertions(+), 28 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 08f8ea0..1cc548b 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1479,56 +1479,40 @@ void
gcal_window_new_event (GcalWindow *window)
{
GcalWindowPrivate *priv;
- gint x, y;
+ icaltimetype *start_date, *end_date;
priv = gcal_window_get_instance_private (window);
/* 1st and 2nd steps */
set_new_event_mode (window, TRUE);
- gcal_view_mark_current_unit (GCAL_VIEW (priv->views[priv->active_view]),
- &x, &y);
-
- if (priv->event_creation_data != NULL)
- {
- g_free (priv->event_creation_data->start_date);
- g_free (priv->event_creation_data->end_date);
- g_free (priv->event_creation_data);
- }
-
- priv->event_creation_data = g_new0 (NewEventData, 1);
- priv->event_creation_data->x = x;
- priv->event_creation_data->y = y;
- priv->event_creation_data->start_date = gcal_dup_icaltime (priv->active_date);
- priv->event_creation_data->end_date = gcal_dup_icaltime (priv->active_date);
+ start_date = gcal_dup_icaltime (priv->active_date);
+ end_date = gcal_dup_icaltime (priv->active_date);
/* adjusting dates according to the actual view */
switch (priv->active_view)
{
case GCAL_WINDOW_VIEW_DAY:
case GCAL_WINDOW_VIEW_WEEK:
- priv->event_creation_data->end_date->hour += 1;
- *(priv->event_creation_data->end_date) =
- icaltime_normalize (*(priv->event_creation_data->end_date));
+ end_date->hour += 1;
+ *end_date = icaltime_normalize (*end_date);
break;
case GCAL_WINDOW_VIEW_YEAR:
- priv->event_creation_data->start_date->day = 1;
- priv->event_creation_data->end_date->day =
- icaltime_days_in_month (priv->event_creation_data->end_date->month,
- priv->event_creation_data->end_date->year);
+ start_date->day = 1;
+ end_date->day = icaltime_days_in_month (end_date->month, end_date->year);
break;
case GCAL_WINDOW_VIEW_MONTH:
- priv->event_creation_data->start_date->is_date = 1;
- priv->event_creation_data->end_date->is_date = 1;
+ start_date->is_date = 1;
+ end_date->is_date = 1;
+ end_date->day += 1;
+ *end_date = icaltime_normalize (*end_date);
break;
case GCAL_WINDOW_VIEW_LIST:
case GCAL_WINDOW_VIEW_SEARCH:
break;
}
- prepare_new_event_widget (GCAL_WINDOW (window));
-
- place_new_event_widget (GCAL_WINDOW (window), x, y);
+ create_event_detailed_cb (NULL, start_date, end_date, window);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]