[gnome-shell/wip/fmuellner/unclosable-events: 19/21] calendar: Don't allow event messages to be closed



commit 3e3da8e2f89280bb4ebea31b6f03cfe32aae8cb8
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Dec 17 18:36:03 2018 +0100

    calendar: Don't allow event messages to be closed
    
    The built-in calendar isn't meant to replace a full-fledged calendar
    app, which is why clearing event messages only hides the event in
    gnome-shell rather than deleting the actual event. This has turned out
    to not be overly useful and often confusing - it creates a discrepancy
    with visible events in apps, isn't revertible in a non-obscure fashion
    and non-obviously limited to the current date.
    
    As we are considering moving events out of the message list and back to
    the calendar, it looks like a good time to remove that ability and keep
    notifications as the only removable messages.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/262

 js/ui/calendar.js    | 15 ++++-----------
 js/ui/messageList.js |  2 +-
 2 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index dfe1bb948..7ff98dfcf 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -754,10 +754,6 @@ var EventMessage = new Lang.Class({
                 title = title + ELLIPSIS_CHAR;
         }
         return title;
-    },
-
-    canClose() {
-        return isToday(this._date);
     }
 });
 
@@ -820,6 +816,10 @@ var NotificationMessage = new Lang.Class({
         if (this._destroyId)
             this.notification.disconnect(this._destroyId);
         this._destroyId = 0;
+    },
+
+    canClose() {
+        return true;
     }
 });
 
@@ -850,10 +850,6 @@ var EventsSection = new Lang.Class({
         this._appInstalledChanged();
     },
 
-    _ignoreEvent(event) {
-        this._eventSource.ignoreEvent(event);
-    },
-
     setEventSource(eventSource) {
         this._eventSource = eventSource;
         this._eventSource.connect('changed', this._reloadEvents.bind(this));
@@ -906,9 +902,6 @@ var EventsSection = new Lang.Class({
             let message = this._messageById.get(event.id);
             if (!message) {
                 message = new EventMessage(event, this._date);
-                message.connect('close', () => {
-                    this._ignoreEvent(event);
-                });
                 this._messageById.set(event.id, message);
                 this.addMessage(message, false);
             } else {
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index 547135a1f..32b8e18b8 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -498,7 +498,7 @@ var Message = new Lang.Class({
     },
 
     canClose() {
-        return this._mediaControls.get_n_children() == 0;
+        return false;
     },
 
     _sync() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]