phosh-arch/gnome-clocks-mobile/0005-alarm-remove-edit-property.patch
2024-08-13 08:17:11 -07:00

64 lines
2.4 KiB
Diff

From 329dcc1fdc1b620228457fe1544b62661698a044 Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Mon, 16 Nov 2020 11:36:29 +0100
Subject: [PATCH 05/16] alarm: remove edit property
---
src/alarm-face.vala | 8 --------
src/alarm-item.vala | 5 +++--
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/alarm-face.vala b/src/alarm-face.vala
index cf9a592..9cf1207 100644
--- a/src/alarm-face.vala
+++ b/src/alarm-face.vala
@@ -110,11 +110,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
internal void edit (Item alarm) {
var dialog = new SetupDialog ((Gtk.Window) get_toplevel (), alarm, alarms, true);
- // Disable alarm while editing it and remember the original active state.
- alarm.editing = true;
-
dialog.response.connect ((dialog, response) => {
- alarm.editing = false;
if (response == Gtk.ResponseType.OK) {
((SetupDialog) dialog).apply_to_alarm ();
save ();
@@ -141,11 +137,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
var alarm = new Item ({ wc.date_time.get_hour (), wc.date_time.get_minute () }, false);
var dialog = new SetupDialog ((Gtk.Window) get_toplevel (), alarm, alarms);
- // Disable alarm while editing it and remember the original active state.
- alarm.editing = true;
-
dialog.response.connect ((dialog, response) => {
- alarm.editing = false;
// Enable the newly created alarm
alarm.active = true;
if (response == Gtk.ResponseType.OK) {
diff --git a/src/alarm-item.vala b/src/alarm-item.vala
index 26f655f..9febf63 100644
--- a/src/alarm-item.vala
+++ b/src/alarm-item.vala
@@ -34,7 +34,8 @@ private class Item : Object, ContentItem {
SNOOZING
}
- public bool editing { get; set; default = false; }
+ // Missed can't be a state because we couldn't scheduale next alarms without override missed
+ public bool missed { get; set; default = false; }
public string id { get; construct set; }
@@ -184,7 +185,7 @@ private class Item : Object, ContentItem {
}
private bool compare_with_item (Item i) {
- return (this.alarm_time.compare (i.alarm_time) == 0 && (this.active || this.editing) && i.active);
+ return (this.time.compare (i.time) == 0);
}
public bool check_duplicate_alarm (List<Item> alarms) {
--
2.34.1