Merge Linuxero with main
This commit is contained in:
@@ -30,7 +30,7 @@ GridLayout
|
||||
{
|
||||
id: saveConfig
|
||||
text: qsTr("Jetzt sichern!")
|
||||
onClicked: dialog.open()
|
||||
onClicked: utilityDialogs.item.backup_config.open()
|
||||
}
|
||||
Label
|
||||
{
|
||||
@@ -41,75 +41,17 @@ GridLayout
|
||||
{
|
||||
id: saveEncryption
|
||||
text: qsTr("Jetzt sichern!")
|
||||
onClicked: apploader.item.recoverEnc.open()
|
||||
onClicked: utilityDialogs.item.backup_encrypt_pw.open()
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: spacer
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
Dialog
|
||||
|
||||
Loader
|
||||
{
|
||||
anchors.centerIn: parent
|
||||
id: dialog
|
||||
title: "Title"
|
||||
standardButtons: Dialog.Apply | Dialog.Cancel
|
||||
|
||||
onApplied:
|
||||
{
|
||||
|
||||
if (configPwd.text === repeatConfigPwd.text)
|
||||
{
|
||||
|
||||
saveConfigFile.open()
|
||||
}
|
||||
else
|
||||
{
|
||||
configPwd.text = ""
|
||||
configPwd.placeholderText = qsTr("Passwort stimmt nicht überein")
|
||||
configPwd.placeholderTextColor = "red"
|
||||
repeatConfigPwd.placeholderText = qsTr("")
|
||||
repeatConfigPwd.text = ""
|
||||
}
|
||||
}
|
||||
onRejected: console.log("Cancel clicked")
|
||||
GridLayout
|
||||
{
|
||||
id: gridPw
|
||||
columns: 2
|
||||
Label
|
||||
{
|
||||
text: qsTr("Passwort eingeben")
|
||||
}
|
||||
TextField
|
||||
{
|
||||
|
||||
id: configPwd
|
||||
placeholderText: qsTr("Sicherungspasswort festlegen")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Passwort wiederholen")
|
||||
}
|
||||
TextField
|
||||
{
|
||||
property string name: "password"
|
||||
id: repeatConfigPwd
|
||||
placeholderText: qsTr("Sicherungspasswort wiederholen")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
FileDialog
|
||||
{
|
||||
id: saveConfigFile
|
||||
fileMode: FileDialog.SaveFile
|
||||
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
|
||||
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
||||
onAccepted:
|
||||
{
|
||||
var pw = JsLib.parseForm(gridPw)
|
||||
config.backupConfig(saveConfigFile.currentFile, pw["password"])
|
||||
}
|
||||
id: utilityDialogs
|
||||
source: "UtilityDialogs.qml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@ import QtCore
|
||||
import "../js/qmldict.js" as Qmldict
|
||||
|
||||
|
||||
|
||||
Item
|
||||
{
|
||||
property string recpass: ""
|
||||
property bool adminAvailable: true
|
||||
property alias recoverEnc: recoveryPaswordDialog
|
||||
|
||||
|
||||
id: firstStartItem
|
||||
anchors.fill: parent
|
||||
@@ -72,7 +73,6 @@ Item
|
||||
MessageDialog
|
||||
{
|
||||
id: recoveryDialog
|
||||
|
||||
text: qsTr("Diesen Wiederherstellungscode musst du sicher aufbewahren!\nMöchtest du das jetzt machen?")
|
||||
title: qsTr("Wiederherstellen")
|
||||
buttons: MessageDialog.Yes | MessageDialog.No
|
||||
@@ -156,6 +156,12 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: utilityDialogs
|
||||
source: "UtilityDialogs.qml"
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
config.dbConnectionError.connect(onDbConnectionError)
|
||||
@@ -163,15 +169,10 @@ Item
|
||||
config.backupEncryptionKey.connect(onBackupEncryptionKey)
|
||||
}
|
||||
|
||||
function gotoLogin()
|
||||
{
|
||||
appLoader.source= "LoginScreen.qml"
|
||||
topBar.visible = true
|
||||
}
|
||||
|
||||
function onBackupEncryptionKey()
|
||||
{
|
||||
recoveryDialog.open()
|
||||
|
||||
utilityDialogs.item.recoveryDialog.open()
|
||||
}
|
||||
|
||||
function onDbConnectionError(msg, success)
|
||||
@@ -192,5 +193,4 @@ Item
|
||||
firstStart.push("AdminUserConfig.qml")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ Item {
|
||||
id: objectsStack
|
||||
anchors.fill: parent
|
||||
initialItem: "ObjectsTable.qml"
|
||||
anchors.margins: 9
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
Gui/OfferTable.qml
Normal file
17
Gui/OfferTable.qml
Normal file
@@ -0,0 +1,17 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
|
||||
Item
|
||||
{
|
||||
StackView
|
||||
{
|
||||
id: employeesStack
|
||||
anchors.fill: parent
|
||||
initialItem: "OffersTable.qml"
|
||||
anchors.margins: 9
|
||||
}
|
||||
}
|
||||
|
||||
15
Gui/OffersTable.qml
Normal file
15
Gui/OffersTable.qml
Normal file
@@ -0,0 +1,15 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
Item
|
||||
{
|
||||
property var availableFilters: []
|
||||
|
||||
SearchBar
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
}
|
||||
@@ -138,6 +138,37 @@ RowLayout
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: offers
|
||||
flat: true
|
||||
text: qsTr("Angebote")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
Layout.margins: 3
|
||||
background: Rectangle
|
||||
{
|
||||
id: offersBackie
|
||||
border.width: offers.activeFocus ? 2 : 1
|
||||
border.color: "#888"
|
||||
radius: 4
|
||||
gradient: Gradient
|
||||
{
|
||||
GradientStop { position: 0 ; color: offers.pressed ? "#000" : "#001" }
|
||||
GradientStop { position: 1 ; color: offers.pressed ? "#100" : "#000" }
|
||||
}
|
||||
}
|
||||
onClicked:
|
||||
{
|
||||
appLoader.source = "OfferTable.qml"
|
||||
mitoBackie.border.width = 2
|
||||
dashiBackie.border.width = 1
|
||||
kundiBackie.border.width = 1
|
||||
invoBackie.border.width = 1
|
||||
objBackie.border.width = 1
|
||||
offersBackie.border.width = 1
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: abrechnung
|
||||
|
||||
208
Gui/UtilityDialogs.qml
Normal file
208
Gui/UtilityDialogs.qml
Normal file
@@ -0,0 +1,208 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
import QtCore
|
||||
import "../js/qmldict.js" as JsLib
|
||||
|
||||
Item
|
||||
{
|
||||
id: utilityDialogs
|
||||
property alias backup_config: backupConfig
|
||||
property alias backup_encrypt_pw: recoveryPasswordDialog
|
||||
|
||||
property var recpass
|
||||
property var configpass
|
||||
Dialog
|
||||
{
|
||||
|
||||
anchors.centerIn: parent
|
||||
id: backupConfig
|
||||
title: "Backup Config"
|
||||
standardButtons: Dialog.Apply | Dialog.Cancel
|
||||
|
||||
onApplied:
|
||||
{
|
||||
|
||||
if (configPwd.text === repeatConfigPwd.text)
|
||||
{
|
||||
configpass = repeatConfigPwd.text
|
||||
saveConfigFile.open()
|
||||
}
|
||||
else
|
||||
{
|
||||
configPwd.text = ""
|
||||
configPwd.placeholderText = qsTr("Passwort stimmt nicht überein")
|
||||
configPwd.placeholderTextColor = "red"
|
||||
repeatConfigPwd.placeholderText = qsTr("")
|
||||
repeatConfigPwd.text = ""
|
||||
}
|
||||
}
|
||||
onRejected: resetRecoveryConfigDialog()
|
||||
GridLayout
|
||||
{
|
||||
id: gridPw
|
||||
columns: 2
|
||||
Label
|
||||
{
|
||||
text: qsTr("Passwort eingeben")
|
||||
}
|
||||
TextField
|
||||
{
|
||||
|
||||
id: configPwd
|
||||
placeholderText: qsTr("Sicherungspasswort festlegen")
|
||||
echoMode: TextInput.Password
|
||||
implicitWidth: 300
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Passwort wiederholen")
|
||||
}
|
||||
TextField
|
||||
{
|
||||
property string name: "password"
|
||||
id: repeatConfigPwd
|
||||
placeholderText: qsTr("Sicherungspasswort wiederholen")
|
||||
echoMode: TextInput.Password
|
||||
implicitWidth: 300
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: saveConfigFile
|
||||
fileMode: FileDialog.SaveFile
|
||||
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
|
||||
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
||||
onAccepted:
|
||||
{
|
||||
config.backupConfig(saveConfigFile.currentFile, configpass)
|
||||
}
|
||||
onRejected:
|
||||
{
|
||||
backupConfig.close()
|
||||
resetRecoveryConfigDialog()
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: recoveryDialog
|
||||
|
||||
text: qsTr("Diesen Wiederherstellungscode musst du sicher aufbewahren!\nMöchtest du das jetzt machen?")
|
||||
title: qsTr("Wiederherstellen")
|
||||
buttons: MessageDialog.Yes | MessageDialog.No
|
||||
onAccepted: recoveryPasswordDialog.open()
|
||||
onRejected: gotoLogin()
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: conErrDialog
|
||||
text: qsTr("Datenbankverbindung fehlgeschlagen")
|
||||
title: qsTr("Datenbank Verbindung")
|
||||
}
|
||||
|
||||
Dialog
|
||||
{
|
||||
|
||||
id: recoveryPasswordDialog
|
||||
modal: true
|
||||
title: qsTr("Wiederherstellung")
|
||||
anchors.centerIn: parent
|
||||
standardButtons: Dialog.Apply | Dialog.Cancel
|
||||
onApplied:
|
||||
{
|
||||
if (recoveryPasswordInput.text === repeatRecoveryPasswordInput.text)
|
||||
{
|
||||
recpass = recoveryPasswordInput.text
|
||||
saveRecoveryDialog.open()
|
||||
}
|
||||
else
|
||||
{
|
||||
recoveryPasswordInput.text = ""
|
||||
recoveryPasswordInput.placeholderText = qsTr("Passwort stimmt nicht überein")
|
||||
recoveryPasswordInput.placeholderTextColor = "red"
|
||||
repeatRecoveryPasswordInput.placeholderText = qsTr("")
|
||||
repeatRecoveryPasswordInput.text = ""
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: resetRecoveryPwDialog()
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
GridLayout
|
||||
{
|
||||
columns: 2
|
||||
Label
|
||||
{
|
||||
text: qsTr("Wiederherstellungspasswort festlegen: ")
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: recoveryPasswordInput
|
||||
text: ""
|
||||
echoMode: TextInput.Password
|
||||
implicitWidth: 300
|
||||
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Wiederherstellungspasswort wiederholen: ")
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: repeatRecoveryPasswordInput
|
||||
text: ""
|
||||
echoMode: TextInput.Password
|
||||
implicitWidth: 300
|
||||
placeholderText: qsTr("Hier Wiederherstellungspasswort wiederholen")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: saveRecoveryDialog
|
||||
title: qsTr("Wiederherstellungsdatei")
|
||||
fileMode: FileDialog.SaveFile
|
||||
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
|
||||
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
||||
onAccepted:
|
||||
{
|
||||
config.backupEncryptkey(saveRecoveryDialog.currentFile, recpass)
|
||||
}
|
||||
|
||||
onRejected:
|
||||
{
|
||||
recoveryPasswordDialog.close()
|
||||
resetRecoveryPwDialog()
|
||||
}
|
||||
}
|
||||
|
||||
function resetRecoveryPwDialog()
|
||||
{
|
||||
recoveryPasswordInput.text = ""
|
||||
recoveryPasswordInput.placeholderText = qsTr("Hier Wiederherstellungspasswort eingeben")
|
||||
recoveryPasswordInput.placeholderTextColor = repeatRecoveryPasswordInput.placeholderTextColor
|
||||
repeatRecoveryPasswordInput.text = ""
|
||||
repeatRecoveryPasswordInput.placeholderText = qsTr("Hier Wiederherstellungspasswort wiederholen")
|
||||
}
|
||||
|
||||
function resetRecoveryConfigDialog()
|
||||
{
|
||||
configPwd.text = ""
|
||||
configPwd.placeholderText = qsTr("Hier Wiederherstellungspasswort eingeben")
|
||||
configPwd.placeholderTextColor = repeatConfigPwd.placeholderTextColor
|
||||
repeatConfigPwd.text = ""
|
||||
repeatConfigPwd.placeholderText = qsTr("Hier Wiederherstellungspasswort wiederholen")
|
||||
}
|
||||
}
|
||||
10
Gui/main.qml
10
Gui/main.qml
@@ -62,6 +62,7 @@ ApplicationWindow
|
||||
property alias window: appWindow
|
||||
}
|
||||
|
||||
|
||||
Dialog
|
||||
{
|
||||
id: importDialog
|
||||
@@ -117,7 +118,9 @@ ApplicationWindow
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
config.configurationReady.connect(goToLogin)
|
||||
systray.activated.connect(showWindow)
|
||||
|
||||
if(bad_config)
|
||||
{
|
||||
importDialog.open()
|
||||
@@ -129,6 +132,7 @@ ApplicationWindow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showWindow(why)
|
||||
{
|
||||
if (why === 3)
|
||||
@@ -153,4 +157,10 @@ ApplicationWindow
|
||||
console.log("Main window closed!! Was soll ich tun? kann ich mich beenden?!")
|
||||
}
|
||||
}
|
||||
|
||||
function goToLogin()
|
||||
{
|
||||
appLoader.source= "LoginScreen.qml"
|
||||
topBar.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user