Update translations & implement #72

This commit is contained in:
Alex Spataru 2021-09-24 15:07:43 -05:00
parent 2b9d8e2872
commit 3d10cc4ef6
22 changed files with 366 additions and 119 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -33,8 +33,8 @@ ApplicationWindow {
//
// Window options
//
minimumWidth: column.implicitWidth + 4 * app.spacing
minimumHeight: column.implicitHeight + 4 * app.spacing
minimumWidth: 910
minimumHeight: 720
title: qsTr("JSON Editor - %1").arg(Cpp_JSON_Editor.jsonFileName)
//

View File

@ -37,6 +37,7 @@ Control {
property alias parity: _parityCombo.currentIndex
property alias flowControl: _flowCombo.currentIndex
property alias stopBits: _stopBitsCombo.currentIndex
property alias autoReconnect: _autoreconnect.checked
//
// Update listbox models when translation is changed

View File

@ -89,8 +89,12 @@ Control {
} ComboBox {
id: _langCombo
Layout.fillWidth: true
currentIndex: Cpp_Misc_Translator.language
model: Cpp_Misc_Translator.availableLanguages
onCurrentIndexChanged: Cpp_Misc_Translator.setLanguage(currentIndex)
onCurrentIndexChanged: {
if (currentIndex !== Cpp_Misc_Translator.language)
Cpp_Misc_Translator.setLanguage(currentIndex)
}
}
//

View File

@ -32,6 +32,7 @@ import "../SetupPanes" as SetupPanes
Item {
id: root
readonly property int maxItemWidth: column.width - 2 * spacing
//
// Save settings
@ -53,6 +54,7 @@ Item {
property alias dataBits: serial.dataBits
property alias stopBits: serial.stopBits
property alias flowControl: serial.flowControl
property alias autoReconnect: serial.autoReconnect
//
// Network settings
@ -126,6 +128,7 @@ Item {
} RadioButton {
id: commAuto
checked: true
Layout.maximumWidth: root.maxItemWidth
text: qsTr("No parsing (device sends JSON data)")
onCheckedChanged: {
if (checked)
@ -136,6 +139,7 @@ Item {
} RadioButton {
id: commManual
checked: false
Layout.maximumWidth: root.maxItemWidth
text: qsTr("Parse via JSON project file")
onCheckedChanged: {
if (checked)
@ -152,6 +156,7 @@ Item {
Layout.fillWidth: true
opacity: enabled ? 1 : 0.5
enabled: commManual.checked
Layout.maximumWidth: root.maxItemWidth
onClicked: Cpp_JSON_Generator.loadJsonMap()
Behavior on opacity {NumberAnimation{}}
text: (Cpp_JSON_Generator.jsonMapFilename.length ? qsTr("Change project file (%1)").arg(Cpp_JSON_Generator.jsonMapFilename) :
@ -176,6 +181,7 @@ Item {
text: qsTr("Create CSV file")
Layout.alignment: Qt.AlignVCenter
checked: Cpp_CSV_Export.exportEnabled
Layout.maximumWidth: root.maxItemWidth
palette.highlight: Cpp_ThemeManager.csvHighlight
onCheckedChanged: {
@ -212,6 +218,7 @@ Item {
height: 24
id: tab
Layout.fillWidth: true
Layout.maximumWidth: root.maxItemWidth
onCurrentIndexChanged: {
if (currentIndex < 2 && currentIndex !== Cpp_IO_Manager.dataSource)
Cpp_IO_Manager.dataSource = currentIndex

View File

@ -24,23 +24,8 @@ import QtQuick 2.12
Item {
id: qmlMain
readonly property string uiFont: uiFontLoader.name
readonly property string monoFont: monoFontLoader.name
FontLoader {
id: uiFontLoader
source: "qrc:/fonts/Roboto-Regular.ttf"
}
FontLoader {
id: uiFontLoaderBold
source: "qrc:/fonts/Roboto-Bold.ttf"
}
FontLoader {
id: monoFontLoader
source: "qrc:/fonts/RobotoMono-Regular.ttf"
}
readonly property string uiFont: "Roboto"
readonly property string monoFont: "Roboto Mono"
Loader {
asynchronous: true

Binary file not shown.

View File

@ -94,11 +94,11 @@
<name>Application</name>
<message>
<source>Check for updates automatically?</source>
<translation>Automatish auf Updates prüfen?</translation>
<translation type="vanished">Automatish auf Updates prüfen?</translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>Soll %1 Automatish auf Updates prüfen? Sie können jederzeit manuell über das Menü &quot;Hilfe&quot; nach Updates suchen</translation>
<translation type="vanished">Soll %1 Automatish auf Updates prüfen? Sie können jederzeit manuell über das Menü &quot;Hilfe&quot; nach Updates suchen</translation>
</message>
<message>
<source>Drop JSON and CSV files here</source>
@ -1349,7 +1349,7 @@
</message>
<message>
<source>Show log file</source>
<translation>Logdatei anzeigen</translation>
<translation type="vanished">Logdatei anzeigen</translation>
</message>
<message>
<source>Report bug</source>
@ -1508,7 +1508,7 @@
</message>
<message>
<source>Show log file</source>
<translation>Logdatei anzeigen</translation>
<translation type="vanished">Logdatei anzeigen</translation>
</message>
<message>
<source>Report bug</source>
@ -1549,6 +1549,40 @@
<translation>Möchten Sie %1 jetzt neu starten?</translation>
</message>
</context>
<context>
<name>Misc::Utilities</name>
<message>
<source>Check for updates automatically?</source>
<translation>Automatish auf Updates prüfen?</translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>Soll %1 Automatish auf Updates prüfen? Sie können jederzeit manuell über das Menü &quot;Hilfe&quot; nach Updates suchen</translation>
</message>
</context>
<context>
<name>ModuleManager</name>
<message>
<source>Initializing...</source>
<translation>Initialisierung...</translation>
</message>
<message>
<source>Configuring updater...</source>
<translation>Konfigurieren des Updaters...</translation>
</message>
<message>
<source>Initializing modules...</source>
<translation>Module initialisieren...</translation>
</message>
<message>
<source>Starting timers...</source>
<translation>Timer starten...</translation>
</message>
<message>
<source>Loading user interface...</source>
<translation>Benutzeroberfläche laden...</translation>
</message>
</context>
<context>
<name>Network</name>
<message>
@ -1624,6 +1658,10 @@
<source>Flow Control</source>
<translation>Fluss-Kontrolle</translation>
</message>
<message>
<source>Auto-reconnect</source>
<translation>Auto-Wiederverbindung</translation>
</message>
</context>
<context>
<name>SerialManager</name>
@ -1735,19 +1773,19 @@
</message>
<message>
<source>Auto (JSON from serial device)</source>
<translation>Auto (JSON von Gerät)</translation>
<translation type="vanished">Auto (JSON von Gerät)</translation>
</message>
<message>
<source>Manual (use JSON map file)</source>
<translation>Manuell (JSON Modelldatei)</translation>
<translation type="vanished">Manuell (JSON Modelldatei)</translation>
</message>
<message>
<source>Change map file (%1)</source>
<translation>Modelldatei ändern (%1)</translation>
<translation type="vanished">Modelldatei ändern (%1)</translation>
</message>
<message>
<source>Select map file</source>
<translation>Modelldatei auswählen</translation>
<translation type="vanished">Modelldatei auswählen</translation>
</message>
<message>
<source>COM Port</source>
@ -1837,6 +1875,22 @@
<source>Setup</source>
<translation>Einstellungen</translation>
</message>
<message>
<source>No parsing (device sends JSON data)</source>
<translation>Kein Parsing (Gerät sendet JSON-Daten)</translation>
</message>
<message>
<source>Parse via JSON project file</source>
<translation>Parsen über JSON-Projektdatei</translation>
</message>
<message>
<source>Change project file (%1)</source>
<translation>Projektdatei ändern (%1)</translation>
</message>
<message>
<source>Select project file</source>
<translation>Projektdatei auswählen</translation>
</message>
</context>
<context>
<name>Sidebar</name>

Binary file not shown.

View File

@ -80,14 +80,6 @@
</context>
<context>
<name>Application</name>
<message>
<source>Check for updates automatically?</source>
<translation></translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation></translation>
</message>
<message>
<source>Drop JSON and CSV files here</source>
<translation></translation>
@ -1197,10 +1189,6 @@
<source>Documentation/wiki</source>
<translation></translation>
</message>
<message>
<source>Show log file</source>
<translation></translation>
</message>
<message>
<source>Report bug</source>
<translation></translation>
@ -1356,10 +1344,6 @@
<source>Documentation/wiki</source>
<translation></translation>
</message>
<message>
<source>Show log file</source>
<translation></translation>
</message>
<message>
<source>Report bug</source>
<translation></translation>
@ -1399,6 +1383,40 @@
<translation></translation>
</message>
</context>
<context>
<name>Misc::Utilities</name>
<message>
<source>Check for updates automatically?</source>
<translation></translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation></translation>
</message>
</context>
<context>
<name>ModuleManager</name>
<message>
<source>Initializing...</source>
<translation></translation>
</message>
<message>
<source>Configuring updater...</source>
<translation></translation>
</message>
<message>
<source>Initializing modules...</source>
<translation></translation>
</message>
<message>
<source>Starting timers...</source>
<translation></translation>
</message>
<message>
<source>Loading user interface...</source>
<translation></translation>
</message>
</context>
<context>
<name>Network</name>
<message>
@ -1462,6 +1480,10 @@
<source>Flow Control</source>
<translation>Flow control</translation>
</message>
<message>
<source>Auto-reconnect</source>
<translation></translation>
</message>
</context>
<context>
<name>SerialManager</name>
@ -1515,22 +1537,6 @@
<source>Communication Mode</source>
<translation>Communication mode</translation>
</message>
<message>
<source>Auto (JSON from serial device)</source>
<translation></translation>
</message>
<message>
<source>Manual (use JSON map file)</source>
<translation></translation>
</message>
<message>
<source>Change map file (%1)</source>
<translation></translation>
</message>
<message>
<source>Select map file</source>
<translation></translation>
</message>
<message>
<source>COM Port</source>
<translation type="vanished">COM port</translation>
@ -1575,6 +1581,22 @@
<source>Setup</source>
<translation></translation>
</message>
<message>
<source>No parsing (device sends JSON data)</source>
<translation></translation>
</message>
<message>
<source>Parse via JSON project file</source>
<translation></translation>
</message>
<message>
<source>Change project file (%1)</source>
<translation></translation>
</message>
<message>
<source>Select project file</source>
<translation></translation>
</message>
</context>
<context>
<name>Toolbar</name>

Binary file not shown.

View File

@ -98,11 +98,11 @@
<name>Application</name>
<message>
<source>Check for updates automatically?</source>
<translation>¿Buscar actualizaciones automaticamente?</translation>
<translation type="vanished">¿Buscar actualizaciones automaticamente?</translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>¿Debería %1 buscar actualizaciones automáticamente? También puedes buscar actualizaciones manualmente desde el menu de &quot;Ayuda&quot;</translation>
<translation type="vanished">¿Debería %1 buscar actualizaciones automáticamente? También puedes buscar actualizaciones manualmente desde el menu de &quot;Ayuda&quot;</translation>
</message>
<message>
<source>Drop JSON and CSV files here</source>
@ -1416,7 +1416,7 @@
</message>
<message>
<source>Show log file</source>
<translation>Mostar archivo de log</translation>
<translation type="vanished">Mostar archivo de log</translation>
</message>
<message>
<source>Report bug</source>
@ -1575,7 +1575,7 @@
</message>
<message>
<source>Show log file</source>
<translation>Mostar archivo de log</translation>
<translation type="vanished">Mostar archivo de log</translation>
</message>
<message>
<source>Report bug</source>
@ -1616,6 +1616,40 @@
<translation>¿Quiere reiniciar %1 ahora?</translation>
</message>
</context>
<context>
<name>Misc::Utilities</name>
<message>
<source>Check for updates automatically?</source>
<translation>¿Buscar actualizaciones automaticamente?</translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>¿Debería %1 buscar actualizaciones automáticamente? También puedes buscar actualizaciones manualmente desde el menu de &quot;Ayuda&quot;</translation>
</message>
</context>
<context>
<name>ModuleManager</name>
<message>
<source>Initializing...</source>
<translation>Inicializando...</translation>
</message>
<message>
<source>Configuring updater...</source>
<translation>Configurando actualizador...</translation>
</message>
<message>
<source>Initializing modules...</source>
<translation>Inicializando módulos....</translation>
</message>
<message>
<source>Starting timers...</source>
<translation>Configurando temporizadores...</translation>
</message>
<message>
<source>Loading user interface...</source>
<translation>Cargando la interfaz de usuario...</translation>
</message>
</context>
<context>
<name>Network</name>
<message>
@ -1695,6 +1729,10 @@
<source>Flow Control</source>
<translation>Control de flujo</translation>
</message>
<message>
<source>Auto-reconnect</source>
<translation>Auto reconexión</translation>
</message>
</context>
<context>
<name>SerialManager</name>
@ -1854,19 +1892,19 @@
</message>
<message>
<source>Auto (JSON from serial device)</source>
<translation>Automático (JSON desde puerto serial)</translation>
<translation type="vanished">Automático (JSON desde puerto serial)</translation>
</message>
<message>
<source>Manual (use JSON map file)</source>
<translation>Manual (usar archivo de mapa JSON)</translation>
<translation type="vanished">Manual (usar archivo de mapa JSON)</translation>
</message>
<message>
<source>Change map file (%1)</source>
<translation>Cambiar archivo (%1)</translation>
<translation type="vanished">Cambiar archivo (%1)</translation>
</message>
<message>
<source>Select map file</source>
<translation>Seleccionar archivo de mapa</translation>
<translation type="vanished">Seleccionar archivo de mapa</translation>
</message>
<message>
<source>COM Port</source>
@ -1956,6 +1994,22 @@
<source>Setup</source>
<translation>Configuración</translation>
</message>
<message>
<source>No parsing (device sends JSON data)</source>
<translation>El dispositivo envía los datos JSON</translation>
</message>
<message>
<source>Parse via JSON project file</source>
<translation>Utilizar archivo de proyecto JSON</translation>
</message>
<message>
<source>Change project file (%1)</source>
<translation>Cambiar el archivo del proyecto (%1)</translation>
</message>
<message>
<source>Select project file</source>
<translation>Seleccionar proyecto</translation>
</message>
</context>
<context>
<name>Sidebar</name>

Binary file not shown.

View File

@ -82,11 +82,11 @@
<name>Application</name>
<message>
<source>Check for updates automatically?</source>
<translation>Проверять обновления автоматически?</translation>
<translation type="vanished">Проверять обновления автоматически?</translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>Должен ли %1 автоматически проверять наличие обновлений? Вы всегда можете проверить наличие обновлений вручную из меню &quot;Помощь&quot;</translation>
<translation type="vanished">Должен ли %1 автоматически проверять наличие обновлений? Вы всегда можете проверить наличие обновлений вручную из меню &quot;Помощь&quot;</translation>
</message>
<message>
<source>Drop JSON and CSV files here</source>
@ -222,7 +222,7 @@
</message>
<message>
<source>CSV files</source>
<translation>Файлы CSV</translation>
<translation type="vanished">Файлы CSV</translation>
</message>
</context>
<context>
@ -260,27 +260,27 @@
<name>DeviceManager</name>
<message>
<source>Communication Mode</source>
<translation>Режим связи</translation>
<translation type="vanished">Режим связи</translation>
</message>
<message>
<source>COM Port</source>
<translation>COM-порт</translation>
<translation type="vanished">COM-порт</translation>
</message>
<message>
<source>Baud Rate</source>
<translation>Скорость передачи данных</translation>
<translation type="vanished">Скорость передачи данных</translation>
</message>
<message>
<source>Data Bits</source>
<translation>Биты данных</translation>
<translation type="vanished">Биты данных</translation>
</message>
<message>
<source>Stop Bits</source>
<translation>Стоп-биты</translation>
<translation type="vanished">Стоп-биты</translation>
</message>
<message>
<source>Flow Control</source>
<translation>Управление потоком</translation>
<translation type="vanished">Управление потоком</translation>
</message>
</context>
<context>
@ -445,7 +445,7 @@
<name>Export</name>
<message>
<source>CSV File Error</source>
<translation>Ошибка файла CSV</translation>
<translation type="vanished">Ошибка файла CSV</translation>
</message>
</context>
<context>
@ -1199,7 +1199,7 @@
</message>
<message>
<source>Show log file</source>
<translation>Показать файл журнала</translation>
<translation type="vanished">Показать файл журнала</translation>
</message>
<message>
<source>Report bug</source>
@ -1358,7 +1358,7 @@
</message>
<message>
<source>Show log file</source>
<translation>Показать файл журнала</translation>
<translation type="vanished">Показать файл журнала</translation>
</message>
<message>
<source>Report bug</source>
@ -1399,6 +1399,40 @@
<translation>Хотите ли вы перезапустить %1 сейчас?</translation>
</message>
</context>
<context>
<name>Misc::Utilities</name>
<message>
<source>Check for updates automatically?</source>
<translation>Проверять обновления автоматически?</translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>Должен ли %1 автоматически проверять наличие обновлений? Вы всегда можете проверить наличие обновлений вручную из меню &quot;Помощь&quot;</translation>
</message>
</context>
<context>
<name>ModuleManager</name>
<message>
<source>Initializing...</source>
<translation>Инициализация...</translation>
</message>
<message>
<source>Configuring updater...</source>
<translation>Настройка программы обновления...</translation>
</message>
<message>
<source>Initializing modules...</source>
<translation>Инициализация модулей...</translation>
</message>
<message>
<source>Starting timers...</source>
<translation>Стартовые таймеры...</translation>
</message>
<message>
<source>Loading user interface...</source>
<translation>Загрузка пользовательского интерфейса...</translation>
</message>
</context>
<context>
<name>Network</name>
<message>
@ -1462,16 +1496,20 @@
<source>Flow Control</source>
<translation>Управление потоком</translation>
</message>
<message>
<source>Auto-reconnect</source>
<translation>Автоподключение</translation>
</message>
</context>
<context>
<name>SerialManager</name>
<message>
<source>No Device</source>
<translation>Нет Устройство</translation>
<translation type="vanished">Нет Устройство</translation>
</message>
<message>
<source>Select Port</source>
<translation>Выберите порт</translation>
<translation type="vanished">Выберите порт</translation>
</message>
</context>
<context>
@ -1517,39 +1555,39 @@
</message>
<message>
<source>Auto (JSON from serial device)</source>
<translation>Авто (JSON с последовательного устройства)</translation>
<translation type="vanished">Авто (JSON с последовательного устройства)</translation>
</message>
<message>
<source>Manual (use JSON map file)</source>
<translation>Вручную (использование файла карты JSON)</translation>
<translation type="vanished">Вручную (использование файла карты JSON)</translation>
</message>
<message>
<source>Change map file (%1)</source>
<translation>Изменить файл карты (%1)</translation>
<translation type="vanished">Изменить файл карты (%1)</translation>
</message>
<message>
<source>Select map file</source>
<translation>Выберите файл карты</translation>
<translation type="vanished">Выберите файл карты</translation>
</message>
<message>
<source>COM Port</source>
<translation>COM-порт</translation>
<translation type="vanished">COM-порт</translation>
</message>
<message>
<source>Baud Rate</source>
<translation>Скорость передачи данных</translation>
<translation type="vanished">Скорость передачи данных</translation>
</message>
<message>
<source>Data Bits</source>
<translation>Биты данных</translation>
<translation type="vanished">Биты данных</translation>
</message>
<message>
<source>Stop Bits</source>
<translation>Стоп-биты</translation>
<translation type="vanished">Стоп-биты</translation>
</message>
<message>
<source>Flow Control</source>
<translation>Управление потоком</translation>
<translation type="vanished">Управление потоком</translation>
</message>
<message>
<source>Create CSV file</source>
@ -1575,6 +1613,22 @@
<source>Setup</source>
<translation>Установка</translation>
</message>
<message>
<source>No parsing (device sends JSON data)</source>
<translation>Устройство отправляет данные в формате JSON</translation>
</message>
<message>
<source>Parse via JSON project file</source>
<translation>Используйте JSON файл проекта</translation>
</message>
<message>
<source>Change project file (%1)</source>
<translation>Изменить файл проекта (%1)</translation>
</message>
<message>
<source>Select project file</source>
<translation>Выберите файл проекта</translation>
</message>
</context>
<context>
<name>Toolbar</name>

Binary file not shown.

View File

@ -94,11 +94,11 @@
<name>Application</name>
<message>
<source>Check for updates automatically?</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>%1 </translation>
<translation type="vanished">%1 </translation>
</message>
<message>
<source>Drop JSON and CSV files here</source>
@ -1381,7 +1381,7 @@
</message>
<message>
<source>Show log file</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<source>Report bug</source>
@ -1540,7 +1540,7 @@
</message>
<message>
<source>Show log file</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<source>Report bug</source>
@ -1581,6 +1581,40 @@
<translation>%1</translation>
</message>
</context>
<context>
<name>Misc::Utilities</name>
<message>
<source>Check for updates automatically?</source>
<translation></translation>
</message>
<message>
<source>Should %1 automatically check for updates? You can always check for updates manually from the &quot;Help&quot; menu</source>
<translation>%1 </translation>
</message>
</context>
<context>
<name>ModuleManager</name>
<message>
<source>Initializing...</source>
<translation>...</translation>
</message>
<message>
<source>Configuring updater...</source>
<translation>...</translation>
</message>
<message>
<source>Initializing modules...</source>
<translation>...</translation>
</message>
<message>
<source>Starting timers...</source>
<translation>...</translation>
</message>
<message>
<source>Loading user interface...</source>
<translation>...</translation>
</message>
</context>
<context>
<name>Network</name>
<message>
@ -1656,6 +1690,10 @@
<source>Flow Control</source>
<translation></translation>
</message>
<message>
<source>Auto-reconnect</source>
<translation></translation>
</message>
</context>
<context>
<name>SerialManager</name>
@ -1771,19 +1809,19 @@
</message>
<message>
<source>Auto (JSON from serial device)</source>
<translation>JSON</translation>
<translation type="vanished">JSON</translation>
</message>
<message>
<source>Manual (use JSON map file)</source>
<translation>使JSON映射文件</translation>
<translation type="vanished">使JSON映射文件</translation>
</message>
<message>
<source>Change map file (%1)</source>
<translation>%1</translation>
<translation type="vanished">%1</translation>
</message>
<message>
<source>Select map file</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<source>COM Port</source>
@ -1873,6 +1911,22 @@
<source>Setup</source>
<translation></translation>
</message>
<message>
<source>No parsing (device sends JSON data)</source>
<translation>JSON数据</translation>
</message>
<message>
<source>Parse via JSON project file</source>
<translation>JSON项目文件进行解析</translation>
</message>
<message>
<source>Change project file (%1)</source>
<translation> (%1)</translation>
</message>
<message>
<source>Select project file</source>
<translation></translation>
</message>
</context>
<context>
<name>Sidebar</name>

View File

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 246 KiB

BIN
doc/artwork/splash.xcf Normal file

Binary file not shown.

View File

@ -321,9 +321,6 @@ void Serial::disconnectDevice()
// Check if serial port pointer is valid
if (port() != nullptr)
{
// Get serial port name (used for warning messages)
auto name = portName();
// Disconnect signals/slots
port()->disconnect(this, SLOT(handleError(QSerialPort::SerialPortError)));
@ -600,6 +597,19 @@ void Serial::refreshSerialDevices()
}
}
// Auto reconnect
if (Manager::getInstance()->dataSource() == Manager::DataSource::Serial)
{
if (autoReconnect() && m_lastSerialDeviceIndex > 0)
{
if (m_lastSerialDeviceIndex < portList().count())
{
setPortIndex(m_lastSerialDeviceIndex);
Manager::getInstance()->connectDevice();
}
}
}
// Update UI
emit availablePortsChanged();
}
@ -612,11 +622,7 @@ void Serial::refreshSerialDevices()
void Serial::handleError(QSerialPort::SerialPortError error)
{
if (error != QSerialPort::NoError)
{
auto errorStr = port()->errorString();
Manager::getInstance()->disconnectDevice();
Misc::Utilities::showMessageBox(tr("Serial port error"), errorStr);
}
}
/**

View File

@ -57,27 +57,30 @@
#include <QSimpleUpdater.h>
/**
* Connect SIGNALS/SLOTS to call singleton destructors before the application
* Configures the application font, creates a splash screen and configures
* application signals/slots to destroy singleton classes before the application
* quits.
*/
ModuleManager::ModuleManager()
{
// Load application font
int id = QFontDatabase::addApplicationFont(":/fonts/Roboto-Regular.ttf");
QString family = QFontDatabase::applicationFontFamilies(id).at(0);
QFont customFont(family);
// Init translator (so that splash screen displays text in user's language)
(void)Misc::Translator::getInstance();
// Set font size
// Load Roboto fonts from resources
QFontDatabase::addApplicationFont(":/fonts/Roboto-Bold.ttf");
QFontDatabase::addApplicationFont(":/fonts/Roboto-Regular.ttf");
QFontDatabase::addApplicationFont(":/fonts/RobotoMono-Regular.ttf");
// Set Roboto as default app font
QFont font("Roboto");
#if defined(Q_OS_WIN)
customFont.setPointSize(9);
font.setPointSize(9);
#elif defined(Q_OS_MAC)
customFont.setPointSize(13);
font.setPointSize(13);
#else
customFont.setPointSize(10);
font.setPointSize(10);
#endif
// Use custom font globally
qApp->setFont(customFont);
qApp->setFont(font);
// Show splash screen
m_splash.setPixmap(QPixmap(":/images/splash.png"));

View File

@ -34,7 +34,7 @@ static Translator *INSTANCE = nullptr;
*/
Translator::Translator()
{
m_language = systemLanguage();
setLanguage(m_settings.value("language", systemLanguage()).toInt());
}
/**
@ -192,6 +192,8 @@ void Translator::setLanguage(const int language)
}
m_language = language;
m_settings.setValue("language", m_language);
setLanguage(locale, langName);
}

View File

@ -67,6 +67,7 @@ public slots:
private:
int m_language;
QSettings m_settings;
QTranslator m_translator;
};
}