2
* This file is part of system-settings
4
* Copyright (C) 2013-2014 Canonical Ltd.
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 3, as published
8
* by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranties of
12
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
* PURPOSE. See the GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License along
16
* with this program. If not, see <http://www.gnu.org/licenses/>.
20
import Ubuntu.Components 1.3
21
import Ubuntu.SystemSettings.Notifications 1.0
22
import SystemSettings 1.0
25
id: appsVibrationsNotifyPage
26
objectName: "appsVibrationsNotifyPage"
28
property alias model: appsVibrationsNotifyList.model
30
title: i18n.tr("Vibration")
33
id: appsVibrationsNotifyList
34
objectName: "appsVibrationsNotifyList"
44
contentHeight: contentItem.childrenRect.height
54
title.text: i18n.tr("When in Silent mode:")
55
title.color: theme.palette.normal.backgroundSecondaryText
60
height: layout.height + (divider.visible ? divider.height : 0)
65
height: optionSelector.itemHeight * 2
66
width: parent.width - 2 * (layout.padding.leading + layout.padding.trailing)
70
selectedIndex: GeneralNotificationSettings.vibrateInSilentMode ? 0 : 1
72
model: [i18n.tr("Vibrate as normal"),
73
i18n.tr("Don't vibrate")]
77
GeneralNotificationSettings.vibrateInSilentMode = true
79
GeneralNotificationSettings.vibrateInSilentMode = false
89
title.text: i18n.tr("Apps that notify with vibrations:")
90
title.color: theme.palette.normal.backgroundSecondaryText
97
Component.onCompleted: {
98
var iconPath = model.icon.toString()
99
if (iconPath.search("/") == -1) {
100
icon.name = model.icon
102
icon.source = model.icon
106
title.text: model.displayName
111
SlotsLayout.position: SlotsLayout.Leading;
114
anchors.verticalCenter: icon.verticalCenter
115
checked: model.vibrationsNotify
117
onCheckedChanged: appsVibrationsNotifyPage.model.setNotifyEnabled(index, checked)