From 92e08bbd1497c3837df178bbd232e49110f511f8 Mon Sep 17 00:00:00 2001 From: Tomas Mizera Date: Fri, 24 May 2024 14:29:01 +0200 Subject: [PATCH 1/5] Fix ANR when opening project with searchbar focus --- app/qml/project/MMProjectHomeTab.qml | 13 +++++++++++++ app/qml/project/MMProjectServerTab.qml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/app/qml/project/MMProjectHomeTab.qml b/app/qml/project/MMProjectHomeTab.qml index 10727256c..22ffe266e 100644 --- a/app/qml/project/MMProjectHomeTab.qml +++ b/app/qml/project/MMProjectHomeTab.qml @@ -142,6 +142,19 @@ Item { } onOpenProjectRequested: function( projectFilePath ) { + + // + // There was an issue when closing the projects controller while having the searchbar textField focused + // (not neccessarily with keyboard opened). This is a kind-of workaround and hotfix. + // It might be related to https://bugreports.qt.io/browse/QTBUG-123876 as it started + // to occur more frequently when we upgraded to Qt 6.6.3 + // + // See https://github.com/MerginMaps/mobile/issues/3027 + // + if ( searchBar.textField.activeFocus ) { + searchBar.textField.focus = false + } + root.openProjectRequested( projectFilePath ) } onShowLocalChangesRequested: function( projectId ) { diff --git a/app/qml/project/MMProjectServerTab.qml b/app/qml/project/MMProjectServerTab.qml index aafbf9617..188250bce 100644 --- a/app/qml/project/MMProjectServerTab.qml +++ b/app/qml/project/MMProjectServerTab.qml @@ -64,6 +64,19 @@ Item { } onOpenProjectRequested: function( projectFilePath ) { + + // + // There was an issue when closing the projects controller while having the searchbar textField focused + // (not neccessarily with keyboard opened). This is a kind-of workaround and hotfix. + // It might be related to https://bugreports.qt.io/browse/QTBUG-123876 as it started + // to occur more frequently when we upgraded to Qt 6.6.3 + // + // See https://github.com/MerginMaps/mobile/issues/3027 + // + if ( searchBar.textField.activeFocus ) { + searchBar.textField.focus = false + } + root.openProjectRequested( projectFilePath ) } onShowLocalChangesRequested: function( projectId ) { From 4501d1649acb430638407b3567ad0a4cb3cd0adf Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Sat, 25 May 2024 03:36:23 -0300 Subject: [PATCH 2/5] small fix in projectCreated signal --- core/merginapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/merginapi.cpp b/core/merginapi.cpp index d7dd5cd4f..781c8e990 100644 --- a/core/merginapi.cpp +++ b/core/merginapi.cpp @@ -1181,7 +1181,7 @@ void MerginApi::createProjectFinished() CoreUtils::log( "create " + projectFullName, message ); - emit projectCreated( projectName, false ); + emit projectCreated( projectFullName, false ); if ( showLimitReachedDialog ) { From 055b537fba076abc7c5af7e67d5729fa0debf386 Mon Sep 17 00:00:00 2001 From: Tomas Mizera Date: Mon, 27 May 2024 14:31:09 +0200 Subject: [PATCH 3/5] Update generic error message in login screen --- app/qml/account/MMAccountController.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/qml/account/MMAccountController.qml b/app/qml/account/MMAccountController.qml index 46fc60b57..f28e8d9bb 100644 --- a/app/qml/account/MMAccountController.qml +++ b/app/qml/account/MMAccountController.qml @@ -95,11 +95,11 @@ Item { } else { if (__merginApi.apiVersionStatus === MM.MerginApiStatus.INCOMPATIBLE) { - qsTr("Please update the app to use the latest features.") + qsTr( "Please update the app to use the latest features." ) } else if (__merginApi.apiVersionStatus === MM.MerginApiStatus.PENDING) { "" } else { - qsTr("Server is currently unavailable - please try again later.") + qsTr( "Server is currently unavailable, check your connection or try again later." ) } } } From dab887c6b0d0c3df0801df0197b403c6a03b248f Mon Sep 17 00:00:00 2001 From: Vitor Vieira <155513369+VitorVieiraZ@users.noreply.github.com> Date: Tue, 28 May 2024 05:12:24 -0300 Subject: [PATCH 4/5] Open sync failed dialog when "willRetry" notification is clicked (#3469) * creating action for when willRetry notification occurs during synchronization * notification type added to error --- app/notificationmodel.cpp | 6 ++++++ app/notificationmodel.h | 4 +++- app/qml/main.qml | 7 +++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/notificationmodel.cpp b/app/notificationmodel.cpp index 7271bd9e3..d7083c29c 100644 --- a/app/notificationmodel.cpp +++ b/app/notificationmodel.cpp @@ -150,6 +150,12 @@ void NotificationModel::onNotificationClicked( uint id ) emit showSwitchWorkspaceActionClicked(); break; } + case NotificationType::ActionType::ShowSyncFailedDialog: + { + remove( id ); + emit showSyncFailedDialogClicked(); + break; + } default: break; } } diff --git a/app/notificationmodel.h b/app/notificationmodel.h index 7f8053593..6b2b126f1 100644 --- a/app/notificationmodel.h +++ b/app/notificationmodel.h @@ -41,7 +41,8 @@ class NotificationType { NoAction, ShowProjectIssuesAction, - ShowSwitchWorkspaceAction + ShowSwitchWorkspaceAction, + ShowSyncFailedDialog }; Q_ENUM( ActionType ) @@ -109,6 +110,7 @@ class NotificationModel : public QAbstractListModel void rowCountChanged(); void showProjectIssuesActionClicked(); void showSwitchWorkspaceActionClicked(); + void showSyncFailedDialogClicked(); private: void add( const QString &message, uint interval, NotificationType::MessageType type = NotificationType::Information, NotificationType::IconType icon = NotificationType::NoneIcon, NotificationType::ActionType action = NotificationType::ActionType::NoAction ); diff --git a/app/qml/main.qml b/app/qml/main.qml index 9fa962602..2051c4439 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -837,8 +837,8 @@ ApplicationWindow { syncFailedDialog.detailedText = qsTr( "Details" ) + ": " + errorMessage if ( willRetry ) { - // TODO: open sync failed dialogue when clicked on the notification - __notificationModel.addError( qsTr( "There was an issue during synchronisation, we will try again. Click to learn more" ) ) + __notificationModel.addError( qsTr( "There was an issue during synchronisation, we will try again. Click to learn more" ), + MM.NotificationType.ShowSyncFailedDialog ) } else { @@ -925,6 +925,9 @@ ApplicationWindow { stateManager.state = "projects" projectController.showSelectWorkspacePage() } + function onShowSyncFailedDialogClicked() { + syncFailedDialog.open() + } } Connections { From c5f123ccbdef3e76adeef0463a540d9081a09bb7 Mon Sep 17 00:00:00 2001 From: Vitor Vieira <155513369+VitorVieiraZ@users.noreply.github.com> Date: Tue, 28 May 2024 10:08:53 -0300 Subject: [PATCH 5/5] Custom server UX enhancement (#3470) * custom server UX enhancement * custom server placeholder text not translatable --- app/qml/account/MMAccountController.qml | 6 ++++++ app/qml/account/MMLoginPage.qml | 1 + 2 files changed, 7 insertions(+) diff --git a/app/qml/account/MMAccountController.qml b/app/qml/account/MMAccountController.qml index f28e8d9bb..bc611853d 100644 --- a/app/qml/account/MMAccountController.qml +++ b/app/qml/account/MMAccountController.qml @@ -130,6 +130,12 @@ Item { } onChangeServerClicked: function ( newServer ) { + // Ensure the newServer string ends with a '/' + // to format it as "https://my-server-app.com/" + if ( newServer && newServer.slice( -1 ) !== '/' ) { + newServer += '/'; + } + __merginApi.apiRoot = newServer } diff --git a/app/qml/account/MMLoginPage.qml b/app/qml/account/MMLoginPage.qml index 98a17611a..f706faee1 100644 --- a/app/qml/account/MMLoginPage.qml +++ b/app/qml/account/MMLoginPage.qml @@ -204,6 +204,7 @@ MMPage { textFieldBackground.color: __style.lightGreenColor text: root.apiRoot + placeholderText: "https://my-server-app.com/" textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhUrlCharactersOnly }