Skip to content

Commit

Permalink
add a button to open the browser if TOS need to be signed
Browse files Browse the repository at this point in the history
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
  • Loading branch information
nilsding committed Feb 18, 2025
1 parent e25c778 commit e2725c1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/tray/SyncStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,15 @@ RowLayout {
enabled: visible
onClicked: NC.Systray.createResolveConflictsDialog(activityModel.allConflicts);
}

Button {
Layout.rightMargin: Style.trayHorizontalMargin

text: qsTr("Open browser")

visible: NC.UserModel.currentUser.needsToSignTermsOfService
enabled: visible

onClicked: NC.UserModel.openCurrentAccountServer()
}
}
5 changes: 5 additions & 0 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,11 @@ bool User::isConnected() const
return (_account->connectionStatus() == AccountState::ConnectionStatus::Connected);
}

bool User::needsToSignTermsOfService() const

Check warning on line 1133 in src/gui/tray/usermodel.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/tray/usermodel.cpp:1133:12 [modernize-use-trailing-return-type]

use a trailing return type for this function
{
return _account->connectionStatus() == AccountState::ConnectionStatus::NeedToSignTermsOfService;
}


bool User::isDesktopNotificationsAllowed() const
{
Expand Down
2 changes: 2 additions & 0 deletions src/gui/tray/usermodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class User : public QObject
Q_PROPERTY(QString featuredAppAccessibleName READ featuredAppAccessibleName NOTIFY featuredAppChanged)
Q_PROPERTY(QString avatar READ avatarUrl NOTIFY avatarChanged)
Q_PROPERTY(bool isConnected READ isConnected NOTIFY accountStateChanged)
Q_PROPERTY(bool needsToSignTermsOfService READ needsToSignTermsOfService NOTIFY accountStateChanged)
Q_PROPERTY(UnifiedSearchResultsListModel* unifiedSearchResultsListModel READ getUnifiedSearchResultsListModel CONSTANT)
Q_PROPERTY(QVariantList groupFolders READ groupFolders NOTIFY groupFoldersChanged)

Expand All @@ -71,6 +72,7 @@ class User : public QObject
[[nodiscard]] AccountStatePtr accountState() const;

[[nodiscard]] bool isConnected() const;
[[nodiscard]] bool needsToSignTermsOfService() const;
[[nodiscard]] bool isCurrentUser() const;
void setCurrentUser(const bool &isCurrent);
[[nodiscard]] Folder *getFolder() const;
Expand Down

0 comments on commit e2725c1

Please sign in to comment.