edit-dialog: Rename to GcalEventEditorDialog
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<file compressed="true">gcal-alarm-row.ui</file>
|
<file compressed="true">gcal-alarm-row.ui</file>
|
||||||
<file compressed="true">gcal-date-chooser.ui</file>
|
<file compressed="true">gcal-date-chooser.ui</file>
|
||||||
<file compressed="true">gcal-date-selector.ui</file>
|
<file compressed="true">gcal-date-selector.ui</file>
|
||||||
<file compressed="true">gcal-edit-dialog.ui</file>
|
<file compressed="true">gcal-event-editor-dialog.ui</file>
|
||||||
<file compressed="true">gcal-multi-choice.ui</file>
|
<file compressed="true">gcal-multi-choice.ui</file>
|
||||||
<file compressed="true">gcal-time-selector.ui</file>
|
<file compressed="true">gcal-time-selector.ui</file>
|
||||||
</gresource>
|
</gresource>
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
/* gcal-edit-dialog.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2015 Erick Pérez Castellanos <erickpc@gnome.org>
|
|
||||||
*
|
|
||||||
* gnome-calendar 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 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* gnome-calendar 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GCAL_EDIT_DIALOG_H__
|
|
||||||
#define __GCAL_EDIT_DIALOG_H__
|
|
||||||
|
|
||||||
#include "gcal-event.h"
|
|
||||||
#include "gcal-manager.h"
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GCAL_RESPONSE_DELETE_EVENT 2
|
|
||||||
#define GCAL_RESPONSE_SAVE_EVENT 4
|
|
||||||
#define GCAL_RESPONSE_CREATE_EVENT 6
|
|
||||||
|
|
||||||
#define GCAL_TYPE_EDIT_DIALOG (gcal_edit_dialog_get_type ())
|
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (GcalEditDialog, gcal_edit_dialog, GCAL, EDIT_DIALOG, GtkDialog);
|
|
||||||
|
|
||||||
GtkWidget* gcal_edit_dialog_new (void);
|
|
||||||
|
|
||||||
void gcal_edit_dialog_set_event_is_new (GcalEditDialog *dialog,
|
|
||||||
gboolean event_is_new);
|
|
||||||
|
|
||||||
GcalEvent* gcal_edit_dialog_get_event (GcalEditDialog *dialog);
|
|
||||||
|
|
||||||
void gcal_edit_dialog_set_event (GcalEditDialog *dialog,
|
|
||||||
GcalEvent *event);
|
|
||||||
|
|
||||||
gboolean gcal_edit_dialog_get_recurrence_changed (GcalEditDialog *self);
|
|
||||||
|
|
||||||
GcalRecurrenceModType gcal_edit_dialog_get_recurrence_mod_type (GcalEditDialog *self);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GCAL_EDIT_DIALOG_H__ */
|
|
||||||
+152
-152
@@ -17,13 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define G_LOG_DOMAIN "GcalEditDialog"
|
#define G_LOG_DOMAIN "GcalEventEditorDialog"
|
||||||
|
|
||||||
#include "gcal-alarm-row.h"
|
#include "gcal-alarm-row.h"
|
||||||
#include "gcal-context.h"
|
#include "gcal-context.h"
|
||||||
#include "gcal-date-selector.h"
|
#include "gcal-date-selector.h"
|
||||||
#include "gcal-debug.h"
|
#include "gcal-debug.h"
|
||||||
#include "gcal-edit-dialog.h"
|
#include "gcal-event-editor-dialog.h"
|
||||||
#include "gcal-time-selector.h"
|
#include "gcal-time-selector.h"
|
||||||
#include "gcal-utils.h"
|
#include "gcal-utils.h"
|
||||||
#include "gcal-event.h"
|
#include "gcal-event.h"
|
||||||
@@ -35,17 +35,17 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gcal-edit-dialog
|
* SECTION:gcal-event-editor-dialog
|
||||||
* @short_description: Event editor dialog
|
* @short_description: Event editor dialog
|
||||||
* @title:GcalEditDialog
|
* @title:GcalEventEditorDialog
|
||||||
* @image:gcal-edit-dialog.png
|
* @image:gcal-event-editor-dialog.png
|
||||||
*
|
*
|
||||||
* #GcalEditDialog is the event editor dialog of GNOME Calendar. It
|
* #GcalEventEditorDialog is the event editor dialog of GNOME Calendar. It
|
||||||
* allows the user to change the various aspects of the events, as
|
* allows the user to change the various aspects of the events, as
|
||||||
* well as managing alarms.
|
* well as managing alarms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct _GcalEditDialog
|
struct _GcalEventEditorDialog
|
||||||
{
|
{
|
||||||
GtkDialog parent;
|
GtkDialog parent;
|
||||||
|
|
||||||
@@ -122,18 +122,18 @@ static void on_calendar_selected_action_cb (GSimpleAction
|
|||||||
GVariant *value,
|
GVariant *value,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
static void on_summary_entry_changed_cb (GtkEntry *entry,
|
static void on_summary_entry_changed_cb (GtkEntry *entry,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GcalEditDialog *self);
|
GcalEventEditorDialog *self);
|
||||||
|
|
||||||
static void on_location_entry_changed_cb (GtkEntry *entry,
|
static void on_location_entry_changed_cb (GtkEntry *entry,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GcalEditDialog *self);
|
GcalEventEditorDialog *self);
|
||||||
|
|
||||||
static void on_add_alarm_button_clicked_cb (GtkWidget *button,
|
static void on_add_alarm_button_clicked_cb (GtkWidget *button,
|
||||||
GcalEditDialog *self);
|
GcalEventEditorDialog *self);
|
||||||
|
|
||||||
G_DEFINE_TYPE (GcalEditDialog, gcal_edit_dialog, GTK_TYPE_DIALOG)
|
G_DEFINE_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, GTK_TYPE_DIALOG)
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -170,7 +170,7 @@ sources_menu_sort_func (gconstpointer a,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fill_sources_menu (GcalEditDialog *self)
|
fill_sources_menu (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_autoptr (GList) list = NULL;
|
g_autoptr (GList) list = NULL;
|
||||||
GcalManager *manager;
|
GcalManager *manager;
|
||||||
@@ -229,9 +229,9 @@ fill_sources_menu (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_best_timezones_for_event (GcalEditDialog *self,
|
find_best_timezones_for_event (GcalEventEditorDialog *self,
|
||||||
GTimeZone **out_tz_start,
|
GTimeZone **out_tz_start,
|
||||||
GTimeZone **out_tz_end)
|
GTimeZone **out_tz_end)
|
||||||
{
|
{
|
||||||
gboolean was_all_day;
|
gboolean was_all_day;
|
||||||
gboolean all_day;
|
gboolean all_day;
|
||||||
@@ -292,10 +292,10 @@ find_best_timezones_for_event (GcalEditDialog *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GDateTime*
|
static GDateTime*
|
||||||
return_datetime_for_widgets (GcalEditDialog *self,
|
return_datetime_for_widgets (GcalEventEditorDialog *self,
|
||||||
GTimeZone *timezone,
|
GTimeZone *timezone,
|
||||||
GcalDateSelector *date_selector,
|
GcalDateSelector *date_selector,
|
||||||
GcalTimeSelector *time_selector)
|
GcalTimeSelector *time_selector)
|
||||||
{
|
{
|
||||||
g_autoptr (GDateTime) date_in_local_tz = NULL;
|
g_autoptr (GDateTime) date_in_local_tz = NULL;
|
||||||
g_autoptr (GDateTime) date_in_best_tz = NULL;
|
g_autoptr (GDateTime) date_in_best_tz = NULL;
|
||||||
@@ -332,7 +332,7 @@ return_datetime_for_widgets (GcalEditDialog *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GDateTime*
|
static GDateTime*
|
||||||
get_date_start (GcalEditDialog *self)
|
get_date_start (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_autoptr (GTimeZone) start_tz = NULL;
|
g_autoptr (GTimeZone) start_tz = NULL;
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ get_date_start (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GDateTime*
|
static GDateTime*
|
||||||
get_date_end (GcalEditDialog *self)
|
get_date_end (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_autoptr (GTimeZone) end_tz = NULL;
|
g_autoptr (GTimeZone) end_tz = NULL;
|
||||||
|
|
||||||
@@ -358,8 +358,8 @@ get_date_end (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_writable (GcalEditDialog *self,
|
set_writable (GcalEventEditorDialog *self,
|
||||||
gboolean writable)
|
gboolean writable)
|
||||||
{
|
{
|
||||||
gboolean all_day;
|
gboolean all_day;
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ format_datetime_for_display (GDateTime *date,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_date_labels (GcalEditDialog *self)
|
update_date_labels (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_autofree gchar *start_label = NULL;
|
g_autofree gchar *start_label = NULL;
|
||||||
g_autofree gchar *end_label = NULL;
|
g_autofree gchar *end_label = NULL;
|
||||||
@@ -499,9 +499,9 @@ update_date_labels (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sync_datetimes (GcalEditDialog *self,
|
sync_datetimes (GcalEventEditorDialog *self,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GtkWidget *widget)
|
GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GDateTime *start, *end, *start_local, *end_local, *new_date;
|
GDateTime *start, *end, *start_local, *end_local, *new_date;
|
||||||
GtkWidget *date_widget, *time_widget;
|
GtkWidget *date_widget, *time_widget;
|
||||||
@@ -563,7 +563,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_clear_data (GcalEditDialog *self)
|
gcal_event_editor_dialog_clear_data (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
/* summary */
|
/* summary */
|
||||||
g_signal_handlers_block_by_func (self->summary_entry, on_summary_entry_changed_cb, self);
|
g_signal_handlers_block_by_func (self->summary_entry, on_summary_entry_changed_cb, self);
|
||||||
@@ -583,7 +583,7 @@ gcal_edit_dialog_clear_data (GcalEditDialog *self)
|
|||||||
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (self->notes_text)), "", -1);
|
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (self->notes_text)), "", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OFFSET(x) (G_STRUCT_OFFSET (GcalEditDialog, x))
|
#define OFFSET(x) (G_STRUCT_OFFSET (GcalEventEditorDialog, x))
|
||||||
#define WIDGET_FROM_OFFSET(x) (G_STRUCT_MEMBER (GtkWidget*, self, x))
|
#define WIDGET_FROM_OFFSET(x) (G_STRUCT_MEMBER (GtkWidget*, self, x))
|
||||||
|
|
||||||
struct
|
struct
|
||||||
@@ -602,8 +602,8 @@ struct
|
|||||||
};
|
};
|
||||||
|
|
||||||
static GtkWidget*
|
static GtkWidget*
|
||||||
get_row_for_alarm_trigger_minutes (GcalEditDialog *self,
|
get_row_for_alarm_trigger_minutes (GcalEventEditorDialog *self,
|
||||||
gint minutes)
|
gint minutes)
|
||||||
{
|
{
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
@@ -640,7 +640,7 @@ create_alarm (guint minutes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clear_alarms (GcalEditDialog *self)
|
clear_alarms (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_autoptr (GList) children = NULL;
|
g_autoptr (GList) children = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
@@ -656,7 +656,7 @@ clear_alarms (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
apply_changes_to_event (GcalEditDialog *self)
|
apply_changes_to_event (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
GcalRecurrenceFrequency freq;
|
GcalRecurrenceFrequency freq;
|
||||||
GcalRecurrence *old_recur;
|
GcalRecurrence *old_recur;
|
||||||
@@ -799,14 +799,14 @@ on_calendar_selected_action_cb (GSimpleAction *action,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_autoptr (GList) list = NULL;
|
g_autoptr (GList) list = NULL;
|
||||||
GcalEditDialog *self;
|
GcalEventEditorDialog *self;
|
||||||
GcalManager *manager;
|
GcalManager *manager;
|
||||||
GList *aux;
|
GList *aux;
|
||||||
gchar *uid;
|
gchar *uid;
|
||||||
|
|
||||||
GCAL_ENTRY;
|
GCAL_ENTRY;
|
||||||
|
|
||||||
self = GCAL_EDIT_DIALOG (user_data);
|
self = GCAL_EVENT_EDITOR_DIALOG (user_data);
|
||||||
manager = gcal_context_get_manager (self->context);
|
manager = gcal_context_get_manager (self->context);
|
||||||
list = gcal_manager_get_calendars (manager);
|
list = gcal_manager_get_calendars (manager);
|
||||||
|
|
||||||
@@ -843,7 +843,7 @@ on_calendar_selected_action_cb (GSimpleAction *action,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
transient_size_allocate_cb (GcalEditDialog *self)
|
transient_size_allocate_cb (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
GtkAllocation alloc;
|
GtkAllocation alloc;
|
||||||
GtkWindow *transient;
|
GtkWindow *transient;
|
||||||
@@ -856,17 +856,17 @@ transient_size_allocate_cb (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_location_entry_changed_cb (GtkEntry *entry,
|
on_location_entry_changed_cb (GtkEntry *entry,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
gcal_event_set_location (self->event, gtk_entry_get_text (entry));
|
gcal_event_set_location (self->event, gtk_entry_get_text (entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_summary_entry_changed_cb (GtkEntry *entry,
|
on_summary_entry_changed_cb (GtkEntry *entry,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
gtk_widget_set_sensitive (self->done_button, gtk_entry_get_text_length (entry) > 0);
|
gtk_widget_set_sensitive (self->done_button, gtk_entry_get_text_length (entry) > 0);
|
||||||
}
|
}
|
||||||
@@ -878,11 +878,11 @@ sort_alarms_func (GtkListBoxRow *a,
|
|||||||
{
|
{
|
||||||
ECalComponentAlarm *alarm_a;
|
ECalComponentAlarm *alarm_a;
|
||||||
ECalComponentAlarm *alarm_b;
|
ECalComponentAlarm *alarm_b;
|
||||||
GcalEditDialog *self;
|
GcalEventEditorDialog *self;
|
||||||
gint minutes_a;
|
gint minutes_a;
|
||||||
gint minutes_b;
|
gint minutes_b;
|
||||||
|
|
||||||
self = GCAL_EDIT_DIALOG (user_data);
|
self = GCAL_EVENT_EDITOR_DIALOG (user_data);
|
||||||
|
|
||||||
if (a == self->new_alarm_row)
|
if (a == self->new_alarm_row)
|
||||||
return 1;
|
return 1;
|
||||||
@@ -910,11 +910,11 @@ static void
|
|||||||
on_action_button_clicked_cb (GtkWidget *widget,
|
on_action_button_clicked_cb (GtkWidget *widget,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GcalEditDialog *self;
|
GcalEventEditorDialog *self;
|
||||||
|
|
||||||
GCAL_ENTRY;
|
GCAL_ENTRY;
|
||||||
|
|
||||||
self = GCAL_EDIT_DIALOG (user_data);
|
self = GCAL_EVENT_EDITOR_DIALOG (user_data);
|
||||||
|
|
||||||
if (widget == self->cancel_button || (widget == self->done_button && !self->writable))
|
if (widget == self->cancel_button || (widget == self->done_button && !self->writable))
|
||||||
{
|
{
|
||||||
@@ -961,8 +961,8 @@ on_action_button_clicked_cb (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_repeat_duration_changed_cb (GtkComboBox *widget,
|
on_repeat_duration_changed_cb (GtkComboBox *widget,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
gint active = gtk_combo_box_get_active (widget);
|
gint active = gtk_combo_box_get_active (widget);
|
||||||
|
|
||||||
@@ -971,8 +971,8 @@ on_repeat_duration_changed_cb (GtkComboBox *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_repeat_type_changed_cb (GtkComboBox *combobox,
|
on_repeat_type_changed_cb (GtkComboBox *combobox,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
GcalRecurrenceFrequency frequency;
|
GcalRecurrenceFrequency frequency;
|
||||||
|
|
||||||
@@ -983,9 +983,9 @@ on_repeat_type_changed_cb (GtkComboBox *combobox,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_all_day_switch_active_changed_cb (GtkSwitch *all_day_switch,
|
on_all_day_switch_active_changed_cb (GtkSwitch *all_day_switch,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
gboolean active = gtk_switch_get_active (all_day_switch);
|
gboolean active = gtk_switch_get_active (all_day_switch);
|
||||||
|
|
||||||
@@ -996,8 +996,8 @@ on_all_day_switch_active_changed_cb (GtkSwitch *all_day_switch,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_remove_alarm_cb (GcalAlarmRow *alarm_row,
|
on_remove_alarm_cb (GcalAlarmRow *alarm_row,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
ECalComponentAlarm *alarm;
|
ECalComponentAlarm *alarm;
|
||||||
GtkWidget *alarm_button;
|
GtkWidget *alarm_button;
|
||||||
@@ -1035,7 +1035,7 @@ on_remove_alarm_cb (GcalAlarmRow *alarm_row,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_time_format_changed_cb (GcalEditDialog *self)
|
on_time_format_changed_cb (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
GcalTimeFormat time_format;
|
GcalTimeFormat time_format;
|
||||||
|
|
||||||
@@ -1046,8 +1046,8 @@ on_time_format_changed_cb (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
create_alarm_row (GcalEditDialog *self,
|
create_alarm_row (GcalEventEditorDialog *self,
|
||||||
ECalComponentAlarm *alarm)
|
ECalComponentAlarm *alarm)
|
||||||
{
|
{
|
||||||
GtkWidget *row;
|
GtkWidget *row;
|
||||||
|
|
||||||
@@ -1058,7 +1058,7 @@ create_alarm_row (GcalEditDialog *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_alarms (GcalEditDialog *self)
|
setup_alarms (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_autoptr (GList) alarms = NULL;
|
g_autoptr (GList) alarms = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
@@ -1105,8 +1105,8 @@ setup_alarms (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_add_alarm_button_clicked_cb (GtkWidget *button,
|
on_add_alarm_button_clicked_cb (GtkWidget *button,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
ECalComponentAlarm *alarm;
|
ECalComponentAlarm *alarm;
|
||||||
GtkWidget *row;
|
GtkWidget *row;
|
||||||
@@ -1138,9 +1138,9 @@ on_add_alarm_button_clicked_cb (GtkWidget *button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_alarms_listbox_row_activated_cb (GtkListBox *alarms_listbox,
|
on_alarms_listbox_row_activated_cb (GtkListBox *alarms_listbox,
|
||||||
GtkListBoxRow *row,
|
GtkListBoxRow *row,
|
||||||
GcalEditDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
if (row == self->new_alarm_row)
|
if (row == self->new_alarm_row)
|
||||||
gtk_popover_popup (self->alarms_popover);
|
gtk_popover_popup (self->alarms_popover);
|
||||||
@@ -1152,33 +1152,33 @@ on_alarms_listbox_row_activated_cb (GtkListBox *alarms_listbox,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_finalize (GObject *object)
|
gcal_event_editor_dialog_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
GcalEditDialog *self;
|
GcalEventEditorDialog *self;
|
||||||
|
|
||||||
GCAL_ENTRY;
|
GCAL_ENTRY;
|
||||||
|
|
||||||
self = GCAL_EDIT_DIALOG (object);
|
self = GCAL_EVENT_EDITOR_DIALOG (object);
|
||||||
|
|
||||||
g_clear_pointer (&self->alarms, g_ptr_array_unref);
|
g_clear_pointer (&self->alarms, g_ptr_array_unref);
|
||||||
g_clear_object (&self->action_group);
|
g_clear_object (&self->action_group);
|
||||||
g_clear_object (&self->context);
|
g_clear_object (&self->context);
|
||||||
g_clear_object (&self->event);
|
g_clear_object (&self->event);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gcal_edit_dialog_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gcal_event_editor_dialog_parent_class)->finalize (object);
|
||||||
|
|
||||||
GCAL_EXIT;
|
GCAL_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_constructed (GObject* object)
|
gcal_event_editor_dialog_constructed (GObject* object)
|
||||||
{
|
{
|
||||||
GcalEditDialog *self;
|
GcalEventEditorDialog *self;
|
||||||
|
|
||||||
self = GCAL_EDIT_DIALOG (object);
|
self = GCAL_EVENT_EDITOR_DIALOG (object);
|
||||||
|
|
||||||
/* chaining up */
|
/* chaining up */
|
||||||
G_OBJECT_CLASS (gcal_edit_dialog_parent_class)->constructed (object);
|
G_OBJECT_CLASS (gcal_event_editor_dialog_parent_class)->constructed (object);
|
||||||
|
|
||||||
gtk_window_set_title (GTK_WINDOW (object), "");
|
gtk_window_set_title (GTK_WINDOW (object), "");
|
||||||
|
|
||||||
@@ -1205,12 +1205,12 @@ gcal_edit_dialog_constructed (GObject* object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_get_property (GObject *object,
|
gcal_event_editor_dialog_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GcalEditDialog *self = GCAL_EDIT_DIALOG (object);
|
GcalEventEditorDialog *self = GCAL_EVENT_EDITOR_DIALOG (object);
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@@ -1232,17 +1232,17 @@ gcal_edit_dialog_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_set_property (GObject *object,
|
gcal_event_editor_dialog_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GcalEditDialog *self = GCAL_EDIT_DIALOG (object);
|
GcalEventEditorDialog *self = GCAL_EVENT_EDITOR_DIALOG (object);
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_EVENT:
|
case PROP_EVENT:
|
||||||
gcal_edit_dialog_set_event (self, g_value_get_object (value));
|
gcal_event_editor_dialog_set_event (self, g_value_get_object (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_CONTEXT:
|
case PROP_CONTEXT:
|
||||||
@@ -1266,7 +1266,7 @@ gcal_edit_dialog_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
@@ -1274,13 +1274,13 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
g_type_ensure (GCAL_TYPE_DATE_SELECTOR);
|
g_type_ensure (GCAL_TYPE_DATE_SELECTOR);
|
||||||
g_type_ensure (GCAL_TYPE_TIME_SELECTOR);
|
g_type_ensure (GCAL_TYPE_TIME_SELECTOR);
|
||||||
|
|
||||||
object_class->finalize = gcal_edit_dialog_finalize;
|
object_class->finalize = gcal_event_editor_dialog_finalize;
|
||||||
object_class->constructed = gcal_edit_dialog_constructed;
|
object_class->constructed = gcal_event_editor_dialog_constructed;
|
||||||
object_class->get_property = gcal_edit_dialog_get_property;
|
object_class->get_property = gcal_event_editor_dialog_get_property;
|
||||||
object_class->set_property = gcal_edit_dialog_set_property;
|
object_class->set_property = gcal_event_editor_dialog_set_property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalEditDialog::event:
|
* GcalEventEditorDialog::event:
|
||||||
*
|
*
|
||||||
* The #GcalEvent being edited.
|
* The #GcalEvent being edited.
|
||||||
*/
|
*/
|
||||||
@@ -1291,7 +1291,7 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalEditDialog::manager:
|
* GcalEventEditorDialog::manager:
|
||||||
*
|
*
|
||||||
* The #GcalManager of the dialog.
|
* The #GcalManager of the dialog.
|
||||||
*/
|
*/
|
||||||
@@ -1302,7 +1302,7 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalEditDialog::writable:
|
* GcalEventEditorDialog::writable:
|
||||||
*
|
*
|
||||||
* Whether the current event can be edited or not.
|
* Whether the current event can be edited or not.
|
||||||
*/
|
*/
|
||||||
@@ -1314,48 +1314,48 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/event-editor/gcal-edit-dialog.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/event-editor/gcal-event-editor-dialog.ui");
|
||||||
|
|
||||||
/* Alarms */
|
/* Alarms */
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, five_minutes_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, five_minutes_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, ten_minutes_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, ten_minutes_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, thirty_minutes_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, thirty_minutes_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, one_hour_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, one_hour_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, one_day_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, one_day_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, two_days_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, two_days_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, three_days_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, three_days_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, one_week_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, one_week_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, alarms_popover);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, alarms_popover);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, new_alarm_row);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, new_alarm_row);
|
||||||
/* Buttons */
|
/* Buttons */
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, done_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, done_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, cancel_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, cancel_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, delete_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, delete_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, sources_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, sources_button);
|
||||||
/* Entries */
|
/* Entries */
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, summary_entry);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, summary_entry);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, start_time_selector);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, start_time_selector);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, start_date_selector);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, start_date_selector);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, end_time_selector);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, end_time_selector);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, end_date_selector);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, end_date_selector);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, location_entry);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, location_entry);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, event_start_label);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, event_start_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, event_end_label);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, event_end_label);
|
||||||
/* Other */
|
/* Other */
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, alarms_listbox);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, alarms_listbox);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, notes_text);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, notes_text);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, all_day_switch);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, all_day_switch);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, titlebar);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, titlebar);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, title_label);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, title_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, subtitle_label);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, subtitle_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, lock);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, lock);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, number_of_occurrences_spin);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, number_of_occurrences_spin);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, repeat_combo);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, repeat_combo);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, repeat_duration_combo);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, repeat_duration_combo);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, scrolled_window);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, scrolled_window);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, source_image);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, source_image);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, sources_popover);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, sources_popover);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, until_date_selector);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, until_date_selector);
|
||||||
|
|
||||||
|
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
@@ -1372,7 +1372,7 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_init (GcalEditDialog *self)
|
gcal_event_editor_dialog_init (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
self->alarms = g_ptr_array_new_with_free_func (e_cal_component_alarm_free);
|
self->alarms = g_ptr_array_new_with_free_func (e_cal_component_alarm_free);
|
||||||
self->writable = TRUE;
|
self->writable = TRUE;
|
||||||
@@ -1386,20 +1386,20 @@ gcal_edit_dialog_init (GcalEditDialog *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_edit_dialog_new:
|
* gcal_event_editor_dialog_new:
|
||||||
*
|
*
|
||||||
* Creates a new #GcalEditDialog
|
* Creates a new #GcalEventEditorDialog
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): a #GcalEditDialog
|
* Returns: (transfer full): a #GcalEventEditorDialog
|
||||||
*/
|
*/
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
gcal_edit_dialog_new (void)
|
gcal_event_editor_dialog_new (void)
|
||||||
{
|
{
|
||||||
return g_object_new (GCAL_TYPE_EDIT_DIALOG, NULL);
|
return g_object_new (GCAL_TYPE_EVENT_EDITOR_DIALOG, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_edit_dialog_set_event_is_new:
|
* gcal_event_editor_dialog_set_event_is_new:
|
||||||
* @dialog: a #GcalDialog
|
* @dialog: a #GcalDialog
|
||||||
* @event_is_new: %TRUE if the event is new, %FALSE otherwise
|
* @event_is_new: %TRUE if the event is new, %FALSE otherwise
|
||||||
*
|
*
|
||||||
@@ -1407,8 +1407,8 @@ gcal_edit_dialog_new (void)
|
|||||||
* The @dialog will adapt it's UI elements to reflect that.
|
* The @dialog will adapt it's UI elements to reflect that.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gcal_edit_dialog_set_event_is_new (GcalEditDialog *self,
|
gcal_event_editor_dialog_set_event_is_new (GcalEventEditorDialog *self,
|
||||||
gboolean event_is_new)
|
gboolean event_is_new)
|
||||||
{
|
{
|
||||||
self->event_is_new = event_is_new;
|
self->event_is_new = event_is_new;
|
||||||
|
|
||||||
@@ -1416,7 +1416,7 @@ gcal_edit_dialog_set_event_is_new (GcalEditDialog *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_edit_dialog_get_event:
|
* gcal_event_editor_dialog_get_event:
|
||||||
* @dialog: a #GcalDialog
|
* @dialog: a #GcalDialog
|
||||||
*
|
*
|
||||||
* Retrieves the current event being edited by the @dialog.
|
* Retrieves the current event being edited by the @dialog.
|
||||||
@@ -1424,15 +1424,15 @@ gcal_edit_dialog_set_event_is_new (GcalEditDialog *self,
|
|||||||
* Returns: (transfer none)(nullable): a #GcalEvent
|
* Returns: (transfer none)(nullable): a #GcalEvent
|
||||||
*/
|
*/
|
||||||
GcalEvent*
|
GcalEvent*
|
||||||
gcal_edit_dialog_get_event (GcalEditDialog *self)
|
gcal_event_editor_dialog_get_event (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GCAL_IS_EDIT_DIALOG (self), NULL);
|
g_return_val_if_fail (GCAL_IS_EVENT_EDITOR_DIALOG (self), NULL);
|
||||||
|
|
||||||
return self->event;
|
return self->event;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_edit_dialog_set_event:
|
* gcal_event_editor_dialog_set_event:
|
||||||
* @dialog: a #GcalDialog
|
* @dialog: a #GcalDialog
|
||||||
* @event: (nullable): a #GcalEvent
|
* @event: (nullable): a #GcalEvent
|
||||||
*
|
*
|
||||||
@@ -1440,8 +1440,8 @@ gcal_edit_dialog_get_event (GcalEditDialog *self)
|
|||||||
* %NULL, the current event information is unset.
|
* %NULL, the current event information is unset.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gcal_edit_dialog_set_event (GcalEditDialog *self,
|
gcal_event_editor_dialog_set_event (GcalEventEditorDialog *self,
|
||||||
GcalEvent *event)
|
GcalEvent *event)
|
||||||
{
|
{
|
||||||
g_autoptr (GcalEvent) cloned_event = NULL;
|
g_autoptr (GcalEvent) cloned_event = NULL;
|
||||||
GcalRecurrenceLimitType limit_type;
|
GcalRecurrenceLimitType limit_type;
|
||||||
@@ -1457,7 +1457,7 @@ gcal_edit_dialog_set_event (GcalEditDialog *self,
|
|||||||
|
|
||||||
GCAL_ENTRY;
|
GCAL_ENTRY;
|
||||||
|
|
||||||
g_return_if_fail (GCAL_IS_EDIT_DIALOG (self));
|
g_return_if_fail (GCAL_IS_EVENT_EDITOR_DIALOG (self));
|
||||||
|
|
||||||
g_clear_object (&self->event);
|
g_clear_object (&self->event);
|
||||||
|
|
||||||
@@ -1513,7 +1513,7 @@ gcal_edit_dialog_set_event (GcalEditDialog *self,
|
|||||||
calendar = gcal_event_get_calendar (cloned_event);
|
calendar = gcal_event_get_calendar (cloned_event);
|
||||||
|
|
||||||
/* Clear event data */
|
/* Clear event data */
|
||||||
gcal_edit_dialog_clear_data (self);
|
gcal_event_editor_dialog_clear_data (self);
|
||||||
|
|
||||||
/* update sources list */
|
/* update sources list */
|
||||||
if (self->sources_menu != NULL)
|
if (self->sources_menu != NULL)
|
||||||
@@ -1602,9 +1602,9 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gcal_edit_dialog_get_recurrence_changed (GcalEditDialog *self)
|
gcal_event_editor_dialog_get_recurrence_changed (GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GCAL_IS_EDIT_DIALOG (self), FALSE);
|
g_return_val_if_fail (GCAL_IS_EVENT_EDITOR_DIALOG (self), FALSE);
|
||||||
|
|
||||||
return self->recurrence_changed;
|
return self->recurrence_changed;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* gcal-event-editor-dialog.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Erick Pérez Castellanos <erickpc@gnome.org>
|
||||||
|
* 2020 Georges Basile Stavracas Neto <gbsneto@gnome.org>
|
||||||
|
*
|
||||||
|
* gnome-calendar 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 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* gnome-calendar 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "gcal-event.h"
|
||||||
|
#include "gcal-manager.h"
|
||||||
|
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GCAL_RESPONSE_DELETE_EVENT 2
|
||||||
|
#define GCAL_RESPONSE_SAVE_EVENT 4
|
||||||
|
#define GCAL_RESPONSE_CREATE_EVENT 6
|
||||||
|
|
||||||
|
#define GCAL_TYPE_EVENT_EDITOR_DIALOG (gcal_event_editor_dialog_get_type ())
|
||||||
|
G_DECLARE_FINAL_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, GCAL, EVENT_EDITOR_DIALOG, GtkDialog);
|
||||||
|
|
||||||
|
GtkWidget* gcal_event_editor_dialog_new (void);
|
||||||
|
|
||||||
|
void gcal_event_editor_dialog_set_event_is_new (GcalEventEditorDialog *dialog,
|
||||||
|
gboolean event_is_new);
|
||||||
|
|
||||||
|
GcalEvent* gcal_event_editor_dialog_get_event (GcalEventEditorDialog *self);
|
||||||
|
|
||||||
|
void gcal_event_editor_dialog_set_event (GcalEventEditorDialog *self,
|
||||||
|
GcalEvent *event);
|
||||||
|
|
||||||
|
gboolean gcal_event_editor_dialog_get_recurrence_changed (GcalEventEditorDialog *self);
|
||||||
|
|
||||||
|
GcalRecurrenceModType gcal_event_editor_dialog_get_recurrence_mod_type (GcalEventEditorDialog *self);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
+37
-37
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<template class="GcalEditDialog" parent="GtkDialog">
|
<template class="GcalEventEditorDialog" parent="GtkDialog">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="resizable">False</property>
|
<property name="resizable">False</property>
|
||||||
<property name="modal">True</property>
|
<property name="modal">True</property>
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
<property name="label" translatable="yes">Cancel</property>
|
<property name="label" translatable="yes">Cancel</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="lock">
|
<object class="GtkImage" id="lock">
|
||||||
<property name="visible" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default|invert-boolean" />
|
<property name="visible" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|invert-boolean" />
|
||||||
<property name="icon_name">changes-prevent-symbolic</property>
|
<property name="icon_name">changes-prevent-symbolic</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="popover">sources_popover</property>
|
<property name="popover">sources_popover</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<property name="tooltip-text" translatable="yes">Click to select the calendar</property>
|
<property name="tooltip-text" translatable="yes">Click to select the calendar</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="flat"/>
|
<class name="flat"/>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
<style>
|
<style>
|
||||||
<class name="suggested-action"/>
|
<class name="suggested-action"/>
|
||||||
</style>
|
</style>
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
<object class="GtkListBox">
|
<object class="GtkListBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="selection-mode">none</property>
|
<property name="selection-mode">none</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
<class name="frame" />
|
<class name="frame" />
|
||||||
@@ -161,9 +161,9 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="editable" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="editable" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<signal name="notify::text" handler="on_summary_entry_changed_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="notify::text" handler="on_summary_entry_changed_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -183,9 +183,9 @@
|
|||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="secondary_icon_name">find-location-symbolic</property>
|
<property name="secondary_icon_name">find-location-symbolic</property>
|
||||||
<property name="editable" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="editable" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<signal name="notify::text" handler="on_location_entry_changed_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="notify::text" handler="on_location_entry_changed_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
<object class="GtkListBox">
|
<object class="GtkListBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="selection-mode">none</property>
|
<property name="selection-mode">none</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
<class name="frame" />
|
<class name="frame" />
|
||||||
@@ -232,8 +232,8 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<signal name="notify::active" handler="on_all_day_switch_active_changed_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="notify::active" handler="on_all_day_switch_active_changed_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="input-hints">no-emoji</property>
|
<property name="input-hints">no-emoji</property>
|
||||||
<signal name="notify::date" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
<signal name="notify::date" handler="sync_datetimes" object="GcalEventEditorDialog" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
<object class="GcalTimeSelector" id="start_time_selector">
|
<object class="GcalTimeSelector" id="start_time_selector">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
<signal name="notify::time" handler="sync_datetimes" object="GcalEventEditorDialog" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="input-hints">no-emoji</property>
|
<property name="input-hints">no-emoji</property>
|
||||||
<signal name="notify::date" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
<signal name="notify::date" handler="sync_datetimes" object="GcalEventEditorDialog" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@
|
|||||||
<object class="GcalTimeSelector" id="end_time_selector">
|
<object class="GcalTimeSelector" id="end_time_selector">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
<signal name="notify::time" handler="sync_datetimes" object="GcalEventEditorDialog" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
@@ -348,8 +348,8 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<signal name="changed" handler="on_repeat_type_changed_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="changed" handler="on_repeat_type_changed_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<items>
|
<items>
|
||||||
<item translatable="yes" id="no_repeat">No Repeat</item>
|
<item translatable="yes" id="no_repeat">No Repeat</item>
|
||||||
<item translatable="yes" id="daily">Daily</item>
|
<item translatable="yes" id="daily">Daily</item>
|
||||||
@@ -377,7 +377,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<signal name="changed" handler="on_repeat_duration_changed_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="changed" handler="on_repeat_duration_changed_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
<items>
|
<items>
|
||||||
<item translatable="yes" id="forever">Forever</item>
|
<item translatable="yes" id="forever">Forever</item>
|
||||||
<item translatable="yes" id="number_of_occurrences_spin">No. of occurrences</item>
|
<item translatable="yes" id="number_of_occurrences_spin">No. of occurrences</item>
|
||||||
@@ -457,13 +457,13 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="selection_mode">none</property>
|
<property name="selection_mode">none</property>
|
||||||
<signal name="row-activated" handler="on_alarms_listbox_row_activated_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="row-activated" handler="on_alarms_listbox_row_activated_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBoxRow" id="new_alarm_row">
|
<object class="GtkListBoxRow" id="new_alarm_row">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
@@ -516,8 +516,8 @@
|
|||||||
<property name="left_margin">6</property>
|
<property name="left_margin">6</property>
|
||||||
<property name="right_margin">6</property>
|
<property name="right_margin">6</property>
|
||||||
<property name="sensitive">True</property>
|
<property name="sensitive">True</property>
|
||||||
<property name="editable" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="editable" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<property name="cursor_visible" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="cursor_visible" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
|
<property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
@@ -531,8 +531,8 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEditDialog" swapped="no"/>
|
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="delete_label">
|
<object class="GtkLabel" id="delete_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -571,7 +571,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">5 minutes</property>
|
<property name="text" translatable="yes">5 minutes</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -580,7 +580,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">10 minutes</property>
|
<property name="text" translatable="yes">10 minutes</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -589,7 +589,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">30 minutes</property>
|
<property name="text" translatable="yes">30 minutes</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -598,7 +598,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">1 hour</property>
|
<property name="text" translatable="yes">1 hour</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -606,7 +606,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="text" translatable="yes">1 day</property>
|
<property name="text" translatable="yes">1 day</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -615,7 +615,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">2 days</property>
|
<property name="text" translatable="yes">2 days</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -624,7 +624,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">3 days</property>
|
<property name="text" translatable="yes">3 days</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -633,7 +633,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="text" translatable="yes">1 week</property>
|
<property name="text" translatable="yes">1 week</property>
|
||||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEditDialog" swapped="no" />
|
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalEventEditorDialog" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -11,7 +11,7 @@ sources += files(
|
|||||||
'gcal-date-chooser.c',
|
'gcal-date-chooser.c',
|
||||||
'gcal-date-chooser-day.c',
|
'gcal-date-chooser-day.c',
|
||||||
'gcal-date-selector.c',
|
'gcal-date-selector.c',
|
||||||
'gcal-edit-dialog.c',
|
'gcal-event-editor-dialog.c',
|
||||||
'gcal-multi-choice.c',
|
'gcal-multi-choice.c',
|
||||||
'gcal-time-selector.c',
|
'gcal-time-selector.c',
|
||||||
)
|
)
|
||||||
|
|||||||
+24
-24
@@ -23,7 +23,7 @@
|
|||||||
#include "gcal-calendar-popover.h"
|
#include "gcal-calendar-popover.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gcal-debug.h"
|
#include "gcal-debug.h"
|
||||||
#include "gcal-edit-dialog.h"
|
#include "gcal-event-editor-dialog.h"
|
||||||
#include "gcal-event-widget.h"
|
#include "gcal-event-widget.h"
|
||||||
#include "gcal-context.h"
|
#include "gcal-context.h"
|
||||||
#include "gcal-manager.h"
|
#include "gcal-manager.h"
|
||||||
@@ -59,10 +59,10 @@
|
|||||||
* ## Edit dialog
|
* ## Edit dialog
|
||||||
*
|
*
|
||||||
* When an event is clicked, the views send the `event-activated`
|
* When an event is clicked, the views send the `event-activated`
|
||||||
* signal. #GcalWindow responds to this signal opening #GcalEditDialog
|
* signal. #GcalWindow responds to this signal opening #GcalEventEditorDialog
|
||||||
* with the clicked event.
|
* with the clicked event.
|
||||||
*
|
*
|
||||||
* When #GcalEditDialog sends a response, #GcalWindow reacts by
|
* When #GcalEventEditorDialog sends a response, #GcalWindow reacts by
|
||||||
* either propagating to gcal_manager_update_event(), or hiding
|
* either propagating to gcal_manager_update_event(), or hiding
|
||||||
* the delete event widgets from the views.
|
* the delete event widgets from the views.
|
||||||
*
|
*
|
||||||
@@ -122,7 +122,7 @@ struct _GcalWindow
|
|||||||
|
|
||||||
/* day, week, month, year, list */
|
/* day, week, month, year, list */
|
||||||
GtkWidget *views [6];
|
GtkWidget *views [6];
|
||||||
GtkWidget *edit_dialog;
|
GtkWidget *event_editor;
|
||||||
gboolean subscribed;
|
gboolean subscribed;
|
||||||
|
|
||||||
GcalContext *context;
|
GcalContext *context;
|
||||||
@@ -392,10 +392,10 @@ on_window_new_event_cb (GSimpleAction *action,
|
|||||||
default_calendar = gcal_manager_get_default_calendar (manager);
|
default_calendar = gcal_manager_get_default_calendar (manager);
|
||||||
event = gcal_event_new (default_calendar, comp, NULL);
|
event = gcal_event_new (default_calendar, comp, NULL);
|
||||||
|
|
||||||
gcal_edit_dialog_set_event_is_new (GCAL_EDIT_DIALOG (self->edit_dialog), TRUE);
|
gcal_event_editor_dialog_set_event_is_new (GCAL_EVENT_EDITOR_DIALOG (self->event_editor), TRUE);
|
||||||
gcal_edit_dialog_set_event (GCAL_EDIT_DIALOG (self->edit_dialog), event);
|
gcal_event_editor_dialog_set_event (GCAL_EVENT_EDITOR_DIALOG (self->event_editor), event);
|
||||||
|
|
||||||
gtk_widget_show (self->edit_dialog);
|
gtk_widget_show (self->event_editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -610,10 +610,10 @@ edit_event (GcalQuickAddPopover *popover,
|
|||||||
GcalEvent *event,
|
GcalEvent *event,
|
||||||
GcalWindow *window)
|
GcalWindow *window)
|
||||||
{
|
{
|
||||||
gcal_edit_dialog_set_event_is_new (GCAL_EDIT_DIALOG (window->edit_dialog), TRUE);
|
gcal_event_editor_dialog_set_event_is_new (GCAL_EVENT_EDITOR_DIALOG (window->event_editor), TRUE);
|
||||||
gcal_edit_dialog_set_event (GCAL_EDIT_DIALOG (window->edit_dialog), event);
|
gcal_event_editor_dialog_set_event (GCAL_EVENT_EDITOR_DIALOG (window->event_editor), event);
|
||||||
|
|
||||||
gtk_widget_show (window->edit_dialog);
|
gtk_widget_show (window->event_editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -633,10 +633,10 @@ create_event_detailed_cb (GcalView *view,
|
|||||||
default_calendar = gcal_manager_get_default_calendar (manager);
|
default_calendar = gcal_manager_get_default_calendar (manager);
|
||||||
event = gcal_event_new (default_calendar, comp, NULL);
|
event = gcal_event_new (default_calendar, comp, NULL);
|
||||||
|
|
||||||
gcal_edit_dialog_set_event_is_new (GCAL_EDIT_DIALOG (window->edit_dialog), TRUE);
|
gcal_event_editor_dialog_set_event_is_new (GCAL_EVENT_EDITOR_DIALOG (window->event_editor), TRUE);
|
||||||
gcal_edit_dialog_set_event (GCAL_EDIT_DIALOG (window->edit_dialog), event);
|
gcal_event_editor_dialog_set_event (GCAL_EVENT_EDITOR_DIALOG (window->event_editor), event);
|
||||||
|
|
||||||
gtk_widget_show (window->edit_dialog);
|
gtk_widget_show (window->event_editor);
|
||||||
|
|
||||||
g_clear_object (&comp);
|
g_clear_object (&comp);
|
||||||
}
|
}
|
||||||
@@ -650,10 +650,10 @@ event_activated (GcalView *view,
|
|||||||
GcalEvent *event;
|
GcalEvent *event;
|
||||||
|
|
||||||
event = gcal_event_widget_get_event (event_widget);
|
event = gcal_event_widget_get_event (event_widget);
|
||||||
gcal_edit_dialog_set_event_is_new (GCAL_EDIT_DIALOG (window->edit_dialog), FALSE);
|
gcal_event_editor_dialog_set_event_is_new (GCAL_EVENT_EDITOR_DIALOG (window->event_editor), FALSE);
|
||||||
gcal_edit_dialog_set_event (GCAL_EDIT_DIALOG (window->edit_dialog), event);
|
gcal_event_editor_dialog_set_event (GCAL_EVENT_EDITOR_DIALOG (window->event_editor), event);
|
||||||
|
|
||||||
gtk_widget_show (window->edit_dialog);
|
gtk_widget_show (window->event_editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -661,11 +661,11 @@ edit_dialog_closed (GtkDialog *dialog,
|
|||||||
gint response,
|
gint response,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
GcalEventEditorDialog *edit_dialog;
|
||||||
GcalRecurrenceModType mod;
|
GcalRecurrenceModType mod;
|
||||||
GcalCalendar *calendar;
|
GcalCalendar *calendar;
|
||||||
GcalManager *manager;
|
GcalManager *manager;
|
||||||
GcalWindow *window;
|
GcalWindow *window;
|
||||||
GcalEditDialog *edit_dialog;
|
|
||||||
GcalEvent *event;
|
GcalEvent *event;
|
||||||
GcalView *view;
|
GcalView *view;
|
||||||
GList *widgets;
|
GList *widgets;
|
||||||
@@ -674,13 +674,13 @@ edit_dialog_closed (GtkDialog *dialog,
|
|||||||
|
|
||||||
window = GCAL_WINDOW (user_data);
|
window = GCAL_WINDOW (user_data);
|
||||||
manager = gcal_context_get_manager (window->context);
|
manager = gcal_context_get_manager (window->context);
|
||||||
edit_dialog = GCAL_EDIT_DIALOG (dialog);
|
edit_dialog = GCAL_EVENT_EDITOR_DIALOG (dialog);
|
||||||
event = gcal_edit_dialog_get_event (edit_dialog);
|
event = gcal_event_editor_dialog_get_event (edit_dialog);
|
||||||
view = GCAL_VIEW (window->views[window->active_view]);
|
view = GCAL_VIEW (window->views[window->active_view]);
|
||||||
mod = GCAL_RECURRENCE_MOD_THIS_ONLY;
|
mod = GCAL_RECURRENCE_MOD_THIS_ONLY;
|
||||||
calendar = gcal_event_get_calendar (event);
|
calendar = gcal_event_get_calendar (event);
|
||||||
|
|
||||||
if (!gcal_edit_dialog_get_recurrence_changed (edit_dialog) &&
|
if (!gcal_event_editor_dialog_get_recurrence_changed (edit_dialog) &&
|
||||||
gcal_event_has_recurrence (event) &&
|
gcal_event_has_recurrence (event) &&
|
||||||
(response != GCAL_RESPONSE_CREATE_EVENT &&
|
(response != GCAL_RESPONSE_CREATE_EVENT &&
|
||||||
response != GTK_RESPONSE_CANCEL &&
|
response != GTK_RESPONSE_CANCEL &&
|
||||||
@@ -741,7 +741,7 @@ edit_dialog_closed (GtkDialog *dialog,
|
|||||||
|
|
||||||
gtk_widget_hide (GTK_WIDGET (dialog));
|
gtk_widget_hide (GTK_WIDGET (dialog));
|
||||||
|
|
||||||
gcal_edit_dialog_set_event (edit_dialog, NULL);
|
gcal_event_editor_dialog_set_event (edit_dialog, NULL);
|
||||||
|
|
||||||
GCAL_EXIT;
|
GCAL_EXIT;
|
||||||
}
|
}
|
||||||
@@ -880,7 +880,7 @@ gcal_window_constructed (GObject *object)
|
|||||||
g_object_bind_property (self, "context", self->week_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->week_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->month_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->month_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->year_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->year_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->edit_dialog, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->event_editor, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->quick_add_popover, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->quick_add_popover, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->search_button, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->search_button, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
@@ -1009,7 +1009,7 @@ gcal_window_class_init (GcalWindowClass *klass)
|
|||||||
|
|
||||||
g_type_ensure (GCAL_TYPE_CALENDAR_MANAGEMENT_DIALOG);
|
g_type_ensure (GCAL_TYPE_CALENDAR_MANAGEMENT_DIALOG);
|
||||||
g_type_ensure (GCAL_TYPE_CALENDAR_POPOVER);
|
g_type_ensure (GCAL_TYPE_CALENDAR_POPOVER);
|
||||||
g_type_ensure (GCAL_TYPE_EDIT_DIALOG);
|
g_type_ensure (GCAL_TYPE_EVENT_EDITOR_DIALOG);
|
||||||
g_type_ensure (GCAL_TYPE_MANAGER);
|
g_type_ensure (GCAL_TYPE_MANAGER);
|
||||||
g_type_ensure (GCAL_TYPE_MONTH_VIEW);
|
g_type_ensure (GCAL_TYPE_MONTH_VIEW);
|
||||||
g_type_ensure (GCAL_TYPE_QUICK_ADD_POPOVER);
|
g_type_ensure (GCAL_TYPE_QUICK_ADD_POPOVER);
|
||||||
@@ -1062,7 +1062,7 @@ gcal_window_class_init (GcalWindowClass *klass)
|
|||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, back_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, back_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, calendars_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, calendars_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, calendar_popover);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, calendar_popover);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, edit_dialog);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, event_editor);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, forward_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, forward_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, header_bar);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, header_bar);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, main_box);
|
gtk_widget_class_bind_template_child (widget_class, GcalWindow, main_box);
|
||||||
|
|||||||
@@ -296,7 +296,7 @@
|
|||||||
<property name="transient_for">GcalWindow</property>
|
<property name="transient_for">GcalWindow</property>
|
||||||
<signal name="delete-event" handler="gtk_widget_hide_on_delete" object="GcalWindow" swapped="no" />
|
<signal name="delete-event" handler="gtk_widget_hide_on_delete" object="GcalWindow" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
<object class="GcalEditDialog" id="edit_dialog">
|
<object class="GcalEventEditorDialog" id="event_editor">
|
||||||
<property name="visible">False</property>
|
<property name="visible">False</property>
|
||||||
<property name="transient_for">GcalWindow</property>
|
<property name="transient_for">GcalWindow</property>
|
||||||
<signal name="response" handler="edit_dialog_closed" object="GcalWindow" swapped="no"/>
|
<signal name="response" handler="edit_dialog_closed" object="GcalWindow" swapped="no"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user