ElisaConfigurationDialog.qml 2.75 KB
Newer Older
1
/*
Matthieu Gallien's avatar
Matthieu Gallien committed
2 3 4
   SPDX-FileCopyrightText: 2017 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>

   SPDX-License-Identifier: LGPL-3.0-or-later
5 6
 */

7 8
import QtQuick 2.11
import QtQuick.Controls 2.4
9 10
import QtQuick.Layouts 1.12
import QtQuick.Window 2.12
11
import QtQml.Models 2.3
12
import org.kde.kirigami 2.5 as Kirigami
13

14 15
import org.kde.elisa 1.0

16
Window {
17
    id: dialog
18 19

    title: i18n("Configure")
20

21 22
    visible: true
    modality: Qt.ApplicationModal
23

24 25
    minimumWidth: 750
    minimumHeight: 500
26

27 28 29 30 31 32
    Shortcut {
        sequence: StandardKey.Cancel

        onActivated: close()
    }

33 34 35 36 37 38 39 40 41 42 43 44 45 46
    SystemPalette {
        id: myPalette
        colorGroup: SystemPalette.Active
    }

    Component {
        id: highlightBar

        Rectangle {
            width: 200; height: 50
            color: myPalette.highlight
        }
    }

47
    Rectangle {
48
        anchors.fill: parent
49

50
        color: myPalette.window
51

52 53
        ColumnLayout {
            spacing: 0
54

55
            anchors.fill: parent
56

57
            Kirigami.Heading {
Yuri Chornoivan's avatar
Yuri Chornoivan committed
58
                text: i18n("General")
59

60 61
                Layout.leftMargin: 5
                Layout.rightMargin: 5
62 63
            }

64 65
            GeneralConfiguration {
                Layout.fillWidth: true
66

67 68 69
                Layout.topMargin: 10
                Layout.leftMargin: 20
                Layout.rightMargin: 10
Alexander Stippich's avatar
Alexander Stippich committed
70
            }
71

72
            Kirigami.Heading {
Yuri Chornoivan's avatar
Yuri Chornoivan committed
73
                text: i18n("Music Search Configuration")
74 75

                Layout.topMargin: 15
76 77
                Layout.leftMargin: 5
                Layout.rightMargin: 5
78
            }
Alexander Stippich's avatar
Alexander Stippich committed
79

80 81 82
            FileScanningConfiguration {
                Layout.fillWidth: true
                Layout.fillHeight: true
83

84
                Layout.topMargin: 10
85 86
                Layout.leftMargin: 20
                Layout.rightMargin: 10
87
            }
88

89 90
            DialogButtonBox {
                Layout.fillWidth: true
91

92 93
                Button {
                    text: i18n("OK")
Alexander Stippich's avatar
Alexander Stippich committed
94
                    icon.name: 'dialog-ok-apply'
95
                    DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
96 97
                }

98 99
                Button {
                    text: i18n("Apply")
Alexander Stippich's avatar
Alexander Stippich committed
100
                    icon.name: 'dialog-ok-apply'
101
                    DialogButtonBox.buttonRole: DialogButtonBox.ApplyRole
102

103
                    enabled: ElisaConfigurationDialog.isDirty
104
                }
105

106 107
                Button {
                    text: i18n("Cancel")
Alexander Stippich's avatar
Alexander Stippich committed
108
                    icon.name: 'dialog-cancel'
109 110
                    DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
                }
111

112
                onAccepted: {
113
                    ElisaConfigurationDialog.save()
114 115
                    close()
                }
116

117
                onApplied: ElisaConfigurationDialog.save()
118

119
                onRejected: close()
120 121 122 123
            }
        }
    }
}