Switch to MariaDB connector and Create UserManager Class
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import "../js/qmldict.js" as Qmldict
|
||||
|
||||
@@ -22,6 +23,66 @@ import "../js/qmldict.js" as Qmldict
|
||||
|
||||
Item
|
||||
{
|
||||
Component.onCompleted:
|
||||
{
|
||||
config.dbConnectionError.connect(onDbConnectionError)
|
||||
config.adminUserError.connect(onAdminUserError)
|
||||
}
|
||||
|
||||
function onDbConnectionError(msg, success)
|
||||
{
|
||||
if (!success)
|
||||
conErrDialog.open()
|
||||
}
|
||||
|
||||
function onAdminUserError(msg, success)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
encryptPwDialog.open()
|
||||
}
|
||||
else
|
||||
firstStart.push("AdminUserConfig.qml")
|
||||
}
|
||||
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: conErrDialog
|
||||
text: qsTr("Datenbankverbindung fehlgeschlagen")
|
||||
|
||||
title: qsTr("Datenbank Verbindung")
|
||||
|
||||
|
||||
}
|
||||
Dialog
|
||||
{
|
||||
id: encryptPwDialog
|
||||
modal: true
|
||||
title: qsTr("Encryption Key")
|
||||
anchors.centerIn: parent
|
||||
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||
onAccepted: config.setEncyrptKey(encryptPassword.text)
|
||||
ColumnLayout
|
||||
{
|
||||
RowLayout
|
||||
{
|
||||
Label
|
||||
{
|
||||
text: qsTr("Encryption Key eingeben:")
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: encryptPassword
|
||||
echoMode: TextInput.Password
|
||||
implicitWidth: 300
|
||||
placeholderText: qsTr("Hier Encryption Key eingeben")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
StackView
|
||||
{
|
||||
@@ -66,14 +127,7 @@ Item
|
||||
if (pyqcrm_conf)
|
||||
{
|
||||
admin = config.setConfig(pyqcrm_conf)
|
||||
if (admin)
|
||||
{
|
||||
firstStart.push("EncryptionKey.qml")
|
||||
}
|
||||
else
|
||||
{
|
||||
firstStart.push("AdminUserConfig.qml")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user