123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- import QtQuick 2.5
- import QtQuick.Controls 1.4
- import QtQuick.Layouts 1.0
- import ApplicationLauncher 1.0
- import "qrc:/Globals"
- Rectangle {
- id: root
- width: parent.width
- height: parent.height
- color: "white"
- property color inputBackgrund: "lightgray"
- property int inputRadius: 4
- property int inputHeight: 40
- property int inputFontSize: 22
- Flickable {
- id: flickable
- anchors.fill: parent
- contentWidth: content.width
- contentHeight: content.height
- interactive: contentHeight > height
- flickableDirection: Flickable.VerticalFlick
- Item {
- id: content
- x: 0
- y: 0
- width: flickable.width
- //============================================================================
- ApplicationLaunch {
- id: factoryResetSCRIPT
- appName: ""
- arguments: ""
- onAppFinished: {
- Qt.quit(); //Beenden und am Target neustarten
- }
- }
- Rectangle {
- property int factoryRestFontSize: 20
- property int factoryResetRectHeight: 40
- id: factoryResetRECT
- x: ((root.width / 17) * 14) - 10
- y: (root.height / 12)
- width: (root.width / 17) * 3
- height: factoryResetRectHeight
- color: Globals.customer_color_base
- border.color: "lightgray"
- border.width: 3
- Label {
- anchors.centerIn: parent
- font.pixelSize: roleFontSize
- //:ID: admin_factory_reset_butt buttontext for factory reset button
- text: qsTrId("_factory_reset")
- }
- MouseArea {
- anchors.fill : parent
- onClicked: {
- sysinfo.beep();
- factoryResetSCRIPT.appName = Globals.baseDir + "/Scripts/FactoryReset.sh " + sysinfo.currentCpuArchitecture;
- factoryResetSCRIPT.launchScript();
- }
- }
- }
- // Rectangle {
- // id : pwdEngRECT
- // x: (root.width / 17) * 4
- // y: (root.height / 6)
- // width: (parent.width / 17) * 3
- // height: inputHeight
- // radius: inputRadius
- // color: inputBackgrund
- // TextInput {
- // id: pwdEngINPUT
- // y: (parent.height - font.pixelSize) / 2
- // x: y
- // width: parent.width - (parent.height - font.pixelSize)
- // clip: true
- // color: "black"
- // font.pixelSize: inputFontSize
- // echoMode: TextInput.Password
- // passwordMaskDelay: 250
- // text: ""
- // onAccepted: {
- // }
- // Keys.onPressed: {
- // if(event.key == Qt.Key_Left) {
- // pwdAdminRepeatINPUT.focus = true;
- // }
- // if(event.key == Qt.Key_Right) {
- // pwdEngRepeatINPUT.focus = true;
- // }
- // if(event.key == Qt.Key_Up)
- // {
- // pwdAdminINPUT.focus = true;
- // }
- // if(event.key == Qt.Key_Down)
- // {
- // pwdAdminINPUT.focus = true;
- // }
- // if((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return))
- // {
- // pwdEngRepeatINPUT.focus = true;
- // }
- // }
- // }
- // }
- // Rectangle {
- // id : pwdEngRepatRECT
- // x: (root.width / 17) * 8
- // y: (root.height / 6)
- // width: (parent.width / 17) * 3
- // height: inputHeight
- // radius: inputRadius
- // color: inputBackgrund
- // TextInput {
- // id: pwdEngRepeatINPUT
- // x: (parent.height - font.pixelSize) / 2
- // y: x
- // width: parent.width - (parent.height - font.pixelSize)
- // clip: true
- // color: "black"
- // font.pixelSize: inputFontSize
- // echoMode: TextInput.Password
- // passwordMaskDelay: 250
- // text: ""
- // onAccepted: {
- // }
- // Keys.onPressed: {
- // if(event.key == Qt.Key_Left) {
- // pwdEngINPUT.focus = true;
- // }
- // if(event.key == Qt.Key_Right) {
- // pwdAdminINPUT.focus = true;
- // }
- // if(event.key == Qt.Key_Up)
- // {
- // pwdAdminRepeatINPUT.focus = true;
- // }
- // if(event.key == Qt.Key_Down)
- // {
- // pwdAdminRepeatINPUT.focus = true;
- // }
- // if((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return))
- // {
- // pwdAdminINPUT.focus = true;
- // }
- // }
- // }
- // }
- // Rectangle {
- // id : pwdEngRECTLAB
- // x: (root.width / 17) / 3
- // y: (root.height / 6)
- // width: (parent.width / 17) * 3
- // height: inputHeight
- // Label {
- // id: pwdEngLABEL
- // x: (parent.height - font.pixelSize) / 2
- // y: x
- // font.pixelSize: inputFontSize
- // text: Globals.getActUserRoleText("eng")
- // }
- // }
- // ButtHMI {
- // id : pwdEngBUTT
- // property bool isValid : ((pwdEngINPUT.length > 0) && (pwdEngINPUT.text == pwdEngRepeatINPUT.text)) ? true : false
- // buttX: (root.width / 17) * 12
- // buttY: (root.height / 6)
- // buttWidth: inputHeight
- // buttHeight: buttWidth
- // text: "\uf0c7" //floppy-sign
- // color: isValid == true ?Globals.customer_color_base:inputBackgrund //((pwdEngINPUT.length > 0) && (pwdEngINPUT.text == pwdEngRepeatINPUT.text)) ? Globals.customer_color_base : inputBackgrund
- // borderColor: color
- // onButtPressed: {
- // if(isValid) {
- // if(pwdEngINPUT.text == "*")
- // settings.setValue("UserRoleEng/Password", "*");
- // else
- // settings.setValue("UserRoleEng/Password", Qt.md5(pwdEngINPUT.text));
- // pwdEngINPUT.text = pwdEngRepeatINPUT.text = "";
- // }
- // }
- // }
- Rectangle {
- id : pwdAdminRECT
- x: (root.width / 17) * 4
- y: (root.height / 6) * 3
- width: (parent.width / 17) * 3
- height: inputHeight
- radius: inputRadius
- color: inputBackgrund
- TextInput {
- id: pwdAdminINPUT
- x: (parent.height - font.pixelSize) / 2
- y: x
- width: parent.width - (parent.height - font.pixelSize)
- clip: true
- color: "black"
- font.pixelSize: inputFontSize
- echoMode: TextInput.Password
- passwordMaskDelay: 250
- text: ""
- onAccepted: {
- }
- Keys.onPressed: {
- if(event.key == Qt.Key_Left) {
- pwdEngRepeatINPUT.focus = true;
- }
- if(event.key == Qt.Key_Right) {
- pwdAdminRepeatINPUT.focus = true;
- }
- if(event.key == Qt.Key_Up)
- {
- pwdEngINPUT.focus = true;
- }
- if(event.key == Qt.Key_Down)
- {
- pwdEngINPUT.focus = true;
- }
- if((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return))
- {
- pwdAdminRepeatINPUT.focus = true;
- }
- }
- }
- }
- Rectangle {
- id : pwdAdminRepatRECT
- x: (root.width / 17) * 8
- y: (root.height / 6) * 3
- width: (parent.width / 17) * 3
- height: inputHeight
- radius: inputRadius
- color: inputBackgrund
- TextInput {
- id: pwdAdminRepeatINPUT
- x: (parent.height - font.pixelSize) / 2
- y: x
- width: parent.width - (parent.height - font.pixelSize)
- clip: true
- color: "black"
- font.pixelSize: inputFontSize
- passwordMaskDelay: 250
- echoMode: TextInput.Password
- text: ""
- onAccepted: {
- }
- Keys.onPressed: {
- if(event.key == Qt.Key_Left) {
- pwdAdminINPUT.focus = true;
- }
- if(event.key == Qt.Key_Right) {
- pwdEngINPUT.focus = true;
- }
- if(event.key == Qt.Key_Up)
- {
- pwdEngRepeatINPUT.focus = true;
- }
- if(event.key == Qt.Key_Down)
- {
- pwdEngRepeatINPUT.focus = true;
- }
- if((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return))
- {
- pwdEngINPUT.focus = true;
- }
- }
- }
- }
- Rectangle {
- id : pwdAdminRECTLAB
- x: (root.width / 17) / 3
- y: (root.height / 6) * 3
- width: (parent.width / 17) * 3
- height: inputHeight
- Label {
- id: pwdAdminLABEL
- x: (parent.height - font.pixelSize) / 2
- y: x
- font.pixelSize: inputFontSize
- text: Globals.getActUserRoleText("admin")
- }
- }
- ButtHMI {
- id : pwdAdminBUTT
- property bool isValid : ((pwdAdminINPUT.length > 0) && (pwdAdminINPUT.text == pwdAdminRepeatINPUT.text)) ? true : false
- buttX: (root.width / 17) * 12
- buttY: (root.height / 6) * 3
- buttWidth: inputHeight
- buttHeight: buttWidth
- text: "\uf0c7" //floppy-sign
- color: isValid == true ?Globals.customer_color_base:inputBackgrund
- borderColor: color
- onButtPressed: {
- if(isValid) {
- if(pwdAdminINPUT.text == "*")
- settings.setValue("UserRoleAdmin/Password", "*");
- else
- settings.setValue("UserRoleAdmin/Password", Qt.md5(pwdAdminINPUT.text));
- pwdAdminINPUT.text = pwdAdminRepeatINPUT.text = "";
- }
- }
- }
- //============================================================================
- }
- }
- }
|