Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Leander Schulten
Lichtsteuerung
Commits
d3b27c4d
Commit
d3b27c4d
authored
Mar 02, 2019
by
Leander Schulten
Browse files
Fix last commit
parent
c2ac6784
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main.qml
View file @
d3b27c4d
...
...
@@ -4,6 +4,8 @@ import QtQuick.Controls 2.0
import
QtQuick
.
Layouts
1.0
import
custom
.
licht
1.0
import
QtQuick
.
Dialogs
1.2
import
"
ControlPane
"
ApplicationWindow
{
visible
:
true
width
:
900
...
...
src/qml.qrc
View file @
d3b27c4d
...
...
@@ -55,5 +55,6 @@
<file alias="ControlPane/DimmerGroupControl.qml">qml/DimmerGroupControl.qml</file>
<file alias="ControlPane/ControlView.qml">qml/ControlView.qml</file>
<file alias="ControlPane/ControlItem.qml">qml/ControlItem.qml</file>
<file alias="component/TextFieldFileChooser.qml">qml/TextFieldFileChooser.qml</file>
</qresource>
</RCC>
src/qml/TextFieldFileChooser.qml
0 → 100644
View file @
d3b27c4d
import
QtQuick
2.9
import
QtQuick
.
Controls
2.2
import
QtQuick
.
Layouts
1.3
import
QtQuick
.
Dialogs
1.2
import
"
../
"
RowLayout
{
id
:
root
property
string
path
property
bool
folder
:
false
property
var
fileChooser
:
null
height
:
20
Item
{
Layout.fillWidth
:
true
Layout.preferredWidth
:
textField
.
implicitWidth
Layout.preferredHeight
:
textField
.
implicitHeight
Layout.topMargin
:
4
id
:
wrapper
clip
:
true
TextInputField
{
id
:
textField
text
:
root
.
path
anchors.fill
:
parent
anchors.bottomMargin
:
2
onAccepted
:
{
root
.
path
=
text
}
}
}
Button
{
Layout.minimumWidth
:
implicitWidth
Layout.leftMargin
:
5
Layout.preferredHeight
:
implicitHeight
-
15
text
:
"
File Chooser
"
onClicked
:
{
if
(
root
.
fileChooser
===
null
){
throw
"
fileChooser ist not set!
"
;
}
path
=
root
.
path
fileDialog
=
root
.
fileChooser
;
fileDialog
.
selectFolder
=
parent
.
folder
;
fileDialog
.
selectMultiple
=
!
parent
.
folder
;
fileDialog
.
folder
=
"
file:///
"
+
path
.
substring
(
0
,
path
.
lastIndexOf
(
"
/
"
));
fileDialog
.
addSelection
(
"
file:///
"
+
path
);
fileDialog
.
open
();
fileDialog
.
callback
=
function
(
file
){
root
.
pathChanged
(
file
);
};
}
}
}
src/settings.h
View file @
d3b27c4d
...
...
@@ -53,14 +53,12 @@ public:
void
setUpdatePauseInMs
(
unsigned
int
pause
){
settings
.
setValue
(
"updatePauseInMs"
,
pause
);
emit
updatePauseInMsChanged
();}
unsigned
int
getUpdatePauseInMs
()
const
{
return
settings
.
value
(
"updatePauseInMs"
).
toUInt
();}
void
setModuleDirPath
(
const
QString
_moduleDirPath
){
#ifdef Q_OS_MAC
if
(
!
QDir
(
"/"
+
_moduleDirPath
).
exists
())
return
;
settings
.
setValue
(
"moduleDirPath"
,
"/"
+
_moduleDirPath
);
#else
if
(
!
QDir
(
_moduleDirPath
).
exists
())
return
;
settings
.
setValue
(
"moduleDirPath"
,
_moduleDirPath
);
#endif
void
setModuleDirPath
(
const
QString
&
_moduleDirPath
){
if
(
_moduleDirPath
==
getModuleDirPath
())
return
;
if
(
!
QDir
(
_moduleDirPath
).
exists
())
return
;
settings
.
setValue
(
"moduleDirPath"
,
_moduleDirPath
);
emit
moduleDirPathChanged
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment