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" border.color: "red" border.width: 3 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 - root.width * 0.03 - width y: (root.height / 12) width: factoryResetLabel.implicitWidth * 1.2 height: factoryResetLabel.implicitHeight * 2 color: Globals.customer_color_base border.color: "lightgray" border.width: 3 Label { id: factoryResetLabel 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 = ""; } } } //============================================================================ } } }