2 ** Copyright (C) 2012 Christophe CHAPUIS <chris.chapuis _at_ gmail _dot_ com>
4 ** This package is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
9 ** This package is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
14 ** You should have received a copy of the GNU General Public License
15 ** along with this package; if not, write to the Free Software
16 ** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 property SourceModel configModel;
31 //property SourceModel model;
32 //property SourceConfigComponentView viewComponent;
36 name: "showSourceConfig"
38 // In this state, we bring the configuration UI of the source
39 PropertyChanges { target: configDialog; color: "#80000000" }
40 PropertyChanges { target: sourceConfigLoader; opacity: 1 }
41 PropertyChanges { target: sourceConfigLoader; source: configModel.settingsComponent }
42 PropertyChanges { target: configTitle; text: configModel.name + " Settings"}
44 AnchorChanges { target: quitApplyConfigButton; anchors.left: undefined; anchors.right: configDialog.right }
45 AnchorChanges { target: quitCancelConfigButton; anchors.right: undefined; anchors.left: configDialog.left }
52 to: "showSourceConfig"
56 PropertyAction { target: configDialog; property: "visible"; value: true }
57 // Bring the UI elements
59 AnchorAnimation { duration: 500 }
60 ColorAnimation { duration: 400 }
65 from: "showSourceConfig"
69 // Move out the UI elements
71 AnchorAnimation { duration: 500 }
72 ColorAnimation { duration: 400 }
75 PropertyAction { target: configDialog; property: "visible"; value: false }
81 anchors.top: parent.top
82 anchors.left: parent.left
83 anchors.right: parent.right
84 anchors.bottom: quitApplyConfigButton.top
90 anchors.top: parent.top
91 anchors.left: parent.left
92 anchors.right: parent.right
93 horizontalAlignment: Text.AlignHCenter
99 id: sourceConfigLoader
101 anchors.top: configTitle.bottom
102 anchors.left: parent.left
103 anchors.right: parent.right
104 anchors.bottom: quitApplyConfigButton.top
106 Behavior on opacity {
107 NumberAnimation { duration: 1000; easing.type: Easing.InOutQuad }
111 // fill the UI with information from the model
112 configModel.loadConfiguration(sourceConfigLoader.item)
117 id: quitApplyConfigButton
118 icon: "../images/apply.png"
119 anchors.bottom: parent.bottom
120 anchors.left: parent.right
123 // ask the model to store the configuration
124 configModel.storeConfiguration(sourceConfigLoader.item)
126 // Store the configuration of this source, and disappear
127 configDialog.state = "hidden"
132 id: quitCancelConfigButton
133 icon: "../images/cancel.png"
134 anchors.bottom: parent.bottom
135 anchors.right: parent.left
138 // Store the configuration of this source, and disappear
139 configDialog.state = "hidden"