~fabrixxm/confy

dd0a9ad169df80d1b02b2f4376c16e2d996fbc8c — fabrixxm 7 months ago 0cc712a
Present window when user clicks notification action
1 files changed, 3 insertions(+), 1 deletions(-)

M src/mainwindow.py
M src/mainwindow.py => src/mainwindow.py +3 -1
@@ 1,3 1,4 @@
from time import time
from gi.repository import Gio
from gi.repository import GObject
from gi.repository import Gtk


@@ 126,10 127,11 @@ class MainWindow(Adw.ApplicationWindow):
    def on_notification_action(self, notification, action, data):
        print(notification, action, data)
        if action == "view" and data.startswith("nextup-"):
            self.present_with_time(time())
            eventid = int(data.split("-")[1])
            event = models.Event.by_id(eventid)
            # if we are not on "events" subpage, force it as non navigatable,
            # we want to be back to we were
            # we want to be back to where we were
            print(self.subpage_leaflet.get_visible_child(), self.subpage_events)
            can_we_go_back_to_events = self.subpage_leaflet.get_visible_child() == self.subpage_events
            self.show_details(event, can_we_go_back_to_events)