Skip to content

Commit

Permalink
Merge branch 'master' into enable-predictive-text
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasMizera committed May 28, 2024
2 parents c8bae3d + c567e61 commit 531f28c
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 6 deletions.
6 changes: 6 additions & 0 deletions app/notificationmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ void NotificationModel::onNotificationClicked( uint id )
emit showSwitchWorkspaceActionClicked();
break;
}
case NotificationType::ActionType::ShowSyncFailedDialog:
{
remove( id );
emit showSyncFailedDialogClicked();
break;
}
default: break;
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/notificationmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class NotificationType
{
NoAction,
ShowProjectIssuesAction,
ShowSwitchWorkspaceAction
ShowSwitchWorkspaceAction,
ShowSyncFailedDialog
};
Q_ENUM( ActionType )

Expand Down Expand Up @@ -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 );
Expand Down
10 changes: 8 additions & 2 deletions app/qml/account/MMAccountController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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." )
}
}
}
Expand Down Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions app/qml/account/MMLoginPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ MMPage {
textFieldBackground.color: __style.lightGreenColor

text: root.apiRoot
placeholderText: "https://my-server-app.com/"

// Qt.ImhNoPredictiveText must be accompanied by Qt.ImhSensitiveData, see https://bugreports.qt.io/browse/QTBUG-86982
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhUrlCharactersOnly
Expand Down
7 changes: 5 additions & 2 deletions app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -925,6 +925,9 @@ ApplicationWindow {
stateManager.state = "projects"
projectController.showSelectWorkspacePage()
}
function onShowSyncFailedDialogClicked() {
syncFailedDialog.open()
}
}

Connections {
Expand Down
13 changes: 13 additions & 0 deletions app/qml/project/MMProjectHomeTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
13 changes: 13 additions & 0 deletions app/qml/project/MMProjectServerTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion core/merginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ void MerginApi::createProjectFinished()

CoreUtils::log( "create " + projectFullName, message );

emit projectCreated( projectName, false );
emit projectCreated( projectFullName, false );

if ( showLimitReachedDialog )
{
Expand Down

0 comments on commit 531f28c

Please sign in to comment.