Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tray window #1565

Merged
merged 126 commits into from
Jan 18, 2020
Merged
Show file tree
Hide file tree
Changes from 125 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
7f764f8
Added basic UI [WIP] for new tray window
DominiqueFuchs Oct 27, 2019
5c3f71c
Merge branch 'master' into qml-tray-menu
DominiqueFuchs Oct 27, 2019
1e43c29
Add new qml tray icon.
Oct 27, 2019
f9f1b49
Added new vector graphics for tray window header icons
DominiqueFuchs Oct 28, 2019
73667a5
Updated vecto icons and names, disabled init position (breaks on mult…
DominiqueFuchs Oct 29, 2019
6135eb2
Finished (static) header design and hover effects
DominiqueFuchs Oct 29, 2019
cb7b2a3
Merge branch 'master' into qml-tray-menu
DominiqueFuchs Oct 30, 2019
06b2510
Initial ListView design/modeling for activity list
DominiqueFuchs Oct 30, 2019
c6ff66b
Smoother deletions: Added animation for removeDisplaced including seq…
DominiqueFuchs Nov 4, 2019
03c0d8b
Minor preps for c++ ActivityListModel impl. in QML
DominiqueFuchs Nov 29, 2019
08d4c56
WIP: Extending systray class, transitioning towas independent Activit…
DominiqueFuchs Dec 2, 2019
478281d
Restructures and refactorings: New systray class, handling of current…
DominiqueFuchs Dec 2, 2019
c21e4f5
Clean up test variable
DominiqueFuchs Dec 2, 2019
dac1c9b
Avatar, full user name and server address now reflected in QML gui, p…
DominiqueFuchs Dec 3, 2019
53abf5a
WIP: Building User/MenuModel backend for tray menu
DominiqueFuchs Dec 3, 2019
4478399
More stuff regarding tray/UserModel.cpp
DominiqueFuchs Dec 3, 2019
57084fb
WIP: working UserModel.cpp and account menu
DominiqueFuchs Dec 3, 2019
4e0997d
Minor fixes and enhancements
DominiqueFuchs Dec 4, 2019
3a0ccf3
connected UserModel login/logout signals, minor fixes
DominiqueFuchs Dec 4, 2019
90ace3f
Minor preps for c++ ActivityListModel impl. in QML
DominiqueFuchs Nov 29, 2019
0c81d25
Clean up test variable
DominiqueFuchs Dec 2, 2019
d1d1f9b
Connected AccountWizard with new account action in tray menu, minor f…
DominiqueFuchs Dec 4, 2019
3a4ca5e
Working on account switching
DominiqueFuchs Dec 4, 2019
5eff860
Account swtich logic and UI updates
DominiqueFuchs Dec 5, 2019
c18611d
Finished account switch back- and frontend in tray menuwindow
DominiqueFuchs Dec 5, 2019
ab9897b
Added frontend invokation to open local folder
DominiqueFuchs Dec 6, 2019
ae7eddf
Fixed inconsistent module import versions (based on Qt 5.9)
DominiqueFuchs Dec 8, 2019
66bfccc
Replaced .engine() by pointer access b/c of backward compatibility
DominiqueFuchs Dec 8, 2019
c45d221
Removal of init.qml plus minor fixes
DominiqueFuchs Dec 8, 2019
6a04fe8
Remove init.qml from CMakeLists and resource file
DominiqueFuchs Dec 9, 2019
438a445
Merge remote-tracking branch 'origin/master' into qml-tray-menu
DominiqueFuchs Dec 9, 2019
bb45a5f
Added popup show/hide logic
DominiqueFuchs Dec 30, 2019
6f8ffc0
Backend code separation & structure cleanup
DominiqueFuchs Dec 30, 2019
44bfc79
Implemented platform agnostic tray window positioning logic
DominiqueFuchs Dec 30, 2019
7653c5f
Fix merge conflict
DominiqueFuchs Jan 2, 2020
d4b3346
Fall back to primary screen on QT version < 5.10 instead of icon posi…
DominiqueFuchs Jan 2, 2020
36467c1
Added folder search for User instance, added open folder button conne…
DominiqueFuchs Jan 2, 2020
556a1a5
Added ActivityModel in new tray backend, implemented as delegate in UI
DominiqueFuchs Jan 2, 2020
b32310b
Gigantic ton of changes and deletions: ActivityListModel, tray GUI, A…
DominiqueFuchs Jan 3, 2020
02cb431
Fix git not recognizing case sensitive changes
DominiqueFuchs Jan 3, 2020
25e0981
Fixed client.qrc
DominiqueFuchs Jan 3, 2020
687a992
Has function for ActivityModel, typos
DominiqueFuchs Jan 3, 2020
faf46fc
More typo fix
DominiqueFuchs Jan 3, 2020
f01c47e
Fix server adress retreival in tray window buttons
DominiqueFuchs Jan 3, 2020
e0641df
First real activity connection
DominiqueFuchs Jan 3, 2020
ff92adf
Tray account menu wording/positioning
DominiqueFuchs Jan 4, 2020
ed9c065
Fix macOS popup y position, neglecting unneccesary calculations
DominiqueFuchs Jan 4, 2020
dc97444
Fix wrong macro clause
DominiqueFuchs Jan 4, 2020
d653618
Fix blurry caret svg due to https://bugreports.qt.io/browse/QTBUG-44863
DominiqueFuchs Jan 4, 2020
aa9921c
Quit/settings button in tray menu, disable context menu, font size fixes
DominiqueFuchs Jan 4, 2020
a90995c
Focus and popup improvements for macOS
DominiqueFuchs Jan 5, 2020
330ff96
Code cleanup regarding context menu. Pause/resume logic implemented. …
DominiqueFuchs Jan 5, 2020
6ac1a4a
Preps for UserLine submenu
DominiqueFuchs Jan 5, 2020
9c0221a
UserLine drafting, bugfixes, restuctures
DominiqueFuchs Jan 10, 2020
80e2156
More UserLine, avatar fixes
DominiqueFuchs Jan 11, 2020
a021f62
Tray creation timing, account menu reinstantiating on visible change
DominiqueFuchs Jan 11, 2020
3da982f
Implemented account removal
DominiqueFuchs Jan 11, 2020
3274116
Detect newly added user and rebuild account menu automatically
DominiqueFuchs Jan 11, 2020
9af7d4a
Fix crash on startup when no users configured
DominiqueFuchs Jan 11, 2020
6485ef4
Added confirmation dialog for account removal
DominiqueFuchs Jan 11, 2020
7381275
Fix comment
DominiqueFuchs Jan 11, 2020
86b915d
Systray now a singleton with instance(), show tray on finished wizard
DominiqueFuchs Jan 11, 2020
cc671df
Fix local folder URL
DominiqueFuchs Jan 11, 2020
578a3b4
Streamlined 'Add account' button with account entries
DominiqueFuchs Jan 11, 2020
bc8f64b
Generalized connection check, now working for every user in account menu
DominiqueFuchs Jan 12, 2020
8ec7cfa
Connection status indicators as avatar overlay
DominiqueFuchs Jan 12, 2020
78f12de
Merge branch 'master' into qml-tray-menu
DominiqueFuchs Jan 12, 2020
a2c9e36
call resetRejectedCertificates on fresh login
DominiqueFuchs Jan 12, 2020
212e1f8
emit signal for current user GUI refresh on login/logout
DominiqueFuchs Jan 12, 2020
7f35178
More fixes to login/logout logic
DominiqueFuchs Jan 12, 2020
b76da25
Model/View improvements, also fixes crash on account removal
DominiqueFuchs Jan 12, 2020
1c29160
Bunch of fixes and optimizations for activityList
DominiqueFuchs Jan 12, 2020
163ca3b
Removed old account toolbox
DominiqueFuchs Jan 12, 2020
715924c
Show activitylist on initial tray opening when logged in
DominiqueFuchs Jan 12, 2020
58f1c32
Temperarily disabling animations due to lags - FIXME
DominiqueFuchs Jan 12, 2020
9319210
Fix local folder not opening on windows, add extra slash
DominiqueFuchs Jan 13, 2020
9e6df7a
Add populate transition
DominiqueFuchs Jan 13, 2020
17fcfd4
Show ListView delegate only when model is populated (prevent dummy de…
DominiqueFuchs Jan 13, 2020
1ebcd3a
Icon selection, svg path transfers, scrollbar
DominiqueFuchs Jan 13, 2020
96a74d9
Minor improvements
DominiqueFuchs Jan 13, 2020
9e82ba6
Integrated local sync activities in activitymodel
DominiqueFuchs Jan 13, 2020
8406663
Integrated local error messages in activitymodel
DominiqueFuchs Jan 13, 2020
eeefbe5
Added progressInfo / cleanup to acitivtymodel
DominiqueFuchs Jan 13, 2020
e4b19d0
Activity refresh in background
DominiqueFuchs Jan 13, 2020
f748a4b
Made tray window positioning HighDPI aware
DominiqueFuchs Jan 13, 2020
65b47d4
Make qml UI strings translatable
DominiqueFuchs Jan 14, 2020
c09dd92
Fix missing trayScreen init in non-OSX clause
DominiqueFuchs Jan 14, 2020
29138cc
Font and icon size improvements, svg transfer to new folder
DominiqueFuchs Jan 14, 2020
b57b8cf
Resized add account icon, adapted layout for new size
DominiqueFuchs Jan 15, 2020
cb328d6
Fetch server Apps in AccountState (moved from ownCloudGui)
misch7 Jan 15, 2020
7b740f5
Remove setTalkCapability() from AccountState and filter for Talk upon…
misch7 Jan 15, 2020
b4b6366
Add App list menu to Tray UI
misch7 Jan 15, 2020
42ebc7e
Remove debug output
misch7 Jan 15, 2020
026bf02
App menu: Filter out Talk because we have a dedicated button for it
misch7 Jan 15, 2020
0ec2291
Layout adjustments & also show remote path in activitylist
DominiqueFuchs Jan 15, 2020
9b32ebd
Allow text to expand further if one or both buttons aren't visible
DominiqueFuchs Jan 15, 2020
ddf67ff
Preserve a 2px distance from tray border (streamlining with acount menu)
DominiqueFuchs Jan 15, 2020
00d73a9
Add visual separation between accountStateIndicator and avatar
DominiqueFuchs Jan 15, 2020
3488fd7
Fix font sizes for "Log out" and "Remove account" and the Apps menu
misch7 Jan 15, 2020
7fe1383
Double the width of the Apps menu (x starts at the Talk button)
misch7 Jan 15, 2020
246f7e9
1px border #0082c9 around tray window
DominiqueFuchs Jan 16, 2020
db92d5b
append the correct folderwatcher (platform specific)
DominiqueFuchs Jan 16, 2020
d7a9940
Fix failing of several tests by including ocsjob source (after its in…
DominiqueFuchs Jan 16, 2020
9f259bd
Add check if applist rowCount() already empty to prevent assert excep…
DominiqueFuchs Jan 16, 2020
06fdde8
Upgrade of NC server API usage + corresponding activity queries and p…
DominiqueFuchs Jan 16, 2020
cd80c74
Retreive and svg data from icon property url for activity entries
DominiqueFuchs Jan 16, 2020
b9a350e
Minor layout adjustments
DominiqueFuchs Jan 16, 2020
1bc8ec5
Streamlining local sync notification/activity icons with server ones.…
DominiqueFuchs Jan 16, 2020
4b79c59
Disabled animations until population glitches are fixed
DominiqueFuchs Jan 16, 2020
585094a
Minor property hierarchy fix
DominiqueFuchs Jan 16, 2020
9432535
Fixed bug regarding additional but empty delegate at end of activitylist
DominiqueFuchs Jan 16, 2020
9abc1eb
Add initial support for Apps menu icon display (show remote SVGs)
misch7 Jan 16, 2020
1c22070
Refresh immediately on showWindow, regardless of the timer
DominiqueFuchs Jan 17, 2020
7ea2f3f
Refresh visibility of ListView based on presence of items on showWindow
DominiqueFuchs Jan 17, 2020
f425dfd
Set sourceSize to prevent blurry rerendering of svg source in activit…
DominiqueFuchs Jan 17, 2020
0156edf
Removed visibility workaround
DominiqueFuchs Jan 17, 2020
1c5cdc4
Adapted currentId logic for activity fetching to new API (should fix …
DominiqueFuchs Jan 17, 2020
599dae0
Inclusion of possible 'notification' type descriptions in activity
DominiqueFuchs Jan 17, 2020
c9719f4
Fix hover property wrongly placed in button, not MouseArea
DominiqueFuchs Jan 17, 2020
889cb63
Add Activity date and time
misch7 Jan 17, 2020
b47adb7
Notifications bug fix: Don't init ETag response header with *
misch7 Jan 17, 2020
3ae55c2
AccountState: Add helper to find navigation App
misch7 Jan 17, 2020
e2188b1
Limit fetching Activities to 100 or max. 30 days old
misch7 Jan 17, 2020
de74057
Add grey hint Activity entry if limit is reached
misch7 Jan 17, 2020
9b5bb13
Code maintenance - correct some syntax, fix some warnings.
DominiqueFuchs Jan 18, 2020
016a90d
More code maintenance
misch7 Jan 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<qresource prefix="/client">
<file>resources/settings.png</file>
<file>resources/settings@2x.png</file>
<file>resources/activity.svg</file>
<file>resources/activity.png</file>
<file>resources/activity@2x.png</file>
<file>resources/network.png</file>
Expand All @@ -11,6 +12,7 @@
<file>resources/lock-https.png</file>
<file>resources/lock-https@2x.png</file>
<file>resources/account.png</file>
<file>resources/account.svg</file>
<file>resources/more.svg</file>
<file>resources/delete.png</file>
<file>resources/close.svg</file>
Expand All @@ -28,7 +30,14 @@
<file>resources/copy.svg</file>
<file>resources/state-sync.svg</file>
<file>resources/add.png</file>
<file>resources/add-color.svg</file>
<file>resources/state-info.svg</file>
<file>resources/change.svg</file>
<file>resources/delete-color.svg</file>
</qresource>
<qresource prefix="/"/>
<qresource prefix="/qml">
<file>src/gui/tray/Window.qml</file>
<file>src/gui/tray/UserLine.qml</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions resources/add-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/change.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/delete-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions src/common/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void Utility::usleep(int usec)
}

// This can be overriden from the tests
OCSYNC_EXPORT bool fsCasePreserving_override = []()-> bool {
OCSYNC_EXPORT bool fsCasePreserving_override = []() -> bool {
QByteArray env = qgetenv("OWNCLOUD_TEST_CASE_PRESERVING");
if (!env.isEmpty())
return env.toInt();
Expand Down Expand Up @@ -362,12 +362,12 @@ QString Utility::fileNameForGuiUse(const QString &fName)
QByteArray Utility::normalizeEtag(QByteArray etag)
{
/* strip "XXXX-gzip" */
if(etag.startsWith('"') && etag.endsWith("-gzip\"")) {
if (etag.startsWith('"') && etag.endsWith("-gzip\"")) {
etag.chop(6);
etag.remove(0, 1);
}
/* strip trailing -gzip */
if(etag.endsWith("-gzip")) {
if (etag.endsWith("-gzip")) {
etag.chop(5);
}
/* strip normal quotes */
Expand Down Expand Up @@ -400,7 +400,7 @@ void Utility::crash()
// without compiler warnings about possible truncation
uint Utility::convertSizeToUint(size_t &convertVar)
{
if( convertVar > UINT_MAX ) {
if (convertVar > UINT_MAX) {
//throw std::bad_cast();
convertVar = UINT_MAX; // intentionally default to wrong value here to not crash: exception handling TBD
}
Expand All @@ -409,7 +409,7 @@ uint Utility::convertSizeToUint(size_t &convertVar)

uint Utility::convertSizeToInt(size_t &convertVar)
{
if( convertVar > INT_MAX ) {
if (convertVar > INT_MAX) {
//throw std::bad_cast();
convertVar = INT_MAX; // intentionally default to wrong value here to not crash: exception handling TBD
}
Expand Down Expand Up @@ -465,7 +465,7 @@ QString Utility::timeAgoInWords(const QDateTime &dt, const QDateTime &from)

if (floor(secs / 3600.0) > 0) {
int hours = floor(secs / 3600.0);
if(hours == 1){
if (hours == 1) {
return (QObject::tr("%n hour ago", "", hours));
} else {
return (QObject::tr("%n hours ago", "", hours));
Expand All @@ -480,7 +480,7 @@ QString Utility::timeAgoInWords(const QDateTime &dt, const QDateTime &from)
return QObject::tr("Less than a minute ago");
}

} else if(minutes == 1){
} else if (minutes == 1) {
return (QObject::tr("%n minute ago", "", minutes));
} else {
return (QObject::tr("%n minutes ago", "", minutes));
Expand Down
2 changes: 2 additions & 0 deletions src/common/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#ifndef UTILITY_H
#define UTILITY_H


#include "ocsynclib.h"
#include <QString>
#include <QByteArray>
Expand All @@ -29,6 +30,7 @@
#include <QMap>
#include <QUrl>
#include <QUrlQuery>
#include <QtQuick/QQuickImageProvider>
#include <functional>
#include <memory>

Expand Down
18 changes: 9 additions & 9 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project(gui)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt5 REQUIRED COMPONENTS Widgets Svg)
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
Expand All @@ -24,7 +24,6 @@ set(client_UI_SRCS
ignorelisteditor.ui
ignorelisttablewidget.ui
networksettings.ui
activitywidget.ui
synclogdialog.ui
settingsdialog.ui
sharedialog.ui
Expand All @@ -35,6 +34,8 @@ set(client_UI_SRCS
addcertificatedialog.ui
proxyauthdialog.ui
mnemonicdialog.ui
tray/Window.qml
tray/UserLine.qml
wizard/flow2authwidget.ui
wizard/owncloudadvancedsetuppage.ui
wizard/owncloudconnectionmethoddialog.ui
Expand Down Expand Up @@ -73,10 +74,6 @@ set(client_SRCS
openfilemanager.cpp
owncloudgui.cpp
owncloudsetupwizard.cpp
activitydata.cpp
activitylistmodel.cpp
activitywidget.cpp
activityitemdelegate.cpp
selectivesyncdialog.cpp
settingsdialog.cpp
sharedialog.cpp
Expand All @@ -99,12 +96,15 @@ set(client_SRCS
synclogdialog.cpp
tooltipupdater.cpp
notificationconfirmjob.cpp
servernotificationhandler.cpp
guiutility.cpp
elidedlabel.cpp
headerbanner.cpp
iconjob.cpp
remotewipe.cpp
tray/ActivityData.cpp
tray/ActivityListModel.cpp
tray/UserModel.cpp
tray/NotificationHandler.cpp
creds/credentialsfactory.cpp
creds/httpcredentialsgui.cpp
creds/oauth.cpp
Expand Down Expand Up @@ -298,7 +298,7 @@ else()
endif()

add_library(updater STATIC ${updater_SRCS})
target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml Qt5::WebEngineWidgets)
target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Svg Qt5::Network Qt5::Xml Qt5::WebEngineWidgets)
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
Expand All @@ -308,7 +308,7 @@ set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )

target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::Network Qt5::Xml)
target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::Svg Qt5::Network Qt5::Xml)
target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
target_link_libraries( ${APPLICATION_EXECUTABLE} updater )
target_link_libraries( ${APPLICATION_EXECUTABLE} ${OS_SPECIFIC_LINK_LIBRARIES} )
Expand Down
7 changes: 3 additions & 4 deletions src/gui/accountmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ class AccountManager : public QObject
// Adds an account to the tracked list, emitting accountAdded()
void addAccountState(AccountState *accountState);

AccountManager() {}
QList<AccountStatePtr> _accounts;

public slots:
/// Saves account data, not including the credentials
void saveAccount(Account *a);
Expand All @@ -104,9 +107,5 @@ public slots:
void accountAdded(AccountState *account);
void accountRemoved(AccountState *account);
void removeAccountFolders(AccountState *account);

private:
AccountManager() {}
QList<AccountStatePtr> _accounts;
};
}
73 changes: 4 additions & 69 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
_ui->_folderList->setAttribute(Qt::WA_Hover, true);
_ui->_folderList->installEventFilter(mouseCursorChanger);

createAccountToolbox();
connect(AccountManager::instance(), &AccountManager::accountAdded,
this, &AccountSettings::slotAccountAdded);
connect(this, &AccountSettings::removeAccountFolders,
AccountManager::instance(), &AccountManager::removeAccountFolders);
connect(_ui->_folderList, &QWidget::customContextMenuRequested,
Expand Down Expand Up @@ -207,33 +204,10 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
_ui->encryptionMessage->hide();
}

customizeStyle();
}


void AccountSettings::createAccountToolbox()
{
QMenu *menu = new QMenu();

connect(menu, &QMenu::aboutToShow, this, &AccountSettings::slotMenuBeforeShow);

_addAccountAction = new QAction(tr("Add new"), this);
menu->addAction(_addAccountAction);
connect(_addAccountAction, &QAction::triggered, this, &AccountSettings::slotOpenAccountWizard);

_toggleSignInOutAction = new QAction(tr("Log out"), this);
connect(_toggleSignInOutAction, &QAction::triggered, this, &AccountSettings::slotToggleSignInState);
menu->addAction(_toggleSignInOutAction);
connect(UserModel::instance(), &UserModel::addAccount,
this, &AccountSettings::slotOpenAccountWizard);

QAction *action = new QAction(tr("Remove"), this);
menu->addAction(action);
connect(action, &QAction::triggered, this, &AccountSettings::slotDeleteAccount);

_ui->_accountToolbox->setText(tr("Account") + QLatin1Char(' '));
_ui->_accountToolbox->setMenu(menu);
_ui->_accountToolbox->setPopupMode(QToolButton::InstantPopup);

slotAccountAdded(_accountState);
customizeStyle();
}


Expand All @@ -249,24 +223,6 @@ void AccountSettings::slotNewMnemonicGenerated()
_ui->encryptionMessage->show();
}

void AccountSettings::slotMenuBeforeShow() {
if (_menuShown) {
return;
}

auto menu = _ui->_accountToolbox->menu();

// We can't check this during the initial creation as there is no account yet then
if (_accountState->account()->capabilities().clientSideEncryptionAvaliable()) {
QAction *mnemonic = new QAction(tr("Show E2E mnemonic"), this);
connect(mnemonic, &QAction::triggered, this, &AccountSettings::requesetMnemonic);
menu->addAction(mnemonic);
}

_menuShown = true;
}


QString AccountSettings::selectedFolderAlias() const
{
QModelIndex selected = _ui->_folderList->selectionModel()->currentIndex();
Expand Down Expand Up @@ -1060,21 +1016,12 @@ void AccountSettings::slotAccountStateChanged()
// sync user interface buttons.
refreshSelectiveSyncStatus();

/* set the correct label for the Account toolbox button */
if (_accountState) {
if (_accountState->isSignedOut()) {
_toggleSignInOutAction->setText(tr("Log in"));
} else {
_toggleSignInOutAction->setText(tr("Log out"));
}
}

if (state == AccountState::State::Connected) {
/* TODO: We should probably do something better here.
* Verify if the user has a private key already uploaded to the server,
* if it has, do not offer to create one.
*/
qCInfo(lcAccountSettings) << "Accout" << accountsState()->account()->displayName()
qCInfo(lcAccountSettings) << "Account" << accountsState()->account()->displayName()
<< "Client Side Encryption" << accountsState()->account()->capabilities().clientSideEncryptionAvaliable();
}
}
Expand Down Expand Up @@ -1190,18 +1137,6 @@ void AccountSettings::refreshSelectiveSyncStatus()
}
}

void AccountSettings::slotAccountAdded(AccountState *)
{
// if the theme is limited to single account, the button must hide if
// there is already one account.
int s = AccountManager::instance()->accounts().size();
if (s > 0 && !Theme::instance()->multiAccount()) {
_addAccountAction->setVisible(false);
} else {
_addAccountAction->setVisible(true);
}
}

void AccountSettings::slotDeleteAccount()
{
// Deleting the account potentially deletes 'this', so
Expand Down
3 changes: 0 additions & 3 deletions src/gui/accountsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ protected slots:
void slotDeleteAccount();
void slotToggleSignInState();
void slotOpenAccountWizard();
void slotAccountAdded(AccountState *);
void refreshSelectiveSyncStatus();
void slotMarkSubfolderEncrypted(const FolderStatusModel::SubFolderInfo* folderInfo);
void slotMarkSubfolderDecrypted(const FolderStatusModel::SubFolderInfo* folderInfo);
Expand All @@ -100,8 +99,6 @@ protected slots:
void doExpand();
void slotLinkActivated(const QString &link);

void slotMenuBeforeShow();

// Encryption Related Stuff.
void slotShowMnemonic(const QString &mnemonic);
void slotNewMnemonicGenerated();
Expand Down
9 changes: 1 addition & 8 deletions src/gui/accountsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>582</width>
<width>581</width>
<height>557</height>
</rect>
</property>
Expand Down Expand Up @@ -184,13 +184,6 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="_accountToolbox">
<property name="text">
<string notr="true">...</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
Loading