ElisaConfigurationDialog.qml 3.12 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 67
            Kirigami.Heading {
                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 {
82 83 84
                text: i18n('Music Search Configuration')

                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 103
                Button {
                    text: i18n("OK")
                    DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
104 105
                }

106 107 108
                Button {
                    text: i18n("Apply")
                    DialogButtonBox.buttonRole: DialogButtonBox.ApplyRole
109

110 111
                    enabled: config.isDirty
                }
112

113 114 115 116
                Button {
                    text: i18n("Cancel")
                    DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
                }
117

118 119 120 121
                onAccepted: {
                    config.save()
                    close()
                }
122

123
                onApplied: config.save()
124

125
                onRejected: close()
126 127 128 129
            }
        }
    }
}