19
19
import Ubuntu.Components 1.3
20
20
import com.ubuntu.PamAuthentication 0.1
22
// For making scripts executable
23
import StorageManager 1.0
26
import "components/Models" as Models
21
import QtQml.Models 2.1
30
25
objectName: "mainView"
31
26
applicationName: "ut-tweak-tool.sverzegnassi"
33
function showNotification(args) {
34
var component = Qt.createComponent("Toast.qml")
35
var toast = component.createObject(mainView, args);
40
function showNotificationWithAction(args) {
41
var component = Qt.createComponent("ToastWithAction.qml")
42
var toast = component.createObject(mainView, args);
47
28
width: units.gu(100)
48
29
height: units.gu(76)
49
theme.name: "TweakTool.OrangeTheme"
31
Component.onCompleted: {
32
window.minimumWidth = units.gu(100)
33
window.minimumHeight = units.gu(60)
51
36
AdaptivePageLayout {
53
38
anchors.fill: parent
55
40
function push(page, properties) {
56
// This function is called 'push' so we don't need to update
58
41
return pageStack.addPageToNextColumn(primaryPage, page, properties)
61
44
primaryPage: Page {
64
property alias currentSectionIndex: view.currentIndex
66
title: i18n.tr("UT Tweak Tool")
68
head.sections.model: [ i18n.tr("Behavior"), i18n.tr("Apps & Scopes"), i18n.tr("System") ]
47
title: i18n.tr("Tweak Tool")
49
model: [ i18n.tr("Behavior"), i18n.tr("Apps & Scopes"), i18n.tr("System") ]
50
onSelectedIndexChanged: {
51
// Current section has changed, if there was an opened page
52
// in the second column, it is not anymore related to the
53
// new current section.
54
mainPage.pageStack.removePages(mainPage)
62
top: mainPage.header.bottom
76
69
orientation: ListView.Horizontal
78
71
snapMode: ListView.SnapOneItem
80
72
highlightMoveDuration: UbuntuAnimation.FastDuration
82
currentIndex: mainPage.head.sections.selectedIndex
84
onCurrentIndexChanged: {
85
// Current section has changed, if there was an opened page
86
// in the second column, it is not anymore related to the
87
// new current section.
88
mainPage.pageStack.removePages(mainPage)
99
Qt.resolvedUrl("behaviourTab/BehaviourTab.qml"),
100
Qt.resolvedUrl("applicationsTab/ApplicationsTab.qml"),
101
Qt.resolvedUrl("systemTab/SystemTab.qml")
73
currentIndex: mainPage.header.sections.selectedIndex
80
source: Qt.resolvedUrl("behaviourTab/BehaviourTab.qml")
86
source: Qt.resolvedUrl("applicationsTab/ApplicationsTab.qml")
92
source: Qt.resolvedUrl("systemTab/SystemTab.qml")
107
Models.ClickModel { id: clickModel }
109
AuthenticationService {
111
serviceName: "ut-tweak-tool"
99
property alias pam: pamLoader.item
102
// A bit nonsense, but we're not using pam for security
104
sourceComponent: AuthenticationService {
106
serviceName: "ut-tweak-tool"