Skip to content

Commit

Permalink
Open sync failed dialog when "willRetry" notification is clicked (#3469)
Browse files Browse the repository at this point in the history
* creating action for when willRetry notification occurs during synchronization

* notification type added to error
  • Loading branch information
VitorVieiraZ committed May 28, 2024
1 parent dd6047b commit dab887c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 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
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

0 comments on commit dab887c

Please sign in to comment.