1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:BSD$
10 ** You may use this file under the terms of the BSD license as follows:
12 ** "Redistribution and use in source and binary forms, with or without
13 ** modification, are permitted provided that the following conditions are
15 ** * Redistributions of source code must retain the above copyright
16 ** notice, this list of conditions and the following disclaimer.
17 ** * Redistributions in binary form must reproduce the above copyright
18 ** notice, this list of conditions and the following disclaimer in
19 ** the documentation and/or other materials provided with the
21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
22 ** the names of its contributors may be used to endorse or promote
23 ** products derived from this software without specific prior written
26 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
39 ****************************************************************************/
42 import "../filedialog" 1.0
46 height: 480; width:1000
47 property color buttonBorderColor: "#7F8487"
48 property color buttonFillColor: "#8FBDCACD"
49 property string fileContent:directory.fileContent
51 //the menuName is accessible from outside this QML file
52 property string menuName: "File"
54 //used to divide the screen into parts.
55 property real partition: 1/3
59 GradientStop { position: 0.0; color: "#6C646A" }
60 GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
65 filename: textInput.text
66 onDirectoryChanged:fileDialog.notifyRefresh()
72 //make this rectangle invisible
74 anchors.left: parent.left
76 //the height is a good proportion that creates more space at the top of
77 //the column of buttons
78 width: fileMenu.width * partition; height: fileMenu.height
81 anchors.centerIn: parent
82 spacing: parent.height/32
86 borderColor: buttonBorderColor
87 buttonColor: buttonFillColor
88 width: actionContainer.width/ 1.3
89 height:actionContainer.height / 8
92 directory.fileContent = textArea.textContent
93 directory.filename = textInput.text
97 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
98 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
103 width: actionContainer.width/ 1.3
104 height:actionContainer.height/ 8
105 buttonColor: buttonFillColor
106 borderColor: buttonBorderColor
110 directory.filename = textInput.text
112 textArea.textContent = directory.fileContent
115 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
116 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
121 width: actionContainer.width/ 1.3
122 height: actionContainer.height/ 8
123 buttonColor: buttonFillColor
124 borderColor: buttonBorderColor
128 textArea.textContent = ""
132 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
133 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
139 width: actionContainer.width/ 1.3
140 height: actionContainer.height / 16
145 width: actionContainer.width/ 1.3
146 height: actionContainer.height/ 8
149 buttonColor: buttonFillColor
150 borderColor: buttonBorderColor
151 onButtonClick: Qt.quit()
153 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
154 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
162 width: 2*fileMenu.width * partition; height: fileMenu.height
163 anchors.right:parent.right
167 anchors.centerIn: parent
168 spacing: parent.height /640
171 height: 2*dialogContainer.height * partition
172 width: dialogContainer.width
173 onSelectChanged: textInput.text = selectedFile
178 height: dialogContainer.height * partition; width: dialogContainer.width
184 GradientStop { position: 0.0; color: "#806F6F6F" }
185 GradientStop { position: 1.0; color: "#136F6F6F" }
188 anchors { centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15 }
189 height: parent.height-15
190 width: parent.width -20
191 border { color: "#4A4A4A"; width:1 }
196 anchors { bottom: parent.bottom; topMargin: 10; horizontalCenter: parent.horizontalCenter }
197 width: parent.width - 10
198 height: parent.height -10
200 color: "lightsteelblue"
205 anchors.centerIn: parent
206 text: "Select file name and press save or load"
207 font {pointSize: 11; weight: Font.Light; italic: true}
210 opacity: (textInput.text == "") ? 1 : 0
214 anchors { top: parent.top; left: parent.left }
216 font { pointSize: 11; weight: Font.Light; italic: true }
221 anchors.centerIn:parent
222 width: nameField.width; height: nameField.height
225 textInput.focus = true
226 textInput.forceFocus()