Skip to content

Commit

Permalink
AlarmDialog: Use ngfd to vibrate on an alarm event
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentRevest committed May 14, 2017
1 parent 729d299 commit a92a8ba
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions AlarmDialog.qml
Expand Up @@ -17,12 +17,13 @@
*/

import QtQuick 2.0
import QtFeedback 5.0
import org.asteroid.controls 1.0
import org.nemomobile.ngf 1.0
import org.nemomobile.dbus 1.0

Rectangle {
id: alarmDialogRoot
property var pop
property var alarmObject
color: "black"

Expand Down Expand Up @@ -63,7 +64,10 @@ Rectangle {
}
}
}
alarmObject.dismiss();
feedback.stop()
alarmObject.dismiss()
alarmTimeField.text = ""
alarmDialogRoot.pop()
}
}

Expand All @@ -79,27 +83,17 @@ Rectangle {
right: parent.right
}

onClicked: alarmObject.snooze();
}

ThemeEffect {
id: haptics
effect: "PressStrong"
onClicked: {
feedback.stop()
alarmObject.snooze()
alarmTimeField.text = ""
alarmDialogRoot.pop()
}
}

Timer {
property int repetition: 0
id: vibration
interval: 3000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {
if(repetition < 10) {
repetition=repetition+1
haptics.play()
} else stop()
}
NonGraphicalFeedback {
id: feedback
event: "clock"
}

property DBusInterface _dbus: DBusInterface {
Expand All @@ -115,5 +109,6 @@ Rectangle {
Component.onCompleted: {
dbus.call("req_display_state_on", undefined)
window.raise()
feedback.play()
}
}

0 comments on commit a92a8ba

Please sign in to comment.