Commit 057ef4d5 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): use external `scripts` folder

parent 45bd6600
......@@ -7,7 +7,7 @@ for filename in $(find languages/ ui/ imgs/ -type f)
do
extension="${filename##*.}"
if [[ "${extension}" == @(qml|svg|qm) ]]; then
if [[ "${extension}" == @(qml|svg|qm|js) ]]; then
echo " <file>$filename</file>"
fi
done
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="96px" height="86px" viewBox="0 0 96 86" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
<title>chat_add</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="OUTILS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="linphone_v2.0_icones_buttons" sketch:type="MSArtboardGroup" transform="translate(-1438.000000, -6678.000000)">
<g id="chat_add" sketch:type="MSLayerGroup" transform="translate(1426.000000, 6661.000000)">
<g id="add_chat" transform="translate(15.000000, 20.000000)" stroke="#444444" stroke-width="5" sketch:type="MSShapeGroup" stroke-linecap="round" stroke-linejoin="round">
<path d="M58.042,68.217 C52.621,70.69 46.491,72.083 40,72.083 C35.519,72.083 31.215,71.422 27.193,70.197 C27.195,70.17 15.238,82.821 4.54747351e-12,79.419 C4.54747351e-12,79.419 14.921,75.061 11.535,61.877 L11.426,61.267 C4.357,54.764 4.54747351e-12,45.862 4.54747351e-12,36.042 C4.54747351e-12,16.137 17.91,0 40,0 C62.089,0 80,16.137 80,36.042 C80,37.178 79.942,38.302 79.828,39.411 M21.375,29.662 L58.519,29.662 L21.375,29.662 Z M21.375,42.421 L58.519,42.421 L21.375,42.421 Z M58.843,68.319 C65.894,75.34 77.322,75.335 84.373,68.319 C91.425,61.299 91.425,49.926 84.373,42.907 C77.322,35.892 65.894,35.887 58.843,42.907 C51.793,49.923 51.793,61.302 58.843,68.319 L58.843,68.319 Z M81.135,55.616 L62.364,55.611 L81.135,55.616 Z M71.748,64.999 L71.752,46.228 L71.748,64.999 Z" id="Add-chat-icon"></path>
</g>
<rect id="Rectangle-232-Copy-25" opacity="0" fill-opacity="0.7" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="120" height="120"></rect>
</g>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -20,6 +20,7 @@
<file>ui/components/form/TransparentComboBox.qml</file>
<file>ui/components/form/SmallButton.qml</file>
<file>ui/components/form/DarkButton.qml</file>
<file>ui/scripts/utils.js</file>
<file>ui/views/newCall.qml</file>
<file>ui/views/manageAccounts.qml</file>
<file>ui/views/mainWindow/mainWindow.qml</file>
......
// ===================================================================
// Contains many common helpers.
// ===================================================================
function openWindow (windowName, parent) {
var component = Qt.createComponent(
'qrc:/ui/views/' + windowName + '.qml'
);
if (component.status !== Component.Ready) {
console.debug('Window ' + windowName + ' not ready.')
if(component.status === Component.Error) {
console.debug('Error:' + component.errorString())
}
} else {
component.createObject(parent).show()
}
}
......@@ -7,19 +7,9 @@ import 'qrc:/ui/components/contact'
import 'qrc:/ui/components/form'
import 'qrc:/ui/components/misc'
ApplicationWindow {
function openWindow (name) {
var component = Qt.createComponent('qrc:/ui/views/' + name + '.qml');
if (component.status !== Component.Ready) {
console.debug('Window not ready.')
if(component.status === Component.Error) {
console.debug('Error:' + component.errorString())
}
} else {
component.createObject(mainWindow).show()
}
}
import 'qrc:/ui/scripts/utils.js' as Utils
ApplicationWindow {
id: mainWindow
minimumHeight: 70
minimumWidth: 780
......@@ -57,11 +47,11 @@ ApplicationWindow {
// User actions.
ActionButton {
onClicked: openWindow('manageAccounts')
onClicked: Utils.openWindow('manageAccounts', mainWindow)
}
ActionButton {
onClicked: openWindow('newCall')
onClicked: Utils.openWindow('newCall', mainWindow)
}
// Search.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment