ElisaConfigurationDialog.qml 3.11 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: 600
    minimumHeight: 400
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 68 69
            Kirigami.Heading {
                text: i18n('General')
                Layout.leftMargin: 5
                Layout.rightMargin: 5
70 71
            }

72 73 74 75 76
            GeneralConfiguration {
                Layout.fillWidth: true
                Layout.topMargin: 10
                Layout.leftMargin: 20
                Layout.rightMargin: 10
Alexander Stippich's avatar
Alexander Stippich committed
77
            }
78

79 80 81 82 83
            Kirigami.Heading {
                text: i18n('Music Search Paths')
                Layout.leftMargin: 5
                Layout.rightMargin: 5
                Layout.topMargin: 15
84
            }
Alexander Stippich's avatar
Alexander Stippich committed
85

86 87 88 89 90 91 92
            FileScanningConfiguration {
                Layout.fillWidth: true
                Layout.fillHeight: true
                Layout.leftMargin: 10
                Layout.rightMargin: 10
                Layout.topMargin: 10
            }
93

94 95
            DialogButtonBox {
                Layout.fillWidth: true
96

97 98 99
                Button {
                    text: i18n("OK")
                    DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
100 101
                }

102 103 104
                Button {
                    text: i18n("Apply")
                    DialogButtonBox.buttonRole: DialogButtonBox.ApplyRole
105

106 107
                    enabled: config.isDirty
                }
108

109 110 111 112
                Button {
                    text: i18n("Cancel")
                    DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
                }
113

114 115 116 117
                onAccepted: {
                    config.save()
                    close()
                }
118

119
                onApplied: config.save()
120

121
                onRejected: close()
122 123 124 125
            }
        }
    }
}