ElisaConfigurationDialog.qml 3.26 KB
Newer Older
1 2 3
/*
 * Copyright 2017 Matthieu Gallien <matthieu_gallien@yahoo.fr>
 *
4 5
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
6 7 8
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
9
 * This program is distributed in the hope that it will be useful,
10 11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14 15
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16 17
 */

18 19
import QtQuick 2.11
import QtQuick.Controls 2.4
20 21
import QtQuick.Layouts 1.12
import QtQuick.Window 2.12
22
import QtQml.Models 2.3
23
import org.kde.kirigami 2.5 as Kirigami
24

25
Window {
26
    id: dialog
27 28

    title: i18n("Configure")
29

30 31
    visible: true
    modality: Qt.ApplicationModal
32

33 34
    minimumWidth: 750
    minimumHeight: 500
35

36 37 38 39 40 41
    Shortcut {
        sequence: StandardKey.Cancel

        onActivated: close()
    }

42 43 44 45 46 47 48 49 50 51 52 53 54 55
    SystemPalette {
        id: myPalette
        colorGroup: SystemPalette.Active
    }

    Component {
        id: highlightBar

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

56
    Rectangle {
57
        anchors.fill: parent
58

59
        color: myPalette.window
60

61 62
        ColumnLayout {
            spacing: 0
63

64
            anchors.fill: parent
65

66
            Kirigami.Heading {
Yuri Chornoivan's avatar
Yuri Chornoivan committed
67
                text: i18n("General")
68

69 70
                Layout.leftMargin: 5
                Layout.rightMargin: 5
71 72
            }

73 74
            GeneralConfiguration {
                Layout.fillWidth: true
75

76 77 78
                Layout.topMargin: 10
                Layout.leftMargin: 20
                Layout.rightMargin: 10
Alexander Stippich's avatar
Alexander Stippich committed
79
            }
80

81
            Kirigami.Heading {
Yuri Chornoivan's avatar
Yuri Chornoivan committed
82
                text: i18n("Music Search Configuration")
83 84

                Layout.topMargin: 15
85 86
                Layout.leftMargin: 5
                Layout.rightMargin: 5
87
            }
Alexander Stippich's avatar
Alexander Stippich committed
88

89 90 91
            FileScanningConfiguration {
                Layout.fillWidth: true
                Layout.fillHeight: true
92

93
                Layout.topMargin: 10
94 95
                Layout.leftMargin: 20
                Layout.rightMargin: 10
96
            }
97

98 99
            DialogButtonBox {
                Layout.fillWidth: true
100

101 102
                Button {
                    text: i18n("OK")
Alexander Stippich's avatar
Alexander Stippich committed
103
                    icon.name: 'dialog-ok-apply'
104
                    DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
105 106
                }

107 108
                Button {
                    text: i18n("Apply")
Alexander Stippich's avatar
Alexander Stippich committed
109
                    icon.name: 'dialog-ok-apply'
110
                    DialogButtonBox.buttonRole: DialogButtonBox.ApplyRole
111

112 113
                    enabled: config.isDirty
                }
114

115 116
                Button {
                    text: i18n("Cancel")
Alexander Stippich's avatar
Alexander Stippich committed
117
                    icon.name: 'dialog-cancel'
118 119
                    DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
                }
120

121 122 123 124
                onAccepted: {
                    config.save()
                    close()
                }
125

126
                onApplied: config.save()
127

128
                onRejected: close()
129 130 131 132
            }
        }
    }
}