diff --git a/CMakeLists.txt b/CMakeLists.txt index 1290701..2f3c0e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,11 @@ if(NOT ANDROID AND NOT IOS) target_link_libraries(CloudLogOffline PRIVATE Qt::Widgets) # Cf. main.cpp endif() -install(TARGETS CloudLogOffline) +install( + TARGETS CloudLogOffline + RUNTIME DESTINATION . + BUNDLE DESTINATION ${CMAKE_SOURCE_DIR} +) option(BUILD_TESTING "Build tests" ON) @@ -108,3 +112,8 @@ if(BUILD_TESTING) enable_testing() add_subdirectory(tests) endif() + +## This is required for localization permissions to work +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(${TARGET}) +endif() diff --git a/CloudLogOffline.pro b/CloudLogOffline.pro index 16b1c59..80a533a 100644 --- a/CloudLogOffline.pro +++ b/CloudLogOffline.pro @@ -19,6 +19,9 @@ QT += core # cf. main.cpp !android:!ios: QT += widgets +QMAKE_IOS_DEPLOYMENT_TARGET = 17 + + CONFIG += c++14 DEFINES += QT_DEPRECATED_WARNINGS diff --git a/ios/Info.plist b/ios/Info.plist index fc2dba0..5f6fb3d 100644 --- a/ios/Info.plist +++ b/ios/Info.plist @@ -24,10 +24,10 @@ ${IPHONEOS_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. + NSLocationAlwaysAndWhenInUseUsageDescription + The location is utilized to identify repeaters in the Hear-Ham database that are in close proximity to your current position. NSLocationWhenInUseUsageDescription - The location is utilized to identify repeaters in the Hear-Ham database that are in close proximity to your current position. - NSLocationAlwaysAndWhenInUseUsageDescription - The location is utilized to identify repeaters in the Hear-Ham database that are in close proximity to your current position. + The location is utilized to identify repeaters in the Hear-Ham database that are in close proximity to your current position. UILaunchStoryboardName myLaunchScreen.xib UIRequiresFullScreen diff --git a/macos/Info.plist b/macos/Info.plist index ae0fb7c..b9b4421 100644 --- a/macos/Info.plist +++ b/macos/Info.plist @@ -26,6 +26,8 @@ NSApplication NSSupportsAutomaticGraphicsSwitching + CFBundleAllowMixedLocalizations + NSLocationWhenInUseUsageDescription Locating repeaters near your location diff --git a/qml/ExportView.qml b/qml/ExportView.qml index 56368a2..15e154b 100644 --- a/qml/ExportView.qml +++ b/qml/ExportView.qml @@ -25,6 +25,7 @@ Page { function onUploadFailed(error) { cloudLogMessage.text = error + console.log(error) cloudLogMessage.open() } } diff --git a/qml/Main.qml b/qml/Main.qml index 7aaf1dd..4798280 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -26,7 +26,8 @@ ApplicationWindow { onTriggered: { console.log("Orientation changed") console.log("safe margins =", JSON.stringify(tools.getSafeAreaMargins(window))) - notchTop = tools.getSafeAreaMargins(window)["top"] + //notchTop = tools.getSafeAreaMargins(window)["top"] + notchTop = 0 notchLeft = tools.getSafeAreaMargins(window)["left"] notchRight = tools.getSafeAreaMargins(window)["right"] safeWidth = window.width - tools.getSafeAreaMargins(window)["left"] - tools.getSafeAreaMargins(window)["right"] @@ -40,7 +41,7 @@ ApplicationWindow { Component.onCompleted: { tm.switchToLanguage(settings.language) - notchTop = tools.getSafeAreaMargins(window)["top"] // iPhoneX workaround + //notchTop = tools.getSafeAreaMargins(window)["top"] // iPhoneX workaround console.log("load settings.language:" + settings.language) console.log("safe margins =", JSON.stringify(tools.getSafeAreaMargins(window))) @@ -116,7 +117,8 @@ ApplicationWindow { header: ToolBar { contentHeight: toolButton.implicitHeight + notchTop // iPhone X Workaround - Material.primary: Material.BlueGrey + //Material.primary: Material.BlueGrey + Material.primary: Material.color(Material.BlueGrey, Material.Shade500) ToolButton { id: toolButton @@ -234,6 +236,7 @@ ApplicationWindow { } ListElement { + pageCommand: "repeater" pageTitle: qsTr ("Add Repeater QSO") pageIcon: "\uf055" onTriggered: function() { diff --git a/qml/PageDrawer.qml b/qml/PageDrawer.qml index ac4e80f..75b798e 100644 --- a/qml/PageDrawer.qml +++ b/qml/PageDrawer.qml @@ -191,6 +191,7 @@ Drawer { model: items width: parent.width pageSelector: listView + visible: pageCommand !== "repeater" || settings.rbActive onClicked: { if (listView.currentIndex !== index) diff --git a/qml/QSOItem.qml b/qml/QSOItem.qml index aec79e2..c49e8fe 100644 --- a/qml/QSOItem.qml +++ b/qml/QSOItem.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.0 import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material 2.4 import Qt5Compat.GraphicalEffects SwipeDelegate { @@ -45,7 +45,7 @@ SwipeDelegate { anchors.topMargin: 5 font.wordSpacing: 0 font.capitalization: Font.Capitalize - color: "#607D8B" + color: Material.color(Material.BlueGrey, Material.Shade400) font.pixelSize: 20 font.bold: true } diff --git a/qml/SettingsView.qml b/qml/SettingsView.qml index 139f4a6..d07f8b8 100644 --- a/qml/SettingsView.qml +++ b/qml/SettingsView.qml @@ -40,11 +40,12 @@ Page { if (clURL.startsWith("https://")) { clURL = clURL.substring(8, clURL.length); } + settings.cloudLogURL = clURL; settings.cloudLogSSL = cloudLogSSL.currentText; settings.cloudLogSSLIndex = cloudLogSSL.currentIndex; settings.cloudLogKey = cloudLogKey.text; - settings.cloudLogStationId = cloudLogStationId.value; + settings.cloudLogStationId = cloudLogStationId.text; settings.cloudLogActive = cloudLogSwitch.checked; settings.qrzUser = qrzUser.text; @@ -164,6 +165,8 @@ Page { Label { id: callLabel text: qsTr("Your Call") + ":" + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -173,17 +176,24 @@ Page { onTextEdited: saveSettings() onEditingFinished: saveSettings(); font.capitalization: Font.AllUppercase + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } Label { id: gridsquareLabel text: qsTr("Locator") + ":" + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } GridLayout { id: locatorgrid columns: 2 + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + TextField { id: gridsquare Layout.fillWidth: true @@ -204,11 +214,17 @@ Page { Label { id: languageLabel text: qsTr("Language") + ":" + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } ComboBox { id: language Layout.fillWidth: true + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + model: [ "English", "German", @@ -241,12 +257,18 @@ Page { id: cqModeLabel text: qsTr("Mode") + ":" visible: cqSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } ComboBox { id: cqMode Layout.fillWidth: true visible: cqSwitch.checked + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + model: [ "SSB", "SSB / LSB", @@ -295,12 +317,18 @@ Page { id: cqFreqLabel text: qsTr("QRG [MHz]") + ":" visible: cqSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { id: cqFreq Layout.fillWidth: true visible: cqSwitch.checked + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + text: settings.cqFreq onTextEdited: saveSettings() onEditingFinished: saveSettings(); @@ -321,10 +349,16 @@ Page { id: contestNumberLabel text: qsTr("Number / Province") + ":" visible: contestSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } RowLayout { visible: contestSwitch.checked + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + TextField { id: contestNumber Layout.fillWidth: true @@ -361,6 +395,8 @@ Page { id: cloudLogURLLabel text: qsTr("Hostname") + ":" visible: cloudLogSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -369,20 +405,28 @@ Page { visible: cloudLogSwitch.checked text: settings.cloudLogURL onEditingFinished: saveSettings() + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } Label { id: sslLabel text: qsTr("Encryption") + ":" visible: cloudLogSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } ComboBox { id: cloudLogSSL Layout.fillWidth: true + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + model: [ - "HTTP", - "HTTPS" + "HTTPS", + "HTTP" ] Component.onCompleted: { @@ -399,6 +443,8 @@ Page { id: cloudLogKeyLabel text: qsTr("API Key") + ":" visible: cloudLogSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } GridLayout { @@ -406,6 +452,9 @@ Page { visible: cloudLogSwitch.checked columns: 2 + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + TextField { id: cloudLogKey Layout.fillWidth: true @@ -431,16 +480,20 @@ Page { id: cloudLogStationIdLabel text: qsTr("Station ID") + ":" visible: cloudLogSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } - SpinBox { + TextField { id: cloudLogStationId + Layout.fillWidth: true visible: cloudLogSwitch.checked - from: 1 - to: 999 - editable: true - value: settings.cloudLogStationId - onValueModified: saveSettings(); + text: settings.cloudLogStationId + onTextEdited: saveSettings() + onEditingFinished: saveSettings() + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } // ---------------- @@ -458,6 +511,8 @@ Page { id: qrzUserLabel text: qsTr("Username") + ":" visible: qrzSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -467,12 +522,17 @@ Page { text: settings.qrzUser onTextEdited: saveSettings(); onEditingFinished: saveSettings(); + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } Label { id: qrzPassLabel text: qsTr("Password") + ":" visible: qrzSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -483,6 +543,9 @@ Page { text: settings.qrzPass onTextEdited: saveSettings(); onEditingFinished: saveSettings(); + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } // ---------------- @@ -500,6 +563,8 @@ Page { id: rigHostLabel text: qsTr("Hostname") + ":" visible: rigSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -509,12 +574,17 @@ Page { text: settings.rigHost onTextEdited: saveSettings(); onEditingFinished: saveSettings(); + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } Label { id: rigPortLabel text: qsTr("Port") + ":" visible: rigSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -524,6 +594,9 @@ Page { text: settings.rigPort onTextEdited: saveSettings(); onEditingFinished: saveSettings(); + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } // ---------------- @@ -541,6 +614,8 @@ Page { id: mySotaLabel text: qsTr("Reference") + ":" visible: sotaSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -552,6 +627,9 @@ Page { onEditingFinished: saveSettings(); font.capitalization: Font.AllUppercase inputMethodHints: Qt.ImhUppercaseOnly + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } // ---------------- @@ -569,6 +647,8 @@ Page { id: myWWFFLabel text: qsTr("Reference") + ":" visible: wwffSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -580,6 +660,9 @@ Page { onEditingFinished: saveSettings(); font.capitalization: Font.AllUppercase inputMethodHints: Qt.ImhUppercaseOnly + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } // ---------------- @@ -596,6 +679,8 @@ Page { id: myPotaLabel text: qsTr("Reference") + ":" visible: potaSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -607,6 +692,9 @@ Page { onEditingFinished: saveSettings(); font.capitalization: Font.AllUppercase inputMethodHints: Qt.ImhUppercaseOnly + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } // ---------------- @@ -634,6 +722,8 @@ Page { Label { text: qsTr("Radius") + ":" visible: rbSwitch.checked + Layout.leftMargin: 10 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter } TextField { @@ -645,6 +735,9 @@ Page { onEditingFinished: saveSettings(); font.capitalization: Font.AllUppercase inputMethodHints: Qt.ImhUppercaseOnly + + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } } } diff --git a/src/cloudlogmanager.cpp b/src/cloudlogmanager.cpp index 66c4038..78ec0c3 100644 --- a/src/cloudlogmanager.cpp +++ b/src/cloudlogmanager.cpp @@ -165,7 +165,7 @@ void cloudlogManager::callbackCloudLog(QNetworkReply *rep) emit uploadSucessfull(((double)done)/((double)number)); } else { - emit uploadFailed("Upload Error: " + jsonObject["reason"].toString()); + emit uploadFailed("Status: " + jsonObject["status"].toString() + ", Upload Error: " + jsonObject["reason"].toString()); } }