[gnome-calendar/gbsneto/recurring-event-editing-fixes: 5/18] utils: Add boolean flag for showing MOD_ALL
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gbsneto/recurring-event-editing-fixes: 5/18] utils: Add boolean flag for showing MOD_ALL
- Date: Mon, 17 Oct 2022 19:43:03 +0000 (UTC)
commit e7392750173190f017bdebc0dcda725dd559a804
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Oct 14 11:33:46 2022 -0300
utils: Add boolean flag for showing MOD_ALL
This will be used by next commit to more finely control editing
of recurrent events.
src/gui/event-editor/gcal-event-editor-dialog.c | 2 ++
src/gui/views/gcal-month-cell.c | 1 +
src/gui/views/gcal-week-grid.c | 1 +
src/gui/views/gcal-week-header.c | 1 +
src/utils/gcal-utils.c | 5 ++++-
src/utils/gcal-utils.h | 1 +
6 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c
index 608dc162..53aa3605 100644
--- a/src/gui/event-editor/gcal-event-editor-dialog.c
+++ b/src/gui/event-editor/gcal-event-editor-dialog.c
@@ -291,6 +291,7 @@ on_delete_button_clicked_cb (GtkButton *button,
{
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
self->event,
+ TRUE,
on_ask_recurrence_response_delete_cb,
self);
}
@@ -362,6 +363,7 @@ on_done_button_clicked_cb (GtkButton *button,
{
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
self->event,
+ TRUE,
on_ask_recurrence_response_save_cb,
self);
return;
diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c
index c0abdef5..14a75d20 100644
--- a/src/gui/views/gcal-month-cell.c
+++ b/src/gui/views/gcal-month-cell.c
@@ -215,6 +215,7 @@ on_drop_target_drop_cb (GtkDropTarget *drop_target,
{
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
event,
+ TRUE,
on_ask_recurrence_response_cb,
self);
}
diff --git a/src/gui/views/gcal-week-grid.c b/src/gui/views/gcal-week-grid.c
index 45cd2e9c..5f731032 100644
--- a/src/gui/views/gcal-week-grid.c
+++ b/src/gui/views/gcal-week-grid.c
@@ -442,6 +442,7 @@ on_drop_target_drop_cb (GtkDropTarget *drop_target,
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
event,
+ TRUE,
on_ask_recurrence_response_cb,
data);
}
diff --git a/src/gui/views/gcal-week-header.c b/src/gui/views/gcal-week-header.c
index 00a0b4f6..7aa6cd4c 100644
--- a/src/gui/views/gcal-week-header.c
+++ b/src/gui/views/gcal-week-header.c
@@ -1283,6 +1283,7 @@ on_drop_target_drop_cb (GtkDropTarget *drop_target,
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
event,
+ TRUE,
on_ask_recurrence_response_cb,
data);
}
diff --git a/src/utils/gcal-utils.c b/src/utils/gcal-utils.c
index 2b9f26f3..23afd1a5 100644
--- a/src/utils/gcal-utils.c
+++ b/src/utils/gcal-utils.c
@@ -1298,6 +1298,7 @@ on_message_dialog_response_cb (GtkDialog *dialog,
void
gcal_utils_ask_recurrence_modification_type (GtkWidget *parent,
GcalEvent *event,
+ gboolean show_mod_all,
GcalAskRecurrenceCallback callback,
gpointer user_data)
{
@@ -1331,7 +1332,9 @@ gcal_utils_ask_recurrence_modification_type (GtkWidget *parent,
if (!e_client_check_capability (E_CLIENT (client), E_CAL_STATIC_CAPABILITY_NO_THISANDFUTURE))
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Subsequent events"), GTK_RESPONSE_OK);
- gtk_dialog_add_button (GTK_DIALOG (dialog), _("_All events"), GTK_RESPONSE_YES);
+ if (show_mod_all)
+ gtk_dialog_add_button (GTK_DIALOG (dialog), _("_All events"), GTK_RESPONSE_YES);
+
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (gtk_widget_get_native (parent)));
g_signal_connect (dialog, "response", G_CALLBACK (on_message_dialog_response_cb), data);
diff --git a/src/utils/gcal-utils.h b/src/utils/gcal-utils.h
index 11392be1..e80624aa 100644
--- a/src/utils/gcal-utils.h
+++ b/src/utils/gcal-utils.h
@@ -132,6 +132,7 @@ void gcal_utils_extract_google_section (const gchar
void gcal_utils_ask_recurrence_modification_type (GtkWidget *parent,
GcalEvent *event,
+ gboolean show_mod_all,
GcalAskRecurrenceCallback callback,
gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]