Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distinguish Other type in AlarmObject #2

Closed
wants to merge 1 commit into from

Conversation

jmlich
Copy link
Contributor

@jmlich jmlich commented Jun 1, 2022

I have some Type=wakeup cookies in timed. I would like to distinguish when showing alarm

jmlich@manajro-virt:~/workspace/nemo-qml-plugin-alarms/src (master =)$ timedclient-qt5 -i
Cookie 213
  APPLICATION = 'nemoalarms'
  TITLE = 'Alarm'
  createdDate = '1654001594719'
  daysOfWeek = 'mtwTfsS'
  timeOfDayWithSeconds = '53640'
  type = 'clock'
  Tick: 0 (inactive)
  Time: 0000-00-00 00:00 
Cookie 218
  APPLICATION = 'wakup_alarm'
  type = 'wakeup'
  Tick: 0 (inactive)
  Time: 0000-00-00 00:00 

@pvuorela
Copy link
Contributor

pvuorela commented Jun 1, 2022

Not sure I follow, is this some sort of alternative clock alarm? What's consuming the new value? On the type API it feels a bit strange now, not sure how to interpret such a new thing. Not documented either on the type property.

@jmlich
Copy link
Contributor Author

jmlich commented Jun 1, 2022

Yes, I have alternative implementations here:
https://github.com/nemomobile-ux/glacier-alarmclock
https://github.com/nemomobile-ux/glacier-alarm-listener

It seems the key=type is not used for most of event types in nemo-qml-plugin-alarms. I tried to propose minimal change in order to not affect your cases.

@pvuorela
Copy link
Contributor

pvuorela commented Jun 1, 2022

If this is an alternative alarm ui, why can't it just use the clock type too?

@jmlich
Copy link
Contributor Author

jmlich commented Jun 1, 2022

Because the Clock is returned for all other cases:
https://github.com/sailfishos/nemo-qml-plugin-alarms/blob/master/src/alarmobject.cpp#L367

I can update the code to distinguish Clock type properly, such as

int AlarmObject::type() const
{
    if (m_reminder)
        return Reminder;
    else if (m_startDate.isValid() && m_endDate.isValid())
        return Calendar;
    else if (m_countdown)
        return Countdown;
-    else
-        return Clock;
+    else if (m_clock)
+        return Clock;
+    else 
+        return Other;
}

@pvuorela
Copy link
Contributor

pvuorela commented Jun 2, 2022

The detection of clock vs other sounds already more sensible. But still I'm a bit puzzled by the need. On Sailfish side the existing api and behavior is already enough for jolla-clock and jolla-alarm-ui for creating and showing alarms.

@jmlich
Copy link
Contributor Author

jmlich commented Jun 17, 2022

With current implementation it is possible to distinguish Reminder, Calendar, Countdown, and Clock events, but not other types of events. I am still not sure from where the WakeUp event comes from. Maybe is covered by act.dead service?

@pvuorela
Copy link
Contributor

Ah, ok. I thought this was just some other name for a clock alarm. But suppose if the source isn't even known there's no need to actually detect the wakeup event type but more like avoiding them to be detected as something else. If so, the "Other" type in the api should be indeed better.

Then again wondering how the 'other' type of events get into the alarm model. For what I can tell alarmsbackendmodel_p.cpp / AlarmsBackendModelPriv::populate() only fetches events created by nemoalarms and the example should not be included?

@jmlich jmlich changed the title distinguish wakeup type in AlarmObject distinguish Other type in AlarmObject Jun 24, 2022
@pvuorela
Copy link
Contributor

The last question still applies. With the name app name filtering, I'm still not following how there could be Timed events that fall into "Other".

@pvuorela
Copy link
Contributor

No activity, and by the last comments I don't understand what's the whole scenario.

@pvuorela pvuorela closed this Jan 11, 2023
@jmlich
Copy link
Contributor Author

jmlich commented Jan 12, 2023

Thanks for feedback. I need yet more time to describe the use case clear. Currently, I am using fork, so it isn't show stopper for me ;-) Eventually, I will open new request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants