4
0
mirror of https://github.com/QuasarApp/SimpleQmlNotify.git synced 2025-05-09 11:49:34 +00:00

Merge branch 'main' of github.com:QuasarApp/SimpleQmlNotify

This commit is contained in:
Andrei Yankovich 2021-05-31 12:19:50 +03:00
commit 720ef60415
11 changed files with 80 additions and 11 deletions

2
CMake

@ -1 +1 @@
Subproject commit b32cca62386311ec32f16c0bbf13df446ace5873
Subproject commit cd05493c3a43b04f26c3e3432df4283eb4509d8c

@ -34,10 +34,14 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set(LANGS ${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/en.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/ru.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/uk.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/ja.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/tr.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/uk.ts)
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/zh.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/de.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/fr.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/es.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/pl.ts)
prepareQM( ${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} "${LANGS}")

@ -11,6 +11,11 @@
<file>qmlNotify_languages/ja.qm</file>
<file>qmlNotify_languages/en.qm</file>
<file>qmlNotify_languages/uk.qm</file>
<file>qmlNotify_languages/pl.qm</file>
<file>qmlNotify_languages/es.qm</file>
<file>qmlNotify_languages/fr.qm</file>
<file>qmlNotify_languages/de.qm</file>
<file>qmlNotify_languages/zh.qm</file>
</qresource>
<qresource prefix="/icons">
<file alias="warning">icons/Warning.png</file>

@ -9,7 +9,7 @@ Simple Qml notification service for qml applications.
* git submodule add https://github.com/QuasarApp/SimpleQmlNotify.git # add the repository of QSimpleQmlNotify into your repo like submodule
* git submodule update --init --recursive
* Include in your pro file the pri file of Qt-Secret library
``` qmake
```qmake
include($$PWD/SimpleQmlNotify/QmlNotify.pri)
```
* Rebuild yuor project
@ -21,7 +21,7 @@ Simple Qml notification service for qml applications.
* git submodule add https://github.com/QuasarApp/SimpleQmlNotify.git # add the repository of QSimpleQmlNotify into your repo like submodule
* git submodule update --init --recursive
* Include in your CMakeLists.txt file the main CMakeLists.txt file of QSimpleQmlNotify library
``` cmake
```cmake
include(QmlNotyfyService)
```
* Rebuild yuor project
@ -43,7 +43,7 @@ Simple Qml notification service for qml applications.
### Notification
#### CPP
``` cpp
```cpp
#include <qmlnotifyservice.h>
int main() {
@ -57,7 +57,8 @@ Simple Qml notification service for qml applications.
#### QML
``` qml
```qml
import NotifyModule 1.0
NotificationServiceView {
anchors.fill: parent;
@ -69,7 +70,7 @@ Simple Qml notification service for qml applications.
#### CPP
``` cpp
```cpp
#include <qmlnotifyservice.h>
int main() {
@ -92,8 +93,9 @@ Simple Qml notification service for qml applications.
#### QML
``` qml
```qml
import NotifyModule 1.0
NotificationServiceView {
anchors.fill: parent;
}
@ -124,4 +126,4 @@ if(!QuasarAppUtils::Locales::init(locale, {":/qmlNotify_languages/"})) {
```
Or you can manually load needed qm file.
All qm files located in qmlNotify_languages folder.
All qm files located in qmlNotify_languages folder.

11
qmlNotify_languages/de.ts Normal file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE" sourcelanguage="en">
<context>
<name>NotificationForm</name>
<message>
<source>Message</source>
<translation>Botschaft</translation>
</message>
</context>
</TS>

11
qmlNotify_languages/es.ts Normal file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es" sourcelanguage="en">
<context>
<name>NotificationForm</name>
<message>
<source>Message</source>
<translation>Mensaje</translation>
</message>
</context>
</TS>

11
qmlNotify_languages/fr.ts Normal file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr" sourcelanguage="en">
<context>
<name>NotificationForm</name>
<message>
<source>Message</source>
<translation>Un message</translation>
</message>
</context>
</TS>

11
qmlNotify_languages/pl.ts Normal file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl" sourcelanguage="en">
<context>
<name>NotificationForm</name>
<message>
<source>Message</source>
<translation>Wiadomość</translation>
</message>
</context>
</TS>

11
qmlNotify_languages/zh.ts Normal file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh" sourcelanguage="en">
<context>
<name>NotificationForm</name>
<message>
<source>Message</source>
<translation></translation>
</message>
</context>
</TS>

@ -21,6 +21,8 @@ bool init(QQmlApplicationEngine *engine) {
if (!root)
return false;
initSNotufyResources();
engine->addImportPath(":/");
root->setContextProperty("notificationService", NotificationService::getService());

@ -5,6 +5,7 @@
#include "notificationservice.h"
class QQmlApplicationEngine;
inline void initSNotufyResources() { Q_INIT_RESOURCE(NotifyModule); }
/**
* Simple notify service for qml.