mirror of
https://github.com/QuasarApp/QMLLoginView.git
synced 2025-05-09 07:59:46 +00:00
Compare commits
82 Commits
Author | SHA1 | Date | |
---|---|---|---|
0b7ded4df1 | |||
|
45d76e789f | ||
acc385d2a8 | |||
d999706ca9 | |||
028aabc2d3 | |||
73ca7f0575 | |||
c27181745f | |||
97b3cc41f4 | |||
ec0d9a9904 | |||
|
055445ac2b | ||
32b2c94fad | |||
|
abe0f7b109 | ||
d7e974ac05 | |||
2639d7047c | |||
76206fcc78 | |||
d2ab2cadf1 | |||
b8f8533299 | |||
c94a2a6f87 | |||
dd2df72542 | |||
7fe512a956 | |||
5fbdba9809 | |||
5d5ee2c0be | |||
9dbd6d3c20 | |||
92df551d6d | |||
3922d2a719 | |||
8e487c3185 | |||
53675cea55 | |||
3891e09dcf | |||
2d960bc8d7 | |||
4a5ddcc5df | |||
cb531b1515 | |||
375ff0a831 | |||
7f0ab573ee | |||
9781352129 | |||
5bf60d6e24 | |||
0361f5af90 | |||
1facc66231 | |||
b0bcedff67 | |||
0c656ffd95 | |||
|
5b60b04806 | ||
b1fb5e968b | |||
|
96a57dcd4c | ||
e36b7daa80 | |||
6b07c5b5d5 | |||
8f98ddec2e | |||
ec3b79f2f8 | |||
dad94bc0d3 | |||
c460318dac | |||
d790a8fd18 | |||
04683b4e0e | |||
70caf44b5a | |||
c63cefdd29 | |||
46ce247ec1 | |||
de73dc31bf | |||
590f73aa1a | |||
b61055a5e7 | |||
688e3aec80 | |||
d2a502fc78 | |||
98b62f49d9 | |||
3c6156d3e9 | |||
9758ca17cd | |||
357f6968b9 | |||
6fcea9fb9f | |||
c8a02e66f1 | |||
c7e1992ed1 | |||
0ec27ac102 | |||
883271c38a | |||
491665cd0f | |||
3a056d66c5 | |||
9b4842846a | |||
5f1de16eff | |||
a3c1dce2df | |||
36ae53f1be | |||
3d36acb3f2 | |||
42d84d1b02 | |||
5f5ba40e09 | |||
ce8e1688b3 | |||
d9e132a257 | |||
38da1906ed | |||
7764d07612 | |||
206bf5d13c | |||
8a2775291b |
.gitignore.gitmodulesCMakeCMakeLists.txt
LoginView
CMakeLists.txt
README.mddoxygen.confsrc
LoginViewModule
LVMButton.qmlLVMCheckBox.qmlLVMComboBox.qmlLVMHeader.qmlLVMSwitch.qmlLVMTextInput.qmlLoginView.qmlLoginViewDialog.qmlMetrix.qmlValidatIonIndicator.qmlqmldir
countrysparser.cppcountrysparser.hloginview_global.hlv_languages
lv_res.qrclvmainmodel.cpplvmainmodel.huserdata.cppuserdata.huserviewvalidationdata.cppuserviewvalidationdata.hviewcomponents.cppviewcomponents.hexample
plug.prores
3
.gitignore
vendored
3
.gitignore
vendored
@ -46,6 +46,9 @@ target_wrapper.*
|
||||
|
||||
# QtCreator CMake
|
||||
CMakeLists.txt.user*
|
||||
CMakeFiles
|
||||
*_autogen
|
||||
cmake_install.cmake
|
||||
|
||||
# QtCreator 4.8< compilation database
|
||||
compile_commands.json
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "CMake"]
|
||||
path = CMake
|
||||
url = https://github.com/QuasarApp/CMake.git
|
1
CMake
Submodule
1
CMake
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit cd05493c3a43b04f26c3e3432df4283eb4509d8c
|
@ -1,32 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 QuasarApp.
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# Everyone is permitted to copy and distribute verbatim copies
|
||||
# of this license document, but changing it is not allowed.
|
||||
#
|
||||
|
||||
if(DEFINED PROJECT_OUT_SUPPORT)
|
||||
return()
|
||||
else()
|
||||
set(PROJECT_OUT_SUPPORT 1)
|
||||
endif()
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE Release)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
SET(LIB_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE})
|
||||
|
||||
message("${} LIB_OUTPUT_DIR = ${LIB_OUTPUT_DIR}")
|
||||
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}/bin)
|
||||
|
||||
message(STATUS "buid type " ${CMAKE_BUILD_TYPE})
|
||||
message(STATUS "Project " ${PROJECT_NAME})
|
||||
message(STATUS "c compiler " ${CMAKE_C_COMPILER})
|
||||
message(STATUS "cxx compiler " ${CMAKE_CXX_COMPILER})
|
||||
message(STATUS "build shared " ${BUILD_SHARED_LIBS})
|
||||
message(STATUS "qmake exec " ${QT_QMAKE_EXECUTABLE})
|
@ -1,14 +1,46 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 QuasarApp.
|
||||
# Copyright (C) 2018-2021 QuasarApp.
|
||||
# Distributed under the lgplv3 software license, see the accompanying
|
||||
# Everyone is permitted to copy and distribute verbatim copies
|
||||
# of this license document, but changing it is not allowed.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(LoginViewMain)
|
||||
project(LoginView LANGUAGES CXX)
|
||||
if(TARGET ${PROJECT_NAME})
|
||||
message("The ${PROJECT_NAME} arledy included in main Project")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
if (NOT DEFINED LOGINVIEW_EXAMPLES)
|
||||
set(LOGINVIEW_EXAMPLES ON)
|
||||
|
||||
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
|
||||
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
|
||||
set(LOGINVIEW_EXAMPLES OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(LOGINVIEW_EXAMPLES OFF)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
include(CMake/QuasarApp.cmake)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick Xml REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick Xml REQUIRED)
|
||||
|
||||
# Add sub directories
|
||||
add_subdirectory(LoginView)
|
||||
add_subdirectory(example)
|
||||
|
||||
if (LOGINVIEW_EXAMPLES)
|
||||
add_subdirectory(example)
|
||||
endif()
|
||||
|
||||
|
||||
initAll()
|
||||
|
||||
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
# Distributed under the lgplv3 software license, see the accompanying
|
||||
# Everyone is permitted to copy and distribute verbatim copies
|
||||
# of this license document, but changing it is not allowed.
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(LoginView LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
@ -17,18 +16,27 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_definitions(-DLOGIN_VIEW_LIBRARY)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/ProjectOut.cmake)
|
||||
|
||||
find_package(Qt5 COMPONENTS Core Quick Xml REQUIRED)
|
||||
|
||||
file(GLOB SOURCE_CPP "src/*.cpp" "src/*.qrc")
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCE_CPP})
|
||||
add_library(${PROJECT_NAME} ${SOURCE_CPP})
|
||||
|
||||
target_compile_definitions(LoginView
|
||||
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core Qt5::Quick Qt5::Xml)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Xml)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
set(QML_IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "Qt Creator extra qml import paths")
|
||||
set(LANGS ${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/en.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/ru.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/ja.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/tr.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/uk.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/zh.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/de.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/fr.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/es.ts
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/pl.ts)
|
||||
|
||||
prepareQM( ${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} "${LANGS}")
|
||||
|
||||
set(QML_IMPORT_PATH ${QML_IMPORT_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "" FORCE)
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -10,43 +10,48 @@ import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Universal 2.12
|
||||
import QtQuick.Window 2.12
|
||||
|
||||
Control {
|
||||
|
||||
height: 110
|
||||
height: layout.height + 15
|
||||
|
||||
property string title: ""
|
||||
property string help: ""
|
||||
property bool lightMode: themeSwitch.lightMode
|
||||
property string title: ""
|
||||
property bool withTitle: false
|
||||
|
||||
clip: true
|
||||
|
||||
Metrix{
|
||||
id: metrix
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
LVMSwitch {
|
||||
id: themeSwitch
|
||||
text: qsTr("Light theme");
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.preferredHeight: 30
|
||||
}
|
||||
|
||||
id: layout
|
||||
Label {
|
||||
id: title_txt
|
||||
text: title;
|
||||
font.pixelSize: 24
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.fillWidth: true
|
||||
|
||||
font.capitalization: Font.AllUppercase
|
||||
font.bold: true
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
|
||||
visible: withTitle
|
||||
}
|
||||
|
||||
Label {
|
||||
id: help_txt
|
||||
wrapMode: Text.WordWrap
|
||||
text: help;
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
anchors.leftMargin: 15
|
||||
anchors.bottomMargin: 30
|
||||
spacing: 15
|
||||
|
||||
}
|
||||
|
||||
@ -55,13 +60,15 @@ Control {
|
||||
color: "#bdb9bb"
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 15
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 15
|
||||
anchors.leftMargin: 0
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 15
|
||||
anchors.rightMargin: 0
|
||||
visible: withTitle
|
||||
anchors.topMargin: 15
|
||||
|
||||
}
|
||||
anchors.bottomMargin: 15
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,94 +1,90 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Universal 2.12
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls.Material 2.15
|
||||
import QtQuick.Controls.Universal 2.15
|
||||
|
||||
Page {
|
||||
|
||||
height: 500
|
||||
width: 400
|
||||
id: root;
|
||||
|
||||
header: LVMHeader{
|
||||
id: header
|
||||
title: (conntent.isRegisterNewUser)? qsTr("Sign Up"): qsTr("Login In")
|
||||
help: (conntent.isRegisterNewUser)? qsTr('please fill this form to create an account'):
|
||||
qsTr('please fill this form to login in your account')
|
||||
withTitle: privateRoot.withTitle
|
||||
title: (privateRoot.isRegisterNewUser)? qsTr("Create a new account"): qsTr("LogIn")
|
||||
help: (privateRoot.isRegisterNewUser)? qsTr('Please fill this form to create an account'):
|
||||
qsTr('Please fill this form to login in your account')
|
||||
}
|
||||
|
||||
property bool lightMode: header.lightMode
|
||||
property var lognViewModel: null
|
||||
property bool registerNewUser: true
|
||||
property bool singleColumn: privateRoot.widgetsCount <= 1
|
||||
|
||||
Material.theme: (lightMode)? Material.Light: Material.Dark
|
||||
Material.accent: (lightMode)? Material.LightBlue: Material.Orange
|
||||
Universal.theme: (lightMode)? Material.Light: Material.Dark
|
||||
Universal.accent: (lightMode)? Material.LightBlue: Material.Orange
|
||||
signal loginClicked(var isregister);
|
||||
|
||||
contentItem:
|
||||
Item {
|
||||
id: conntent
|
||||
property bool isRegisterNewUser: tabBar.currentIndex
|
||||
property var errors: (lognViewModel)? lognViewModel.validationData : null
|
||||
function clear() {
|
||||
|
||||
countryInput.currentIndex = -1
|
||||
pass1.text = ""
|
||||
pass2.text = ""
|
||||
termOfUse.checked = false
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: lognViewModel
|
||||
function clearView () {
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
|
||||
Flickable {
|
||||
contentWidth: content.width
|
||||
contentHeight: content.height
|
||||
clip: true
|
||||
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
|
||||
ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AsNeeded }
|
||||
GridLayout {
|
||||
|
||||
rows: 8
|
||||
columns: 2
|
||||
rowSpacing: 15
|
||||
columnSpacing: 15
|
||||
|
||||
id: content
|
||||
|
||||
function paswordValidation() {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.data.rawPassword = pass1.text;
|
||||
}
|
||||
pass1.hasEdited = true
|
||||
|
||||
if (!conntent.isRegisterNewUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
pass2.hasError = false;
|
||||
pass2.tooltip = "";
|
||||
|
||||
if (pass1.text != pass2.text || pass1.length <= 0) {
|
||||
pass2.hasError = true;
|
||||
pass2.hasEdited = true;
|
||||
pass2.tooltip = qsTr("Password must match the 1st field and the password cannot be empty");
|
||||
}
|
||||
|
||||
}
|
||||
columns: (singleColumn)? 1: Math.floor(root.width / childWidth)
|
||||
width: root.width
|
||||
columnSpacing: 15
|
||||
rowSpacing: 0
|
||||
property int childWidth: firstNameInput.height * 4
|
||||
|
||||
LVMTextInput {
|
||||
id: firstNameInput
|
||||
placeholderText: qsTr("First Name")
|
||||
Layout.columnSpan: (content.width > 350)? 1 : 2;
|
||||
Layout.fillWidth: true
|
||||
visible: conntent.isRegisterNewUser
|
||||
tooltip: (hasError)? qsTr("Empy or incorrect name. Please enter yuor name."): ""
|
||||
hasError: (conntent.errors && conntent.errors.firstName);
|
||||
visible: privateRoot.isRegisterNewUser && privateRoot.firstName
|
||||
tooltip: (hasError)? qsTr("Empy or incorrect name. Please enter your name."): ""
|
||||
hasError: (privateRoot.errors && privateRoot.errors.firstName);
|
||||
onTextChanged: {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.data.firstName = text;
|
||||
}
|
||||
hasEdited = true
|
||||
}
|
||||
text: (lognViewModel)? lognViewModel.data.firstName: "";
|
||||
|
||||
}
|
||||
|
||||
LVMTextInput {
|
||||
id: lastNameInput
|
||||
|
||||
placeholderText: qsTr("Last Name")
|
||||
Layout.columnSpan: (content.width > 350)? 1 : 2;
|
||||
Layout.fillWidth: true
|
||||
visible: conntent.isRegisterNewUser
|
||||
hasError: (conntent.errors && conntent.errors.lastName);
|
||||
visible: privateRoot.isRegisterNewUser && privateRoot.lastName
|
||||
hasError: (privateRoot.errors && privateRoot.errors.lastName);
|
||||
|
||||
onTextChanged: {
|
||||
if (lognViewModel) {
|
||||
@ -97,27 +93,48 @@ Page {
|
||||
hasEdited = true
|
||||
|
||||
}
|
||||
text: (lognViewModel)? lognViewModel.data.lastName: "";
|
||||
|
||||
|
||||
}
|
||||
|
||||
Item {
|
||||
// separator
|
||||
Layout.preferredHeight: 0
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
Layout.columnSpan: Math.max(content.columns, 1)
|
||||
}
|
||||
|
||||
LVMComboBox {
|
||||
id: countryInput
|
||||
|
||||
placeholderText: qsTr("Select you country")
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
visible: conntent.isRegisterNewUser
|
||||
visible: privateRoot.isRegisterNewUser && model.length
|
||||
onCurrentIndexChanged: {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.data.country = lognViewModel.countryCodeList[currentIndex];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Item {
|
||||
// separator
|
||||
Layout.preferredHeight: 0
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
Layout.columnSpan: Math.max(content.columns, 1)
|
||||
}
|
||||
|
||||
|
||||
LVMTextInput {
|
||||
id: emailInput
|
||||
|
||||
placeholderText: qsTr("EMail")
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
hasError: (conntent.errors && conntent.errors.email);
|
||||
tooltip: (hasError)? qsTr("Empy or incorrect email address. Please enter yuor name.") : ""
|
||||
visible: privateRoot.email
|
||||
hasError: (privateRoot.errors && privateRoot.errors.email);
|
||||
tooltip: (hasError)? qsTr("Empty or incorrect email address. Please enter your name.") : ""
|
||||
onTextChanged: {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.data.email = text;
|
||||
@ -125,75 +142,68 @@ Page {
|
||||
hasEdited = true
|
||||
|
||||
}
|
||||
text: (lognViewModel)?lognViewModel.data.email: "";
|
||||
|
||||
}
|
||||
|
||||
LVMTextInput {
|
||||
id: nicknameInput
|
||||
|
||||
placeholderText: qsTr("Nickname")
|
||||
Layout.fillWidth: true
|
||||
visible: privateRoot.nickName
|
||||
hasError: (privateRoot.errors && privateRoot.errors.nickname);
|
||||
tooltip: (hasError)? qsTr("Empty or incorrect Nickname. Please enter your name.") : ""
|
||||
onTextChanged: {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.data.nickname = text;
|
||||
}
|
||||
hasEdited = true
|
||||
|
||||
}
|
||||
|
||||
text: (lognViewModel)? lognViewModel.data.nickname: "";
|
||||
|
||||
}
|
||||
|
||||
Item {
|
||||
// separator
|
||||
Layout.preferredHeight: 0
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: Math.max(content.columns, 1)
|
||||
}
|
||||
|
||||
LVMTextInput {
|
||||
id: pass1
|
||||
placeholderText: qsTr("Pasword")
|
||||
Layout.columnSpan: (conntent.isRegisterNewUser)? ((content.width > 350)? 1 : 2): 2;
|
||||
placeholderText: qsTr("password")
|
||||
Layout.fillWidth: true
|
||||
hasError: (conntent.errors && conntent.errors.rawPassword);
|
||||
hasError: (privateRoot.errors && privateRoot.errors.rawPassword);
|
||||
tooltip: (hasError)? lognViewModel.passwordError : ""
|
||||
onTextChanged: {
|
||||
content.paswordValidation()
|
||||
privateRoot.paswordValidation()
|
||||
}
|
||||
visible: privateRoot.password
|
||||
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
|
||||
LVMTextInput {
|
||||
id: pass2
|
||||
placeholderText: qsTr("Confirm pasword")
|
||||
Layout.columnSpan: (content.width > 350)? 1 : 2;
|
||||
placeholderText: qsTr("Confirm password")
|
||||
Layout.fillWidth: true
|
||||
visible: conntent.isRegisterNewUser
|
||||
visible: privateRoot.isRegisterNewUser && privateRoot.password
|
||||
|
||||
onTextChanged: {
|
||||
content.paswordValidation()
|
||||
privateRoot.paswordValidation()
|
||||
}
|
||||
echoMode: TextInput.Password
|
||||
|
||||
}
|
||||
|
||||
LVMCheckBox {
|
||||
id: termOfUse
|
||||
text: qsTr("I accept the Terms of use")
|
||||
Layout.columnSpan: (content.width > 350)? 1 : 2;
|
||||
Layout.fillWidth: true
|
||||
visible:conntent.isRegisterNewUser
|
||||
|
||||
}
|
||||
|
||||
LVMButton {
|
||||
text: qsTr("Show terms of use")
|
||||
visible: conntent.isRegisterNewUser
|
||||
onClicked: {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.showTermOfUseRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LVMButton {
|
||||
text: (conntent.isRegisterNewUser)? qsTr("Sign Up") : qsTr("Login In")
|
||||
visible: true
|
||||
enabled: (conntent.errors && conntent.errors.noError) &&
|
||||
((conntent.isRegisterNewUser)? !pass2.hasError && termOfUse.checked: true)
|
||||
|
||||
onClicked: {
|
||||
if (lognViewModel) {
|
||||
if (conntent.isRegisterNewUser) {
|
||||
lognViewModel.registerRequest();
|
||||
} else {
|
||||
lognViewModel.loginRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LVMButton {
|
||||
text: qsTr("Forgot password")
|
||||
visible: !conntent.isRegisterNewUser
|
||||
enabled: !(conntent.errors && conntent.errors.email)
|
||||
visible: !privateRoot.isRegisterNewUser
|
||||
enabled: !(privateRoot.errors && privateRoot.errors.email)
|
||||
|
||||
onClicked: {
|
||||
if (lognViewModel) {
|
||||
@ -201,25 +211,161 @@ Page {
|
||||
}
|
||||
}
|
||||
}
|
||||
anchors.bottomMargin: 40
|
||||
anchors.leftMargin: 20
|
||||
anchors.rightMargin: 20
|
||||
anchors.fill: parent
|
||||
|
||||
Item {
|
||||
// separator
|
||||
Layout.preferredHeight: 0
|
||||
Layout.fillWidth: true
|
||||
|
||||
Layout.columnSpan: Math.max(content.columns, 1)
|
||||
}
|
||||
|
||||
LVMCheckBox {
|
||||
id: termOfUse
|
||||
text: qsTr("I accept the Terms of use")
|
||||
Layout.fillWidth: true
|
||||
visible:privateRoot.isRegisterNewUser && privateRoot.termOfuse
|
||||
|
||||
}
|
||||
|
||||
LVMButton {
|
||||
text: qsTr("Show terms of use")
|
||||
visible: privateRoot.isRegisterNewUser && privateRoot.termOfuse
|
||||
onClicked: {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.showTermOfUseRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
// separator
|
||||
Layout.preferredHeight: 0
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.columnSpan: Math.max(content.columns, 1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
footer: TabBar {
|
||||
id: tabBar
|
||||
width: parent.width
|
||||
|
||||
currentIndex: registerNewUser
|
||||
TabButton {
|
||||
text: qsTr("Login In")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Sign Up")
|
||||
footer: ColumnLayout {
|
||||
LVMButton {
|
||||
text: privateRoot.acceptButtonText.length?
|
||||
privateRoot.acceptButtonText:
|
||||
(privateRoot.isRegisterNewUser)?
|
||||
qsTr("SignUp"):
|
||||
qsTr("LogIn")
|
||||
|
||||
visible: true
|
||||
enabled: privateRoot.enableAccept(privateRoot.errors, privateRoot.isRegisterNewUser,
|
||||
privateRoot.password, pass2.hasError, termOfUse.checked,
|
||||
privateRoot.termOfuse)
|
||||
onClicked: {
|
||||
if (lognViewModel) {
|
||||
if (privateRoot.isRegisterNewUser) {
|
||||
lognViewModel.registerRequest();
|
||||
} else {
|
||||
lognViewModel.loginRequest();
|
||||
}
|
||||
}
|
||||
loginClicked(privateRoot.isRegisterNewUser);
|
||||
}
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: tabBar
|
||||
|
||||
visible: privateRoot.loginPage && privateRoot.registerPage
|
||||
Layout.fillWidth: true
|
||||
currentIndex: privateRoot.pageToIndex(privateRoot.currentPage)
|
||||
TabButton {
|
||||
text: qsTr("Login In")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Sign Up")
|
||||
}
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
if (lognViewModel) {
|
||||
if (currentIndex)
|
||||
lognViewModel.setCurrentPage(ViewComponents.sigupPage)
|
||||
else
|
||||
lognViewModel.setCurrentPage(ViewComponents.loginPage)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
id: privateRoot;
|
||||
|
||||
// Private propertyes
|
||||
property bool isRegisterNewUser: pageSelector(tabBar.currentIndex, registerPage, loginPage)
|
||||
property var errors: (lognViewModel)? lognViewModel.validationData : null
|
||||
property bool withTitle: (lognViewModel)? lognViewModel.fTitle: false
|
||||
property bool lastName: (lognViewModel)? lognViewModel.fLastName: false
|
||||
property bool firstName: (lognViewModel)? lognViewModel.fFirstName: false
|
||||
property bool nickName: (lognViewModel)? lognViewModel.fNickname: false
|
||||
property bool email: (lognViewModel)? lognViewModel.fEMail: false
|
||||
property bool password: (lognViewModel)? lognViewModel.fPassword: false
|
||||
property bool loginPage: (lognViewModel)? lognViewModel.fLogin: false
|
||||
property bool registerPage: (lognViewModel)? lognViewModel.fRegister: false
|
||||
property bool termOfuse: (lognViewModel)? lognViewModel.fTermOfUse: false
|
||||
property int currentPage: (lognViewModel)? lognViewModel.currentPage: 0
|
||||
|
||||
property string acceptButtonText: (lognViewModel)? lognViewModel.acceptButtonText: false
|
||||
|
||||
property int widgetsCount: lastName + firstName + nickName + email + password + withTitle
|
||||
|
||||
function pageSelector(toolBarIndex, registerPage, loginPage) {
|
||||
if (registerPage && loginPage)
|
||||
return toolBarIndex;
|
||||
|
||||
return registerPage;
|
||||
}
|
||||
|
||||
function pageToIndex(currentPage) {
|
||||
return currentPage === ViewComponents.sigupPage
|
||||
}
|
||||
|
||||
function paswordValidation() {
|
||||
if (lognViewModel) {
|
||||
lognViewModel.data.rawPassword = pass1.text;
|
||||
}
|
||||
pass1.hasEdited = true
|
||||
|
||||
if (!privateRoot.isRegisterNewUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
pass2.hasError = false;
|
||||
pass2.tooltip = "";
|
||||
|
||||
if (pass1.text != pass2.text || pass1.length <= 0) {
|
||||
pass2.hasError = true;
|
||||
pass2.hasEdited = true;
|
||||
pass2.tooltip = qsTr("Password must match the 1st field and the password cannot be empty");
|
||||
}
|
||||
}
|
||||
|
||||
function enableAccept(errors, isRegisterNewUser, fShowPassword,
|
||||
passHasError, termOfUse, fShowTermOfUse) {
|
||||
|
||||
if (!(errors && errors.noError)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isRegisterNewUser && fShowPassword) {
|
||||
return !passHasError && (termOfUse || !fShowTermOfUse)
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
37
LoginView/src/LoginViewModule/LoginViewDialog.qml
Normal file
37
LoginView/src/LoginViewModule/LoginViewDialog.qml
Normal file
@ -0,0 +1,37 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Universal 2.12
|
||||
import QtQuick.Window 2.12
|
||||
|
||||
Popup {
|
||||
id: root
|
||||
property var lognViewModel: null
|
||||
property real point: metrix.pt
|
||||
property bool singleColumn: false
|
||||
|
||||
width: Math.max(5 * point, parent.width * 0.5)
|
||||
height: Math.max(4 * point, parent.height * 0.5)
|
||||
|
||||
x: parent.width / 2 - width / 2
|
||||
y: parent.height / 2 - height / 2
|
||||
|
||||
Metrix {
|
||||
id: metrix
|
||||
}
|
||||
|
||||
contentItem: LoginView {
|
||||
id: source
|
||||
lognViewModel: root.lognViewModel
|
||||
singleColumn: root.singleColumn
|
||||
onLoginClicked: {
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
source.clear();
|
||||
}
|
||||
|
||||
}
|
40
LoginView/src/LoginViewModule/Metrix.qml
Normal file
40
LoginView/src/LoginViewModule/Metrix.qml
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2021 QuasarApp.
|
||||
* Distributed under the lgplv3 software license, see the accompanying
|
||||
* Everyone is permitted to copy and distribute verbatim copies
|
||||
* of this license document, but changing it is not allowed.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls.Material 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
readonly property int pointCount: 100;
|
||||
readonly property real mm: Screen.pixelDensity
|
||||
readonly property real sm: 10 * mm
|
||||
readonly property real dsm: Math.sqrt(Math.pow(Screen.desktopAvailableWidth, 2) + Math.pow(Screen.desktopAvailableHeight, 2)) / sm
|
||||
readonly property real pt: getfactor(dsm) * sm
|
||||
readonly property real controlPtMaterial: Material.buttonHeight
|
||||
readonly property real gamePt: (width < height) ? width / pointCount : height / pointCount;
|
||||
readonly property real fontPoints: textMetrics.averageCharacterWidth;
|
||||
|
||||
function getfactor(dsm) {
|
||||
if ( dsm < 70) {
|
||||
return 1
|
||||
} else if (dsm < 140) {
|
||||
return 2;
|
||||
} else
|
||||
return 4;
|
||||
}
|
||||
|
||||
FontMetrics {
|
||||
id: textMetrics
|
||||
font.bold: true
|
||||
font.capitalization: Font.AllUppercase
|
||||
|
||||
}
|
||||
|
||||
anchors.fill: parent;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,2 +1,3 @@
|
||||
module LoginViewModule
|
||||
LoginView 1.0 LoginView.qml
|
||||
LoginViewDialog 1.0 LoginViewDialog.qml
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -41,7 +41,7 @@ bool CountrysParser::parseXMLSource(const QString &xmlFile, QHash<int, QString>
|
||||
break;
|
||||
}
|
||||
|
||||
if (token == QXmlStreamReader::StartElement && xml.name() == "countries") {
|
||||
if (token == QXmlStreamReader::StartElement && xml.name() == QString("countries")) {
|
||||
success = parseCountries(xml, result);
|
||||
break;
|
||||
}
|
||||
@ -81,20 +81,20 @@ bool CountrysParser::parseCountry(QXmlStreamReader& xml, QHash<int, QString>& re
|
||||
|
||||
int code = 0;
|
||||
QString name;
|
||||
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == "country")) {
|
||||
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == QString("country"))) {
|
||||
|
||||
if (!isValidItem(xml)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == "code") {
|
||||
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == QString("code")) {
|
||||
code = getCode(xml);
|
||||
if (code < 0) {
|
||||
qDebug() << "error parse, code of country is invalid: line "
|
||||
<< xml.lineNumber();
|
||||
return false;
|
||||
}
|
||||
} else if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == "name") {
|
||||
} else if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == QString("name")) {
|
||||
name = getName(xml);
|
||||
if (name.isEmpty()) {
|
||||
qDebug() << "error parse, name of country is empty: line "
|
||||
@ -113,13 +113,13 @@ bool CountrysParser::parseCountries(QXmlStreamReader &xml, QHash<int, QString>&
|
||||
if (xml.tokenType() != QXmlStreamReader::StartElement)
|
||||
return false;
|
||||
|
||||
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == "countries")) {
|
||||
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == QString("countries"))) {
|
||||
|
||||
if (!isValidItem(xml)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == "country" && !parseCountry(xml, result)) {
|
||||
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == QString("country") && !parseCountry(xml, result)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
|
@ -1,12 +1,12 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#ifndef NOTIFYSERVICE_GLOBAL_H
|
||||
#define NOTIFYSERVICE_GLOBAL_H
|
||||
#ifndef LOGINVIEW_GLOBAL_H
|
||||
#define LOGINVIEW_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
@ -17,4 +17,4 @@
|
||||
#endif
|
||||
|
||||
|
||||
#endif // NOTIFYSERVICE_GLOBAL_H
|
||||
#endif // LOGINVIEW_GLOBAL_H
|
||||
|
118
LoginView/src/lv_languages/de.ts
Normal file
118
LoginView/src/lv_languages/de.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE" sourcelanguage="en">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Ein neues Konto erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Anmeldung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Bitte füllen Sie dieses Formular aus, um ein Konto zu erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Bitte füllen Sie dieses Formular aus, um sich in Ihrem Konto anzumelden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>Vorname</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Leerer oder falscher Name. Bitte geben Sie Ihren Namen ein.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Nachname</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Wählen Sie Ihr Land aus</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>Email</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Leere oder falsche E-Mail-Adresse. Bitte geben Sie Ihren Namen ein.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Spitzname</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Leerer oder falscher Spitzname. Bitte geben Sie Ihren Namen ein.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>Passwort</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Kennwort bestätigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Passwort vergessen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>Ich akzeptiere die Nutzungsbedingungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Nutzungsbedingungen anzeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>Anmeldung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Einloggen in</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Anmeldung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Das Passwort muss mit dem 1. Feld übereinstimmen und das Passwort darf nicht leer sein</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>muss länger als 8 Zeichen sein</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>muss Zahlen enthalten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>muss kleine Zeichen enthalten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>muss große Zeichen enthalten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>muss zusätzliche Zeichen enthalten (!@#$%^&*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Passwortanforderungen:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/en.ts
Normal file
118
LoginView/src/lv_languages/en.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Create a new account</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>LogIn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Please fill this form to create an account</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Please fill this form to login in your account</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>First Name</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Last Name</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Select you country</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>EMail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Nickname</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Empy or incorrect name. Please enter your name.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Empty or incorrect email address. Please enter your name.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Empty or incorrect Nickname. Please enter your name.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>password</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Confirm password</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Forgot password</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>I accept the Terms of use</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Show terms of use</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>SignUp</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Login In</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Sign Up</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Password must match the 1st field and the password cannot be empty</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>must be longer than 8 characters</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>must contain numbers</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>must contain small chars</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>must contain large chars</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>must contain extra chars (!@#$%^&*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Password requirements: </translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/es.ts
Normal file
118
LoginView/src/lv_languages/es.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="es" sourcelanguage="en">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Crea una cuenta nueva</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Acceso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Por favor complete este formulario para crear una cuenta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Complete este formulario para iniciar sesión en su cuenta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>Primer nombre</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Nombre vacío o incorrecto. Por favor, escriba su nombre.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Apellido</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Selecciona tu pais</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>Email</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Dirección de correo electrónico vacía o incorrecta. Por favor, escriba su nombre.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Apodo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Apodo vacío o incorrecto. Por favor, escriba su nombre.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>contraseña</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Confirmar Contraseña</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Se te olvidó tu contraseña</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>Acepto los términos de uso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Mostrar condiciones de uso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>Inscribirse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Iniciar sesión en</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Inscribirse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>La contraseña debe coincidir con el primer campo y la contraseña no puede estar vacía</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>debe tener más de 8 caracteres</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>debe contener números</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>debe contener caracteres pequeños</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>debe contener caracteres grandes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>debe contener caracteres adicionales (! @ # $% ^ & *)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Requisitos de contraseña:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/fr.ts
Normal file
118
LoginView/src/lv_languages/fr.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="fr_FR" sourcelanguage="en">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Créer un nouveau compte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Connexion</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Veuillez remplir ce formulaire pour créer un compte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Veuillez remplir ce formulaire pour vous connecter à votre compte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>Prénom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Nom vide ou incorrect. S'il vous plaît entrez votre nom.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Nom de famille</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Sélectionnez votre pays</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>E-mail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Adresse e-mail vide ou incorrecte. S'il vous plaît entrez votre nom.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Surnom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Pseudo vide ou incorrect. S'il vous plaît entrez votre nom.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>le mot de passe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Confirmez le mot de passe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Mot de passe oublié</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>J'accepte les conditions d'utilisation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Afficher les conditions d'utilisation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>S'inscrire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Se connecter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>S'inscrire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Le mot de passe doit correspondre au 1er champ et le mot de passe ne peut pas être vide</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>doit comporter plus de 8 caractères</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>doit contenir des chiffres</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>doit contenir de petits caractères</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>doit contenir de gros caractères</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>doit contenir des caractères supplémentaires (!@#$%^&*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Exigences de mot de passe :</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/ja.ts
Normal file
118
LoginView/src/lv_languages/ja.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="ja_JP">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>新しいアカウントを作成する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>ログインする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>アカウントを作成するには、このフォームに記入してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>アカウントにログインするには、このフォームに記入してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>ファーストネーム</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>苗字</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>国を選択してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>Eメール</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>ニックネーム</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>名前が空または正しくありません。 お名前を入力してください。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>空または間違ったメールアドレス。 お名前を入力してください。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>空または間違ったニックネーム。 お名前を入力してください。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>パスワード</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>パスワードを認証する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>パスワードをお忘れですか</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>利用規約に同意します</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>利用規約を表示する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>サインアップ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>ログイン</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>サインアップ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>パスワードは最初のフィールドと一致する必要があり、パスワードを空にすることはできません</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>8文字より長くする必要があります</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>数字が含まれている必要があります</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>小さな文字が含まれている必要があります</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>大きな文字が含まれている必要があります</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>追加の文字を含める必要があります(!@#$%^&*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>パスワード要件:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/pl.ts
Normal file
118
LoginView/src/lv_languages/pl.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="pl_PL" sourcelanguage="en">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Stwórz nowe konto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Zaloguj sie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Wypełnij ten formularz, aby utworzyć konto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Wypełnij ten formularz, aby zalogować się na swoje konto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>Imię</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Pusta lub nieprawidłowa nazwa. Proszę wpisać swoje imię.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Nazwisko</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Wybierz swój kraj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>E-mail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Pusty lub nieprawidłowy adres e-mail. Proszę wpisać swoje imię.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Przezwisko</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Pusty lub nieprawidłowy pseudonim. Proszę wpisać swoje imię.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>hasło</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Potwierdź hasło</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Zapomniałeś hasła</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>Akceptuję warunki użytkowania</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Pokaż warunki użytkowania</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>Zapisz się</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Zaloguj się</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Zapisz się</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Hasło musi pasować do pierwszego pola i hasło nie może być puste</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>musi być dłuższy niż 8 znaków</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>musi zawierać liczby</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>musi zawierać małe znaki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>musi zawierać duże znaki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>musi zawierać dodatkowe znaki (!@#$%^&*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Wymagania dotyczące hasła:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/ru.ts
Normal file
118
LoginView/src/lv_languages/ru.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="ru_RU">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Создать новый аккаунт</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Логин</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Пожалуйста, заполните эту форму, чтобы создать аккаунт</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Пожалуйста, заполните эту форму, чтобы войти в аккаунт</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>Имя</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Фамилия</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Выберите вашу страну</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>EMail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Никнейм</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Незаполненная строка или неподходящее имя.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Незаполненная строка или неверный email.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Незаполненная строка или некорректный никнейм.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>Пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Подтвердить Пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Забыл пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>Я принимаю условия использования</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Показать условия использования</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>Регистрация</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Войти</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Регистрация</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Пароль должен соответствовать 1-му полю, и не может быть пустым.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>Должен быть длиннее 8 символов</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>Должен содержать числа</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>Должен содержать строчные буквы</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>Должен содержать заглавные буквы</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>Должен содержать особые символы (! @ # $% ^ & *)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Требования к паролю:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/tr.ts
Normal file
118
LoginView/src/lv_languages/tr.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="tr_TR">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Yeni bir hesap oluştur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Oturum aç</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Lütfen bir hesap oluşturmak için bu formu doldurun</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Lütfen hesabınıza giriş yapmak için bu formu doldurun</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>İsim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Soyadı</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Ülkenizi seçin</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>EMail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Takma ad</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Boş veya yanlış isim. Lütfen adınızı giriniz.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>E-posta adresi boş veya yanlış. Lütfen adınızı giriniz.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Boş veya yanlış Takma ad. Lütfen adınızı giriniz.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>Parola</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Şifreyi Onayla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Parolanızı mı unuttunuz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>Kullanım şartlarını kabul ediyorum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Kullanım şartlarını göster</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>Kaydol</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Giriş yap</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Kaydol</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Parola 1. alanla eşleşmelidir ve parola boş olamaz</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>8 karakterden uzun olmalıdır</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>sayı içermelidir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>Küçük karakterler içermelidir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>büyük karakterler içermelidir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>Ekstra karakterler içermelidir (! @ # $% ^ & *)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Parola gereksinimleri:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/uk.ts
Normal file
118
LoginView/src/lv_languages/uk.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="uk_UA">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>Вимоги до пароля:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>Логін</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>Заповніть цю форму, щоб створити обліковий запис</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>Заповніть цю форму, щоб увійти у свій обліковий запис</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>Ім'я</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>Прізвище</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>Виберіть країну</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>EMail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>Прізвисько</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>Порожня або неправильна назва. Введіть своє ім'я.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>Порожня або неправильна назва. Введіть своє ім'я.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>Порожній або неправильний псевдонім. Введіть своє ім'я.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>Пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>Підтвердьте пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>Забули пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>Я приймаю умови використання</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>Показати умови використання</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>Реєстрація</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>Вхід</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>Зареєструйтесь</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>Пароль повинен відповідати 1-му полю, і пароль не може бути порожнім</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>Має містити більше 8 символів</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>Повинні містити цифри</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>Повинен містити невеликі символи</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>Повинен містити великі символи</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>Повинен містити додаткові символи (! @ # $% ^ & *)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>Вимоги до пароля:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
118
LoginView/src/lv_languages/zh.ts
Normal file
118
LoginView/src/lv_languages/zh.ts
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="zh_CN" sourcelanguage="en">
|
||||
<context>
|
||||
<name>LoginView</name>
|
||||
<message>
|
||||
<source>Create a new account</source>
|
||||
<translation>创建一个新账户</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LogIn</source>
|
||||
<translation>登录</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to create an account</source>
|
||||
<translation>请填写此表格以创建一个帐户</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please fill this form to login in your account</source>
|
||||
<translation>请填写此表格以登录您的帐户</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>First Name</source>
|
||||
<translation>名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empy or incorrect name. Please enter your name.</source>
|
||||
<translation>名称为空或不正确。 请输入你的名字。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last Name</source>
|
||||
<translation>姓</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select you country</source>
|
||||
<translation>选择您的国家</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EMail</source>
|
||||
<translation>电子邮件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect email address. Please enter your name.</source>
|
||||
<translation>电子邮件地址为空或不正确。 请输入你的名字。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Nickname</source>
|
||||
<translation>昵称</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty or incorrect Nickname. Please enter your name.</source>
|
||||
<translation>空的或不正确的昵称。 请输入你的名字。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password</source>
|
||||
<translation>密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm password</source>
|
||||
<translation>确认密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Forgot password</source>
|
||||
<translation>忘记密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>I accept the Terms of use</source>
|
||||
<translation>我接受使用条款</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show terms of use</source>
|
||||
<translation>显示使用条款</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SignUp</source>
|
||||
<translation>报名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login In</source>
|
||||
<translation>登录</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sign Up</source>
|
||||
<translation>报名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password must match the 1st field and the password cannot be empty</source>
|
||||
<translation>密码必须与第一个字段匹配,密码不能为空</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LoginView::LVMainModel</name>
|
||||
<message>
|
||||
<source>must be longer than 8 characters</source>
|
||||
<translation>必须长于 8 个字符</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain numbers</source>
|
||||
<translation>必须包含数字</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain small chars</source>
|
||||
<translation>必须包含小字符</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain large chars</source>
|
||||
<translation>必须包含大字符</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>must contain extra chars (!@#$%^&*)</source>
|
||||
<translation>必须包含额外的字符 (!@#$%^&*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password requirements: </source>
|
||||
<translation>密码要求:</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -9,5 +9,17 @@
|
||||
<file>LoginViewModule/LVMCheckBox.qml</file>
|
||||
<file>LoginViewModule/LVMButton.qml</file>
|
||||
<file>LoginViewModule/ValidatIonIndicator.qml</file>
|
||||
<file>LoginViewModule/LoginViewDialog.qml</file>
|
||||
<file>LoginViewModule/Metrix.qml</file>
|
||||
<file>lv_languages/tr.qm</file>
|
||||
<file>lv_languages/ru.qm</file>
|
||||
<file>lv_languages/ja.qm</file>
|
||||
<file>lv_languages/en.qm</file>
|
||||
<file>lv_languages/uk.qm</file>
|
||||
<file>lv_languages/pl.qm</file>
|
||||
<file>lv_languages/es.qm</file>
|
||||
<file>lv_languages/fr.qm</file>
|
||||
<file>lv_languages/de.qm</file>
|
||||
<file>lv_languages/zh.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -11,6 +11,7 @@
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QDebug>
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace LoginView {
|
||||
|
||||
@ -30,7 +31,7 @@ LVMainModel::~LVMainModel() {
|
||||
}
|
||||
}
|
||||
|
||||
bool LVMainModel::setCounrySource(const QString &path) {
|
||||
bool LVMainModel::setCountriesSource(const QString &path) {
|
||||
|
||||
if (!m_countrysParser) {
|
||||
m_countrysParser = new CountrysParser();
|
||||
@ -58,6 +59,7 @@ bool LVMainModel::init( QQmlApplicationEngine *engine) {
|
||||
|
||||
engine->addImportPath(":/");
|
||||
root->setContextProperty(m_modelName, this);
|
||||
root->setContextProperty("ViewComponents", QVariant::fromValue(ViewComponentsQML{}));
|
||||
|
||||
qRegisterMetaType<LoginView::UserData>("UserData");
|
||||
qRegisterMetaType<LoginView::UserViewValidationData>("UserViewValidationData");
|
||||
@ -93,7 +95,7 @@ void LVMainModel::setCountry(int country) {
|
||||
emit countryListChanged();
|
||||
}
|
||||
|
||||
void LVMainModel::setData(UserData data) {
|
||||
void LVMainModel::setData(const UserData& data) {
|
||||
if (m_data == data)
|
||||
return;
|
||||
|
||||
@ -102,6 +104,14 @@ void LVMainModel::setData(UserData data) {
|
||||
emit dataChanged(m_data);
|
||||
}
|
||||
|
||||
void LVMainModel::setAcceptButtonText(const QString &acceptButtonText) {
|
||||
if (m_acceptButtonText == acceptButtonText)
|
||||
return;
|
||||
|
||||
m_acceptButtonText = acceptButtonText;
|
||||
emit acceptButtonTextChanged(m_acceptButtonText);
|
||||
}
|
||||
|
||||
void LVMainModel::setPasswordError(QString passwordError) {
|
||||
if (m_passwordError == passwordError)
|
||||
return;
|
||||
@ -110,6 +120,79 @@ void LVMainModel::setPasswordError(QString passwordError) {
|
||||
emit passwordErrorChanged(m_passwordError);
|
||||
}
|
||||
|
||||
ViewComponents LVMainModel::components() const {
|
||||
return m_components;
|
||||
}
|
||||
|
||||
void LVMainModel::setComponents(const ViewComponents &components) {
|
||||
if (m_components != components) {
|
||||
m_components = components;
|
||||
emit showChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool LVMainModel::fTitle() const {
|
||||
return m_components & ViewComponents::Title;
|
||||
}
|
||||
|
||||
bool LVMainModel::fFirstName() const {
|
||||
return m_components & ViewComponents::FirstName;
|
||||
}
|
||||
|
||||
bool LVMainModel::fLastName() const {
|
||||
return m_components & ViewComponents::LastName;
|
||||
}
|
||||
|
||||
bool LVMainModel::fNickname() const {
|
||||
return m_components & ViewComponents::Nickname;
|
||||
}
|
||||
|
||||
bool LVMainModel::fPassword() const {
|
||||
return m_components & ViewComponents::Password;
|
||||
}
|
||||
|
||||
bool LVMainModel::fEMail() const {
|
||||
return m_components & ViewComponents::EMail;
|
||||
}
|
||||
|
||||
bool LVMainModel::fRegister() const {
|
||||
return m_components & ViewComponents::SigupPage;
|
||||
}
|
||||
|
||||
bool LVMainModel::fTermOfUse() const {
|
||||
return m_components & ViewComponents::TermOfUse;
|
||||
}
|
||||
|
||||
bool LVMainModel::fLogin() const {
|
||||
return m_components & ViewComponents::LoginPage;
|
||||
}
|
||||
|
||||
void LVMainModel::clear() {
|
||||
emit clearView();
|
||||
setData({});
|
||||
}
|
||||
|
||||
QString LVMainModel::acceptButtonText() const {
|
||||
return m_acceptButtonText;
|
||||
}
|
||||
|
||||
void LVMainModel::setCurrentPage(int page) {
|
||||
if (page == m_currentPage) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(page & m_components)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_currentPage = static_cast<ViewComponents>(page);
|
||||
emit currentPageChanged(page);
|
||||
}
|
||||
|
||||
ViewComponents LVMainModel::currentPage() const {
|
||||
return m_currentPage;
|
||||
}
|
||||
|
||||
void LVMainModel::setValidData(UserViewValidationData validationData) {
|
||||
if (m_validationData == validationData)
|
||||
return;
|
||||
@ -146,36 +229,40 @@ void LVMainModel::checkValid(const UserData& data) {
|
||||
|
||||
UserViewValidationData result;
|
||||
|
||||
result.setEmail(!data.email().contains(QRegExp("^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$")));
|
||||
result.setCountry(!m_countryList.contains(data.country()));
|
||||
result.setLastName(false);
|
||||
result.setFirstName(data.firstName().contains(" ") || data.firstName().isEmpty());
|
||||
result.setNickname(fNickname() && (data.nickname().contains(" ") || data.nickname().isEmpty()));
|
||||
result.setEmail(fEMail() && !data.email().contains(QRegularExpression("^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$")));
|
||||
result.setCountry(m_countryList.size() && !m_countryList.contains(data.country()));
|
||||
result.setLastName(fLastName() && false);
|
||||
result.setFirstName(fFirstName() && (data.firstName().contains(" ") || data.firstName().isEmpty()));
|
||||
|
||||
bool passwordValidation = true;
|
||||
|
||||
if (m_validLvl & PasswordValidationLvl::Size8andMore) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().length() >= 8;
|
||||
}
|
||||
if (fPassword()) {
|
||||
if (m_validLvl & PasswordValidationLvl::Size8andMore) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().length() >= 8;
|
||||
}
|
||||
|
||||
if (m_validLvl & PasswordValidationLvl::NumberChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegExp("[0-9]"));
|
||||
}
|
||||
if (m_validLvl & PasswordValidationLvl::NumberChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegularExpression("[0-9]"));
|
||||
}
|
||||
|
||||
if (m_validLvl & PasswordValidationLvl::LitinSmallChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegExp("[a-z]"));
|
||||
}
|
||||
if (m_validLvl & PasswordValidationLvl::LitinSmallChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegularExpression("[a-z]"));
|
||||
}
|
||||
|
||||
if (m_validLvl & PasswordValidationLvl::LatinLargeChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegExp("[A-Z]"));
|
||||
}
|
||||
if (m_validLvl & PasswordValidationLvl::LatinLargeChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegularExpression("[A-Z]"));
|
||||
}
|
||||
|
||||
if (m_validLvl & PasswordValidationLvl::ExtraChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegularExpression("[!@#$%^&*]"));
|
||||
}
|
||||
|
||||
if (m_validLvl & PasswordValidationLvl::ExtraChars) {
|
||||
passwordValidation = passwordValidation &&
|
||||
data.rawPassword().contains(QRegExp("[!@#$%^&*]"));
|
||||
}
|
||||
|
||||
result.setRawPassword(!passwordValidation);
|
||||
|
@ -1,15 +1,18 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
|
||||
#ifndef LOGINVIEWMODEL_H
|
||||
#define LOGINVIEWMODEL_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include "viewcomponents.h"
|
||||
#include "loginview_global.h"
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#include "userdata.h"
|
||||
#include "userviewvalidationdata.h"
|
||||
@ -26,94 +29,315 @@ namespace LoginView {
|
||||
* by default: Size8andMore | LitinSmallChars | LatinLargeChars
|
||||
*/
|
||||
enum PasswordValidationLvl {
|
||||
|
||||
/// Skip all validation of password
|
||||
NoValidation = 0x00,
|
||||
/// Check size. Size must be large than 8 chars.
|
||||
Size8andMore = 0x01,
|
||||
/// Check chars. Password must be contains a numbers.
|
||||
NumberChars = 0x02,
|
||||
/// Check chars. Password must be contains small chars.
|
||||
LitinSmallChars = 0x04,
|
||||
/// Check chars. Password must be contains large chars.
|
||||
LatinLargeChars = 0x08,
|
||||
/// Check chars. Password must be contains extra chars. Example: (%.~*^#).
|
||||
ExtraChars = 0x10
|
||||
};
|
||||
|
||||
class LOGINVIEW_EXPORT LVMainModel : public QObject
|
||||
/**
|
||||
* @brief The LVMainModel class is main model of the qml login view.
|
||||
*/
|
||||
class LOGINVIEW_EXPORT LVMainModel: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QStringList countryList READ countryList NOTIFY countryListChanged)
|
||||
Q_PROPERTY(QList<int> countryCodeList READ countryCodeList NOTIFY countryCodeListChanged)
|
||||
|
||||
Q_PROPERTY(bool fTitle READ fTitle NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fLastName READ fLastName NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fFirstName READ fFirstName NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fNickname READ fNickname NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fEMail READ fEMail NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fRegister READ fRegister NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fLogin READ fLogin NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fPassword READ fPassword NOTIFY showChanged)
|
||||
Q_PROPERTY(bool fTermOfUse READ fTermOfUse NOTIFY showChanged)
|
||||
Q_PROPERTY(int currentPage READ currentPage NOTIFY currentPageChanged)
|
||||
|
||||
Q_PROPERTY(int country READ country WRITE setCountry NOTIFY countryChanged)
|
||||
Q_PROPERTY(UserData data READ data WRITE setData NOTIFY dataChanged)
|
||||
Q_PROPERTY(UserViewValidationData validationData READ validData WRITE setValidData NOTIFY validDataChanged)
|
||||
Q_PROPERTY(QString passwordError READ passwordError WRITE setPasswordError NOTIFY passwordErrorChanged)
|
||||
Q_PROPERTY(QString acceptButtonText READ acceptButtonText WRITE setAcceptButtonText NOTIFY acceptButtonTextChanged)
|
||||
|
||||
public:
|
||||
explicit LVMainModel(const QString modelName,
|
||||
QObject *parent = nullptr);
|
||||
~LVMainModel();
|
||||
/**
|
||||
* @brief setCounrySource - sets path to xml source file and extract list of countrys
|
||||
* @param path
|
||||
* @return true if the function finished successful
|
||||
* @brief setCountriesSource This method sets path to xml source file and extract list of countrys.
|
||||
* @param path This is path to xml sources of countries.
|
||||
* @return True if the function finished successful.
|
||||
*/
|
||||
Q_INVOKABLE bool setCounrySource(const QString &path);
|
||||
Q_INVOKABLE bool setCountriesSource(const QString &path);
|
||||
|
||||
/**
|
||||
* @brief init - prepare all items for use on qml.
|
||||
* @param engine - current qml engine of application
|
||||
* @return true if the function finished successful
|
||||
* @brief init Prepare all items for use on qml.
|
||||
* @param engine Current qml engine of application.
|
||||
* @return True if the function finished successful.
|
||||
*/
|
||||
bool init(QQmlApplicationEngine *engine);
|
||||
|
||||
/**
|
||||
* @brief country This method return current country id.
|
||||
* @return Current country id.
|
||||
*/
|
||||
int country() const;
|
||||
|
||||
/**
|
||||
* @brief countryList This method retun list of availabel countries.
|
||||
* @return string list of available countries.
|
||||
*/
|
||||
QStringList countryList() const;
|
||||
|
||||
/**
|
||||
* @brief data This method return information of created or logined user.
|
||||
* @return Return information of created or logined user.
|
||||
*/
|
||||
UserData data() const;
|
||||
|
||||
/**
|
||||
* @brief validData This method return structure that display valid data.
|
||||
* @return Information about last validation.
|
||||
*/
|
||||
UserViewValidationData validData() const;
|
||||
|
||||
/**
|
||||
* @brief passwordError This method return text message about last password error.
|
||||
* For get more information about password errors see the PasswordValidationLvl enum.
|
||||
* @return Error message.
|
||||
*/
|
||||
QString passwordError() const;
|
||||
|
||||
/**
|
||||
* @brief countryCodeList This method return the list of ids of the countries.
|
||||
* @return Countries ids.
|
||||
*/
|
||||
QList<int> countryCodeList() const;
|
||||
|
||||
/**
|
||||
* @brief loginRequest This method invoked when user click the login button.
|
||||
*/
|
||||
Q_INVOKABLE void loginRequest();
|
||||
|
||||
/**
|
||||
* @brief rememberPasswordRequest This method invoked when user click the forgetpassword button.
|
||||
*/
|
||||
Q_INVOKABLE void rememberPasswordRequest();
|
||||
|
||||
/**
|
||||
* @brief registerRequest This method invoked when user click the signUp button.
|
||||
*/
|
||||
Q_INVOKABLE void registerRequest();
|
||||
|
||||
/**
|
||||
* @brief showTermOfUseRequest This method invoked when user click the "show temr of use" button.
|
||||
*/
|
||||
Q_INVOKABLE void showTermOfUseRequest();
|
||||
|
||||
/**
|
||||
* @brief components This method return visible comonents of this model.
|
||||
* @return return information about visible companents of Qml View. for more information see the ViewComponents enum.
|
||||
*/
|
||||
ViewComponents components() const;
|
||||
|
||||
/**
|
||||
* @brief setComponents This method sets visibel companents of the qml view.
|
||||
* @param components This is enum with visible companents. For get more information see Thee ViewComponents enum class.
|
||||
*/
|
||||
void setComponents(const ViewComponents &components);
|
||||
|
||||
/**
|
||||
* @brief fTitle This method return Title visible state.
|
||||
* @return Title visible state.
|
||||
*/
|
||||
bool fTitle() const;
|
||||
|
||||
/**
|
||||
* @brief fFirstName This method return first name visible state.
|
||||
* @return First name visible state.
|
||||
*/
|
||||
bool fFirstName() const;
|
||||
|
||||
/**
|
||||
* @brief fLastName This method return last name visible state.
|
||||
* @return Last name visible state.
|
||||
*/
|
||||
bool fLastName() const;
|
||||
|
||||
/**
|
||||
* @brief fNickname This method return nickname visible state.
|
||||
* @return Nickname visible state.
|
||||
*/
|
||||
bool fNickname() const;
|
||||
|
||||
/**
|
||||
* @brief fPassword This method return password visible state.
|
||||
* @return Password visible state.
|
||||
*/
|
||||
bool fPassword() const;
|
||||
|
||||
/**
|
||||
* @brief fEMail This method return email visible state.
|
||||
* @return Email visible state.
|
||||
*/
|
||||
bool fEMail() const;
|
||||
|
||||
/**
|
||||
* @brief fRegister This method return register page visible state.
|
||||
* @return Register page visible state.
|
||||
*/
|
||||
bool fRegister() const;
|
||||
|
||||
/**
|
||||
* @brief fTermOfUse This method return term of use widgets visible state.
|
||||
* @return Term of use widgets visible state.
|
||||
*/
|
||||
bool fTermOfUse() const;
|
||||
|
||||
/**
|
||||
* @brief fLogin This method return login page visible state.
|
||||
* @return Login page visible state.
|
||||
*/
|
||||
bool fLogin() const;
|
||||
|
||||
/**
|
||||
* @brief fSigupDefaultPage return true if the default page is the sigup page.
|
||||
* @return True if the default page is the sigup page.
|
||||
*/
|
||||
bool fSigupDefaultPage() const;
|
||||
|
||||
/**
|
||||
* @brief clear - Clear all data from view.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @brief acceptButtonText This method return alternative text of the accept button.
|
||||
* @return Alternative text of the accept button.
|
||||
*/
|
||||
QString acceptButtonText() const;
|
||||
|
||||
/**
|
||||
* @brief setDefaultPage Sets visible page.
|
||||
* @param page new default page (RegisterPage or LoginPage).
|
||||
*/
|
||||
Q_INVOKABLE void setCurrentPage(int page);
|
||||
|
||||
/**
|
||||
* @brief currentPage Return id of the current page.
|
||||
* @return Id of the current page.
|
||||
*/
|
||||
ViewComponents currentPage() const;
|
||||
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief setCountry This slot sets current country. This method work with qml View and invoked when user change own country.
|
||||
* @param country This is new country id.
|
||||
*/
|
||||
void setCountry(int country);
|
||||
void setData(UserData data);
|
||||
|
||||
/**
|
||||
* @brief setData Sets new data for view on qml page.
|
||||
* @param data New user data.
|
||||
*/
|
||||
void setData(const UserData &data);
|
||||
|
||||
/**
|
||||
* @brief setAcceptButtonText This method sets new test of the accept button. Use this method if you want change test on main button.
|
||||
* @param acceptButtonText New text of the accept button.
|
||||
*/
|
||||
void setAcceptButtonText(const QString& acceptButtonText);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief countryChanged This signal emited when country on page is will be changed.
|
||||
* @param country New country id.
|
||||
*/
|
||||
void countryChanged(int country);
|
||||
|
||||
/**
|
||||
* @brief countryListChanged This method emited when available country list will be changed.
|
||||
*/
|
||||
void countryListChanged();
|
||||
|
||||
/**
|
||||
* @brief countryCodeListChanged This method emited when available country list will be changed.
|
||||
*/
|
||||
void countryCodeListChanged();
|
||||
|
||||
/**
|
||||
* @brief sigLoginRequest
|
||||
* emited when user try login
|
||||
* @brief sigLoginRequest
|
||||
* Emited when user try login.
|
||||
*/
|
||||
void sigLoginRequest(UserData);
|
||||
void sigLoginRequest(const UserData&);
|
||||
|
||||
/**
|
||||
* @brief sigRegisterRequest
|
||||
* emited when user try create new accaunt
|
||||
* Emited when user try create new account.
|
||||
*/
|
||||
void sigRegisterRequest(UserData);
|
||||
void sigRegisterRequest(const UserData&);
|
||||
|
||||
/**
|
||||
* @brief sigForgotPasswordRequest
|
||||
* emited when user forgot own password
|
||||
* Emited when user forgot own password.
|
||||
*/
|
||||
void sigForgotPasswordRequest(UserData);
|
||||
void sigForgotPasswordRequest(const UserData&);
|
||||
|
||||
/**
|
||||
* @brief sigShowTermOfUseRequest
|
||||
* emited when user click on "Show term of use" button
|
||||
* Emited when user click on "Show term of use" button.
|
||||
*/
|
||||
void sigShowTermOfUseRequest();
|
||||
|
||||
|
||||
/**
|
||||
* @brief dataChanged Emited when data of qml form will be changed.
|
||||
* @param data New data of qml form.
|
||||
*/
|
||||
void dataChanged(UserData data);
|
||||
|
||||
/**
|
||||
* @brief validDataChanged This method emited when model is finished validation of the accepted user data.
|
||||
* @param validationData This is validation results.
|
||||
*/
|
||||
void validDataChanged(UserViewValidationData validationData);
|
||||
|
||||
/**
|
||||
* @brief passwordErrorChanged This method will be emited when user password have a any error.
|
||||
* @param passwordError This is new erro message of user password.
|
||||
*/
|
||||
void passwordErrorChanged(QString passwordError);
|
||||
|
||||
/**
|
||||
* @brief showChanged This signal emited when rules of shows components will be changed.
|
||||
*/
|
||||
void showChanged();
|
||||
|
||||
/**
|
||||
* @brief clearView This signal emited when need to clear a view. for more ifnformation see the clear method.
|
||||
*/
|
||||
void clearView();
|
||||
|
||||
/**
|
||||
* @brief acceptButtonTextChanged This signal emited when text of the accept button will be changed.
|
||||
* @param acceptButtonText Tihs is new test of the accept button.
|
||||
*/
|
||||
void acceptButtonTextChanged(QString acceptButtonText);
|
||||
|
||||
void currentPageChanged(int currentPage);
|
||||
|
||||
private:
|
||||
void checkValid(const UserData &data);
|
||||
void setValidData(UserViewValidationData validationData);
|
||||
@ -128,6 +352,9 @@ private:
|
||||
|
||||
UserViewValidationData m_validationData;
|
||||
QString m_passwordError;
|
||||
ViewComponents m_components = ViewComponents::All;
|
||||
ViewComponents m_currentPage = ViewComponents::SigupPage;
|
||||
QString m_acceptButtonText;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -30,6 +30,10 @@ QString UserData::email() const {
|
||||
return m_email;
|
||||
}
|
||||
|
||||
QString UserData::nickname() const {
|
||||
return m_nickname;
|
||||
}
|
||||
|
||||
void UserData::setCountry(int country) {
|
||||
m_country = country;
|
||||
}
|
||||
@ -50,11 +54,16 @@ void UserData::setEmail(const QString &email) {
|
||||
m_email = email;
|
||||
}
|
||||
|
||||
void UserData::setNickname(const QString& nickname) {
|
||||
m_nickname = nickname;
|
||||
}
|
||||
|
||||
bool operator !=(const UserData &left, const UserData &right) {
|
||||
return left.m_email != right.m_email ||
|
||||
left.m_country != right.m_country ||
|
||||
left.m_rawPassword != right.m_rawPassword ||
|
||||
left.m_firstName != right.m_firstName ||
|
||||
left.m_nickname != right.m_nickname ||
|
||||
left.m_lastName != right.m_lastName;
|
||||
}
|
||||
|
||||
|
@ -1,17 +1,20 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#ifndef USERDATA_H
|
||||
#define USERDATA_H
|
||||
#ifndef LV_USERDATA_H
|
||||
#define LV_USERDATA_H
|
||||
#include <QObject>
|
||||
#include "loginview_global.h"
|
||||
|
||||
namespace LoginView {
|
||||
|
||||
/**
|
||||
* @brief The UserData class This is base class for save user data.
|
||||
*/
|
||||
class LOGINVIEW_EXPORT UserData
|
||||
{
|
||||
Q_GADGET
|
||||
@ -20,6 +23,7 @@ class LOGINVIEW_EXPORT UserData
|
||||
Q_PROPERTY(QString lastName READ lastName WRITE setLastName)
|
||||
Q_PROPERTY(QString rawPassword READ rawPassword WRITE setRawPassword)
|
||||
Q_PROPERTY(QString email READ email WRITE setEmail)
|
||||
Q_PROPERTY(QString nickname READ nickname WRITE setNickname)
|
||||
|
||||
public:
|
||||
UserData();
|
||||
@ -32,6 +36,7 @@ public:
|
||||
friend bool operator !=(const UserData& left, const UserData& right);
|
||||
friend bool operator ==(const UserData& left, const UserData& right);
|
||||
|
||||
QString nickname() const;
|
||||
|
||||
public slots:
|
||||
void setCountry(int country);
|
||||
@ -40,13 +45,17 @@ public slots:
|
||||
void setRawPassword(const QString& rawPassword);
|
||||
void setEmail(const QString& email);
|
||||
|
||||
void setNickname(const QString &nickname);
|
||||
|
||||
private:
|
||||
int m_country;
|
||||
QString m_firstName;
|
||||
QString m_lastName;
|
||||
QString m_rawPassword;
|
||||
QString m_email;
|
||||
|
||||
QString m_nickname;
|
||||
};
|
||||
|
||||
}
|
||||
#endif // USERDATA_H
|
||||
#endif // LV_USERDATA_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -14,7 +14,9 @@ enum class ValidationAddersses {
|
||||
FirstName = 0x02,
|
||||
LastName = 0x04,
|
||||
RawPassword = 0x08,
|
||||
Email = 0x10
|
||||
Email = 0x10,
|
||||
Nickname = 0x20
|
||||
|
||||
};
|
||||
|
||||
UserViewValidationData::UserViewValidationData() {
|
||||
@ -22,6 +24,7 @@ UserViewValidationData::UserViewValidationData() {
|
||||
static_cast<int>(ValidationAddersses::Country) |
|
||||
static_cast<int>(ValidationAddersses::LastName) |
|
||||
static_cast<int>(ValidationAddersses::RawPassword) |
|
||||
static_cast<int>(ValidationAddersses::Nickname) |
|
||||
static_cast<int>(ValidationAddersses::Email);
|
||||
}
|
||||
|
||||
@ -49,6 +52,10 @@ bool UserViewValidationData::noError() const {
|
||||
return !m_data;
|
||||
}
|
||||
|
||||
bool UserViewValidationData::nickname() const {
|
||||
return m_data & static_cast<int>(ValidationAddersses::Nickname);
|
||||
}
|
||||
|
||||
bool operator !=(const UserViewValidationData &left,
|
||||
const UserViewValidationData &right) {
|
||||
return left.m_data != right.m_data;
|
||||
@ -84,4 +91,9 @@ void UserViewValidationData::setEmail(bool email) {
|
||||
m_data |= (static_cast<int>(ValidationAddersses::Email) * (email & 0x01));
|
||||
}
|
||||
|
||||
void UserViewValidationData::setNickname(bool nickname) {
|
||||
m_data &= ~static_cast<int>(ValidationAddersses::Nickname);
|
||||
m_data |= (static_cast<int>(ValidationAddersses::Nickname) * (nickname & 0x01));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -12,6 +12,9 @@
|
||||
|
||||
namespace LoginView {
|
||||
|
||||
/**
|
||||
* @brief The UserViewValidationData class contains data of the last validation.
|
||||
*/
|
||||
class UserViewValidationData
|
||||
{
|
||||
Q_GADGET
|
||||
@ -20,12 +23,13 @@ class UserViewValidationData
|
||||
Q_PROPERTY(bool lastName READ lastName WRITE setLastName) // ValidationAddersses::LastName
|
||||
Q_PROPERTY(bool rawPassword READ rawPassword WRITE setRawPassword) // ValidationAddersses::RawPassword
|
||||
Q_PROPERTY(bool email READ email WRITE setEmail) // ValidationAddersses::Email
|
||||
Q_PROPERTY(bool nickname READ nickname WRITE setNickname) // ValidationAddersses::nickname
|
||||
Q_PROPERTY(bool noError READ noError)
|
||||
|
||||
public:
|
||||
UserViewValidationData();
|
||||
/**
|
||||
* @return true if member has error
|
||||
* @return True if member has error.
|
||||
*/
|
||||
bool country() const;
|
||||
bool firstName() const;
|
||||
@ -39,6 +43,7 @@ public:
|
||||
const UserViewValidationData &right);
|
||||
|
||||
bool noError() const;
|
||||
bool nickname() const;
|
||||
|
||||
public slots:
|
||||
void setCountry(bool country);
|
||||
@ -47,6 +52,8 @@ public slots:
|
||||
void setRawPassword(bool rawPassword);
|
||||
void setEmail(bool email);
|
||||
|
||||
void setNickname(bool nickname);
|
||||
|
||||
private:
|
||||
int m_data;
|
||||
};
|
||||
|
55
LoginView/src/viewcomponents.cpp
Normal file
55
LoginView/src/viewcomponents.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
#include "viewcomponents.h"
|
||||
|
||||
namespace LoginView {
|
||||
|
||||
|
||||
int ViewComponentsQML::noShow() const
|
||||
{
|
||||
return ViewComponents::NoShow;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::title() const
|
||||
{
|
||||
return ViewComponents::Title;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::firstName() const
|
||||
{
|
||||
return ViewComponents::FirstName;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::lastName() const
|
||||
{
|
||||
return ViewComponents::LastName;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::eMail() const
|
||||
{
|
||||
return ViewComponents::EMail;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::nickname() const
|
||||
{
|
||||
return ViewComponents::Nickname;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::password() const
|
||||
{
|
||||
return ViewComponents::Password;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::sigupPage() const
|
||||
{
|
||||
return ViewComponents::SigupPage;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::loginPage() const
|
||||
{
|
||||
return ViewComponents::LoginPage;
|
||||
}
|
||||
|
||||
int ViewComponentsQML::termOfUse() const
|
||||
{
|
||||
return ViewComponents::TermOfUse;
|
||||
}
|
||||
}
|
81
LoginView/src/viewcomponents.h
Normal file
81
LoginView/src/viewcomponents.h
Normal file
@ -0,0 +1,81 @@
|
||||
//#
|
||||
//# Copyright (C) 2020-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#ifndef VIEWCOMPONENTS_H
|
||||
#define VIEWCOMPONENTS_H
|
||||
#include <QObject>
|
||||
|
||||
namespace LoginView {
|
||||
|
||||
/**
|
||||
* @brief The ViewComponents enum used for control of the components view.
|
||||
* default is All
|
||||
*/
|
||||
enum ViewComponents {
|
||||
/// No show any componets.
|
||||
NoShow = 0x0000,
|
||||
/// Show Title of the qml page.
|
||||
Title = 0x0001,
|
||||
/// Show first name input widget.
|
||||
FirstName = 0x0002,
|
||||
/// Show last name input widget.
|
||||
LastName = 0x0004,
|
||||
/// Show email name input widget.
|
||||
EMail = 0x0008,
|
||||
/// Show nickname input widget.
|
||||
Nickname = 0x0010,
|
||||
/// Show password input widget.
|
||||
Password = 0x0020,
|
||||
/// Show register page.
|
||||
SigupPage = 0x0040,
|
||||
/// Show login page.
|
||||
LoginPage = 0x0080,
|
||||
/// Show term of use button and accept term of use checkbox.
|
||||
TermOfUse = 0x0100,
|
||||
/// Show only one input widget with name.
|
||||
RegNameOnly = Title | Nickname | SigupPage,
|
||||
|
||||
/// Show all widgets and pages.
|
||||
All = EMail | Title | FirstName | LastName | Nickname | Password | SigupPage | LoginPage | TermOfUse
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The ViewComponentsQML class This is qml implementation of the ViewComponents enum.
|
||||
*/
|
||||
class ViewComponentsQML
|
||||
{
|
||||
Q_GADGET
|
||||
Q_PROPERTY(int noShow READ noShow)
|
||||
Q_PROPERTY(int title READ title)
|
||||
Q_PROPERTY(int firstName READ firstName)
|
||||
Q_PROPERTY(int lastName READ lastName)
|
||||
Q_PROPERTY(int eMail READ eMail)
|
||||
Q_PROPERTY(int nickname READ nickname)
|
||||
Q_PROPERTY(int password READ password)
|
||||
Q_PROPERTY(int sigupPage READ sigupPage)
|
||||
Q_PROPERTY(int loginPage READ loginPage)
|
||||
Q_PROPERTY(int termOfUse READ termOfUse)
|
||||
|
||||
public:
|
||||
ViewComponentsQML() = default;
|
||||
|
||||
int noShow() const;
|
||||
int title() const;
|
||||
int firstName() const;
|
||||
int lastName() const;
|
||||
int eMail() const;
|
||||
int nickname() const;
|
||||
int password() const;
|
||||
int sigupPage() const;
|
||||
int loginPage() const;
|
||||
int termOfUse() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(LoginView::ViewComponentsQML)
|
||||
#endif // VIEWCOMPONENTS_H
|
41
README.md
41
README.md
@ -1,9 +1,8 @@
|
||||
# QMLLoginView
|
||||
test work for Logic Way Solutions
|
||||
|
||||
## Introdaction
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
This is a simple login window library for qml projects. The project is built with the help of the сmake build system and may be easily included into existing projects.
|
||||
@ -21,9 +20,11 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
### Screenshots
|
||||
|
||||
#### Login View
|
||||
|
||||

|
||||
|
||||
#### Register View
|
||||
|
||||

|
||||
|
||||
|
||||
@ -34,7 +35,9 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
* git submodule update --init --recursive
|
||||
* Include in your CMakeLists.txt file the main CMakeLists.txt file of QMLLoginView library
|
||||
``` cmake
|
||||
include(QMLLoginView)
|
||||
add_subdirectory(QMLLoginView)
|
||||
target_link_libraries(${CURRENT_PROJECT} PRIVATE LoginView)
|
||||
|
||||
```
|
||||
* Rebuild yuor project
|
||||
|
||||
@ -51,6 +54,8 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
```
|
||||
|
||||
``` qml
|
||||
import LoginViewModule 1.0
|
||||
|
||||
LoginView {
|
||||
lognViewModel: exampleLogin // exampleLogin - this is inited model in main.cpp
|
||||
anchors.fill: parent
|
||||
@ -73,6 +78,7 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
```
|
||||
|
||||
### LoginView::LVMainModel Methods
|
||||
|
||||
``` cpp
|
||||
/**
|
||||
* @brief setCounrySource - sets path to xml source file and extract list of countrys
|
||||
@ -92,6 +98,7 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
```
|
||||
|
||||
#### LoginView::LVMainModel Signals
|
||||
|
||||
``` cpp
|
||||
|
||||
/**
|
||||
@ -120,6 +127,7 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
```
|
||||
|
||||
#### UserData properties
|
||||
|
||||
``` cpp
|
||||
Q_PROPERTY(int country READ country WRITE setCountry)
|
||||
Q_PROPERTY(QString firstName READ firstName WRITE setFirstName)
|
||||
@ -132,8 +140,9 @@ This is a simple login window library for qml projects. The project is built wit
|
||||
## Build Example
|
||||
|
||||
### Prepare
|
||||
|
||||
1. install cqtdeployer
|
||||
2. install cqtdeployer ([gitHubRelises](https://github.com/QuasarApp/CQtDeployer/releases or [snap-store](https://snapcraft.io/cqtdeployer)))
|
||||
2. install cqtdeployer ([gitHub releases](https://github.com/QuasarApp/CQtDeployer/releases) or [snap-store](https://snapcraft.io/cqtdeployer)))
|
||||
3. if you use snap store version of cqtdeployer add all permisions for cqdeployer.
|
||||
|
||||
### build on Linux
|
||||
@ -157,3 +166,27 @@ chmod +x InstallerExampleLoginView.run
|
||||
|
||||
./InstallerExampleLoginView.run
|
||||
```
|
||||
|
||||
|
||||
## Translations
|
||||
|
||||
This library sipprots a next languages:
|
||||
* English
|
||||
* Russian
|
||||
* Ukrainian
|
||||
* Japanese
|
||||
* Turkish
|
||||
|
||||
|
||||
### Include translations
|
||||
|
||||
For include translations into your projects you need to use the QuasarAppUtils::Locales class. See oficiald [documentation](https://quasarapp.ddns.net:3031/docs/QuasarApp/QuasarAppLib/latest/classQuasarAppUtils_1_1Locales.html)
|
||||
|
||||
```cpp
|
||||
if(!QuasarAppUtils::Locales::init(locale, {":/lv_languages/"})) {
|
||||
QuasarAppUtils::Params::log("Error load language : " , QuasarAppUtils::Error);
|
||||
}
|
||||
```
|
||||
|
||||
Or you can manually load needed qm file.
|
||||
All qm files located in lv_languages folder.
|
||||
|
2495
doxygen.conf
Normal file
2495
doxygen.conf
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
# Distributed under the lgplv3 software license, see the accompanying
|
||||
# Everyone is permitted to copy and distribute verbatim copies
|
||||
# of this license document, but changing it is not allowed.
|
||||
@ -18,25 +18,23 @@ set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/ProjectOut.cmake)
|
||||
|
||||
find_package(Qt5 COMPONENTS Core QuickControls2 REQUIRED)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core QuickControls2 REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core QuickControls2 REQUIRED)
|
||||
|
||||
if(ANDROID)
|
||||
add_library(${PROJECT_NAME} SHARED
|
||||
add_library(${PROJECT_NAME}
|
||||
main.cpp
|
||||
qml.qrc
|
||||
lv_example_res.qrc
|
||||
)
|
||||
else()
|
||||
add_executable(${PROJECT_NAME}
|
||||
main.cpp
|
||||
qml.qrc
|
||||
lv_example_res.qrc
|
||||
icon.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::QuickControls2 LoginView)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt::Core Qt::QuickControls2 LoginView)
|
||||
|
||||
|
BIN
example/logo.ico
BIN
example/logo.ico
Binary file not shown.
Before (image error) Size: 8.8 KiB After (image error) Size: 66 KiB |
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -32,7 +32,7 @@ int main(int argc, char *argv[])
|
||||
pathXML = QString(argv[1]);
|
||||
}
|
||||
|
||||
if (!loginModel.setCounrySource(pathXML)) {
|
||||
if (!loginModel.setCountriesSource(pathXML)) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
//#
|
||||
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
|
||||
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
|
||||
//# Distributed under the lgplv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
@ -7,7 +7,6 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Window 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls 2.12 as Controls
|
||||
import QtQuick.Layouts 1.12
|
||||
import LoginViewModule 1.0
|
||||
import QtQuick.Dialogs 1.3
|
||||
|
5
plug.pro
Normal file
5
plug.pro
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
TEMPLATE = subdirs
|
||||
|
||||
QMAKE_EXTRA_TARGETS += \
|
||||
test
|
BIN
res/Banner.jpeg
Normal file
BIN
res/Banner.jpeg
Normal file
Binary file not shown.
After ![]() (image error) Size: 34 KiB |
BIN
res/logo.ico
BIN
res/logo.ico
Binary file not shown.
Before (image error) Size: 8.8 KiB After (image error) Size: 66 KiB |
BIN
res/logo.png
BIN
res/logo.png
Binary file not shown.
Before ![]() (image error) Size: 22 KiB After ![]() (image error) Size: 211 KiB ![]() ![]() |
BIN
res/logo2.png
BIN
res/logo2.png
Binary file not shown.
Before ![]() (image error) Size: 15 KiB After ![]() (image error) Size: 18 KiB ![]() ![]() |
Loading…
x
Reference in New Issue
Block a user