ElisaConfigurationDialog.qml 2.67 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
Window {
15
    id: dialog
16 17

    title: i18n("Configure")
18

19 20
    visible: true
    modality: Qt.ApplicationModal
21

22 23
    minimumWidth: 750
    minimumHeight: 500
24

25 26 27 28 29 30
    Shortcut {
        sequence: StandardKey.Cancel

        onActivated: close()
    }

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

    Component {
        id: highlightBar

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

45
    Rectangle {
46
        anchors.fill: parent
47

48
        color: myPalette.window
49

50 51
        ColumnLayout {
            spacing: 0
52

53
            anchors.fill: parent
54

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

58 59
                Layout.leftMargin: 5
                Layout.rightMargin: 5
60 61
            }

62 63
            GeneralConfiguration {
                Layout.fillWidth: true
64

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

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

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

78 79 80
            FileScanningConfiguration {
                Layout.fillWidth: true
                Layout.fillHeight: true
81

82
                Layout.topMargin: 10
83 84
                Layout.leftMargin: 20
                Layout.rightMargin: 10
85
            }
86

87 88
            DialogButtonBox {
                Layout.fillWidth: true
89

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

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

101 102
                    enabled: config.isDirty
                }
103

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

110 111 112 113
                onAccepted: {
                    config.save()
                    close()
                }
114

115
                onApplied: config.save()
116

117
                onRejected: close()
118 119 120 121
            }
        }
    }
}