Added sound notification for login failure and custom font for the login
gui
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -227,3 +227,4 @@ cython_debug/
|
||||
.directory
|
||||
|
||||
|
||||
rc_*.py
|
||||
|
||||
@@ -6,31 +6,72 @@ import QtQuick.Layouts
|
||||
Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
FontLoader
|
||||
{
|
||||
id: helloStranger
|
||||
source: "qrc:/fonts/HelloStranger.otf"
|
||||
}
|
||||
|
||||
FontLoader
|
||||
{
|
||||
id: damarWulan
|
||||
source: "qrc:/fonts/Damarwulan.ttf"
|
||||
}
|
||||
|
||||
FontLoader
|
||||
{
|
||||
id: hussarPrint
|
||||
source: "qrc:/fonts/HussarPrintA.otf"
|
||||
}
|
||||
|
||||
FontLoader
|
||||
{
|
||||
id: reginaldScript
|
||||
source: "qrc:/fonts/ReginaldScript.ttf"
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
height: 150
|
||||
height: 65
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr ("Login")
|
||||
font.pixelSize: 49
|
||||
font.family: helloStranger.font.family
|
||||
font.weight: helloStranger.font.weight
|
||||
font.styleName: helloStranger.font.styleName
|
||||
font.pixelSize: 89
|
||||
font.bold: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
height: 25
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 15
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr ("Benutzername")
|
||||
minimumPixelSize: 20
|
||||
Layout.preferredWidth: 150
|
||||
horizontalAlignment: Text.AlignRight
|
||||
|
||||
font.family: damarWulan.font.family
|
||||
font.weight: damarWulan.font.weight
|
||||
font.styleName: damarWulan.font.styleName
|
||||
font.pixelSize: 21
|
||||
}
|
||||
|
||||
TextField
|
||||
@@ -38,6 +79,7 @@ Item
|
||||
id: benutzerName
|
||||
placeholderText: qsTr ("Benutzernamen eingeben")
|
||||
implicitWidth: 300
|
||||
font: hussarPrint.font
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,12 +87,16 @@ Item
|
||||
{
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 15
|
||||
|
||||
Label
|
||||
{
|
||||
minimumPixelSize: 20
|
||||
Layout.preferredWidth: 150
|
||||
text: qsTr ("Passwort")
|
||||
|
||||
font.family: damarWulan.font.family
|
||||
font.weight: damarWulan.font.weight
|
||||
font.styleName: damarWulan.font.styleName
|
||||
font.pixelSize: 21
|
||||
horizontalAlignment: Text.AlignRight
|
||||
}
|
||||
|
||||
@@ -59,17 +105,21 @@ Item
|
||||
id: passwort
|
||||
placeholderText: qsTr ("Passwort eingeben")
|
||||
implicitWidth: 300
|
||||
font: hussarPrint.font
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
Layout.preferredWidth: 465
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
Button
|
||||
{
|
||||
text: qsTr ("Feierabend für heute!")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font: reginaldScript.font
|
||||
onClicked:
|
||||
{
|
||||
if (benutzerName.text.trim() && passwort.text.trim())
|
||||
@@ -84,10 +134,12 @@ Item
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
loggedin_user.loginOkay.connect(loggedin)
|
||||
}
|
||||
|
||||
function loggedin()
|
||||
{
|
||||
appLoader.source = "Dashboard.qml"
|
||||
|
||||
BIN
fonts/BeautifulPeople.ttf
Normal file
BIN
fonts/BeautifulPeople.ttf
Normal file
Binary file not shown.
BIN
fonts/Damarwulan.ttf
Normal file
BIN
fonts/Damarwulan.ttf
Normal file
Binary file not shown.
BIN
fonts/HelloStranger.otf
Normal file
BIN
fonts/HelloStranger.otf
Normal file
Binary file not shown.
BIN
fonts/HussarPrintA.otf
Normal file
BIN
fonts/HussarPrintA.otf
Normal file
Binary file not shown.
BIN
fonts/LittleBirdsRegular.ttf
Normal file
BIN
fonts/LittleBirdsRegular.ttf
Normal file
Binary file not shown.
BIN
fonts/ReginaldScript.ttf
Normal file
BIN
fonts/ReginaldScript.ttf
Normal file
Binary file not shown.
@@ -1,10 +1,9 @@
|
||||
from .DbManager import DbManager
|
||||
from ..PyqcrmFlags import PyqcrmFlags
|
||||
from ..Vermasseln import Vermasseln
|
||||
import mariadb
|
||||
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
||||
from .UserDAO import UserDAO
|
||||
from PySide6.QtCore import Slot, QObject, Signal
|
||||
|
||||
from PySide6.QtCore import Slot, QObject, Signal, QUrl
|
||||
|
||||
|
||||
class UserManager(QObject):
|
||||
@@ -53,11 +52,18 @@ class UserManager(QObject):
|
||||
user = UserDAO().getUser(username)
|
||||
if user:
|
||||
self.__checkPassword(password, user[2])
|
||||
else:
|
||||
player = QMediaPlayer(self)
|
||||
audioOutput = QAudioOutput(self)
|
||||
player.setAudioOutput(audioOutput)
|
||||
player.setSource(QUrl("qrc:/sounds/fail2c.ogg"))
|
||||
audioOutput.setVolume(150)
|
||||
player.play()
|
||||
|
||||
def __checkPassword(self, password, hash_password):
|
||||
pwList = hash_password.split("$")
|
||||
pw_list = hash_password.split("$")
|
||||
|
||||
hash_Pw = Vermasseln.userPasswordHash(password, pwList[0])
|
||||
if hash_password == hash_Pw:
|
||||
hash_pw = Vermasseln.userPasswordHash(password, pw_list[0])
|
||||
if hash_password == hash_pw:
|
||||
self.loginOkay.emit()
|
||||
|
||||
|
||||
10
pyqcrm.qrc
10
pyqcrm.qrc
@@ -7,5 +7,15 @@
|
||||
<file>images/filter.svg</file>
|
||||
<file>images/menu.svg</file>
|
||||
<file>images/search.svg</file>
|
||||
<file>sounds/error.ogg</file>
|
||||
<file>sounds/fail2c.ogg</file>
|
||||
<file>sounds/puzzerr.ogg</file>
|
||||
<file>sounds/sysnotify.ogg</file>
|
||||
<file>sounds/wrong.ogg</file>
|
||||
<file>fonts/Damarwulan.ttf</file>
|
||||
<file>fonts/HelloStranger.otf</file>
|
||||
<file>fonts/HussarPrintA.otf</file>
|
||||
<file>fonts/LittleBirdsRegular.ttf</file>
|
||||
<file>fonts/ReginaldScript.ttf</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
34080
rc_pyqcrm.py
34080
rc_pyqcrm.py
File diff suppressed because it is too large
Load Diff
BIN
sounds/error.aac
Normal file
BIN
sounds/error.aac
Normal file
Binary file not shown.
BIN
sounds/error.ac3
Normal file
BIN
sounds/error.ac3
Normal file
Binary file not shown.
BIN
sounds/error.mp3
Normal file
BIN
sounds/error.mp3
Normal file
Binary file not shown.
BIN
sounds/error.ogg
Normal file
BIN
sounds/error.ogg
Normal file
Binary file not shown.
BIN
sounds/error.wav
Normal file
BIN
sounds/error.wav
Normal file
Binary file not shown.
BIN
sounds/fail2c.ogg
Normal file
BIN
sounds/fail2c.ogg
Normal file
Binary file not shown.
BIN
sounds/puzzerr.ogg
Normal file
BIN
sounds/puzzerr.ogg
Normal file
Binary file not shown.
BIN
sounds/sysnotify.ogg
Normal file
BIN
sounds/sysnotify.ogg
Normal file
Binary file not shown.
BIN
sounds/wrong.ogg
Normal file
BIN
sounds/wrong.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user