mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 12:35:52 +03:00
addd a cmake option to enable single account desktop client
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
ecb40f28e7
commit
91ea14d49e
6 changed files with 22 additions and 1 deletions
|
@ -44,6 +44,8 @@ option( WITH_PROVIDERS "Build with providers list" ON )
|
|||
|
||||
option( ENFORCE_VIRTUAL_FILES_SYNC_FOLDER "Enforce use of virtual files sync folder when available" OFF )
|
||||
|
||||
option(ENFORCE_SINGLE_ACCOUNT "Enforce use of a single account in desktop client" OFF)
|
||||
|
||||
option( DO_NOT_USE_PROXY "Do not use system wide proxy, instead always do a direct connection to server" OFF )
|
||||
|
||||
## Theming options
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#define APPLICATION_URI_HANDLER_SCHEME "@APPLICATION_URI_HANDLER_SCHEME@"
|
||||
#cmakedefine01 ENFORCE_VIRTUAL_FILES_SYNC_FOLDER
|
||||
#cmakedefine DO_NOT_USE_PROXY "@DO_NOT_USE_PROXY@"
|
||||
#cmakedefine ENFORCE_SINGLE_ACCOUNT "@ENFORCE_SINGLE_ACCOUNT@"
|
||||
|
||||
#cmakedefine ZLIB_FOUND @ZLIB_FOUND@
|
||||
|
||||
|
|
|
@ -554,6 +554,11 @@ void ownCloudGui::slotLogout()
|
|||
|
||||
void ownCloudGui::slotNewAccountWizard()
|
||||
{
|
||||
#if defined ENFORCE_SINGLE_ACCOUNT
|
||||
if (!AccountManager::instance()->accounts().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
|
||||
}
|
||||
|
||||
|
|
|
@ -490,6 +490,15 @@ bool Systray::isOpen() const
|
|||
return _isOpen;
|
||||
}
|
||||
|
||||
bool Systray::enableAddAccount() const
|
||||
{
|
||||
#if defined ENFORCE_SINGLE_ACCOUNT
|
||||
return AccountManager::instance()->accounts().isEmpty();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Systray::setIsOpen(const bool isOpen)
|
||||
{
|
||||
_isOpen = isOpen;
|
||||
|
|
|
@ -69,6 +69,7 @@ class Systray
|
|||
Q_PROPERTY(bool useNormalWindow READ useNormalWindow CONSTANT)
|
||||
Q_PROPERTY(bool syncIsPaused READ syncIsPaused WRITE setSyncIsPaused NOTIFY syncIsPausedChanged)
|
||||
Q_PROPERTY(bool isOpen READ isOpen WRITE setIsOpen NOTIFY isOpenChanged)
|
||||
Q_PROPERTY(bool enableAddAccount READ enableAddAccount CONSTANT)
|
||||
|
||||
public:
|
||||
static Systray *instance();
|
||||
|
@ -92,6 +93,8 @@ public:
|
|||
Q_REQUIRED_RESULT bool syncIsPaused() const;
|
||||
Q_REQUIRED_RESULT bool isOpen() const;
|
||||
|
||||
[[nodiscard]] bool enableAddAccount() const;
|
||||
|
||||
bool raiseDialogs();
|
||||
|
||||
signals:
|
||||
|
|
|
@ -350,8 +350,9 @@ ApplicationWindow {
|
|||
|
||||
MenuItem {
|
||||
id: addAccountButton
|
||||
height: Style.addAccountButtonHeight
|
||||
height: Systray.enableAddAccount ? Style.addAccountButtonHeight : 0
|
||||
hoverEnabled: true
|
||||
visible: Systray.enableAddAccount
|
||||
|
||||
background: Item {
|
||||
height: parent.height
|
||||
|
|
Loading…
Reference in a new issue