Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8408851
Adds OCS External Sites Job to retrieve it from the server.
Jan 19, 2018
69f3468
Lists external sites for each user in the main menu.
Jan 19, 2018
ec42878
Adds checkbox to toggle display of external sites list in the menu.
Jan 23, 2018
f48a94b
Saves 'show external sites list' option to the config file.
Jan 23, 2018
9f0c154
Fixes request url - uses the one for all users.
Jan 24, 2018
649f3ff
Changes response parsing for the new request.
Jan 24, 2018
89d7433
Fixes class name in comments and in ifndef.
Jan 26, 2018
08769b2
Adds OcsAppsJob to retrieve apps enabled for the user.
Jan 26, 2018
8ada9d0
List apps for each user in the tray main menu.
Jan 26, 2018
e29953b
Adds show apps option to the config file.
Jan 28, 2018
bf77dba
Adds checkbox 'showApps' to the general settings form.
Jan 28, 2018
9f559c8
Retrieves list of apps and displays it if 'show apps' checkbox is che…
Jan 28, 2018
00cfbe3
Removes external sites/apps configuration from config file.
Feb 19, 2018
f107b33
Removes external sites/apps configuration from general settings.
Feb 19, 2018
c9bc20c
Creates navigation/apps API call class OcsNavigationAppsJob.
Feb 19, 2018
fb080f0
Uses OcsNavigationAppsJob instead of OcsAppsJob and OcsExternalSitesJ…
Feb 19, 2018
61062f9
Adds ocsnavigationapps files to CMakeslists.txt.
Feb 20, 2018
9acb30e
Refactores code to fetch and display sub menu with list from navigati…
Feb 20, 2018
4ffff74
Refactores code and displays nav. apps before Pause/Unpause folders s…
Feb 21, 2018
99d8d05
Compares account menu with the account associated with the action to …
Feb 22, 2018
11d178c
Adds absolute=true param to navigation/apps request.
Mar 3, 2018
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
Prev Previous commit
Next Next commit
Compares account menu with the account associated with the action to …
…make sure apps is added to the right position.

Signed-off-by: Camila San <[email protected]>
  • Loading branch information
Camila San committed Feb 22, 2018
commit 99d8d050c23345877c4f9aa7a27ece4e1f8af455
1 change: 1 addition & 0 deletions src/gui/generalsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private slots:
void slotUpdateInfo();
void slotIgnoreFilesEditor();
void loadMiscSettings();

private:
Ui::GeneralSettings *_ui;
QPointer<IgnoreListEditor> _ignoreEditor;
Expand Down
23 changes: 13 additions & 10 deletions src/gui/generalsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@
<string>General Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QCheckBox" name="monoIconsCheckBox">
<property name="toolTip">
<string>For System Tray</string>
</property>
<property name="text">
<string>Use &amp;Monochrome Icons</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="autostartCheckBox">
<property name="text">
Expand All @@ -44,6 +34,16 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="monoIconsCheckBox">
<property name="toolTip">
<string>For System Tray</string>
</property>
<property name="text">
<string>Use &amp;Monochrome Icons</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -252,6 +252,9 @@
</layout>
</widget>
<tabstops>
<tabstop>autostartCheckBox</tabstop>
<tabstop>desktopNotificationsCheckBox</tabstop>
<tabstop>monoIconsCheckBox</tabstop>
<tabstop>ignoredFilesButton</tabstop>
<tabstop>newFolderLimitCheckBox</tabstop>
<tabstop>newFolderLimitSpinBox</tabstop>
Expand Down
25 changes: 7 additions & 18 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "ocsnavigationappsjob.h"
#include "theme.h"
#include "folderman.h"
#include "configfile.h"
#include "progressdispatcher.h"
#include "owncloudsetupwizard.h"
#include "sharedialog.h"
Expand All @@ -34,7 +35,6 @@
#include "accountmanager.h"
#include "common/syncjournalfilerecord.h"
#include "creds/abstractcredentials.h"
#include "configfile.h"
#ifdef WITH_LIBCLOUDPROVIDERS
#include "cloudproviders/cloudprovidermanager.h"
#endif
Expand All @@ -54,6 +54,7 @@

#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>

namespace OCC {

Expand Down Expand Up @@ -398,13 +399,11 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
QAction *enable = menu->addAction(tr("Unpause all folders"));
enable->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(enable, &QAction::triggered, this, &ownCloudGui::slotUnpauseAllFolders);
_storedActionsForNavApps.append(enable);
}
if (!allPaused) {
QAction *enable = menu->addAction(tr("Pause all folders"));
enable->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(enable, &QAction::triggered, this, &ownCloudGui::slotPauseAllFolders);
_storedActionsForNavApps.append(enable);
}

if (accountState->isSignedOut()) {
Expand All @@ -415,7 +414,6 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
QAction *signout = menu->addAction(tr("Log out"));
signout->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(signout, &QAction::triggered, this, &ownCloudGui::slotLogout);
_storedActionsForNavApps.append(signout);
}
}
}
Expand Down Expand Up @@ -572,7 +570,6 @@ void ownCloudGui::updateContextMenu()
menu->deleteLater();
}
_accountMenus.clear();
_storedActionsForNavApps.clear();

auto accountList = AccountManager::instance()->accounts();

Expand Down Expand Up @@ -620,7 +617,6 @@ void ownCloudGui::updateContextMenu()
_contextMenu->addAction(_actionNewAccountWizard);
}
_contextMenu->addAction(_actionSettings);

if (!Theme::instance()->helpUrl().isEmpty()) {
_contextMenu->addAction(_actionHelp);
}
Expand Down Expand Up @@ -762,25 +758,20 @@ void ownCloudGui::slotNavigationAppsFetched(const QJsonDocument &reply)
if(!reply.isEmpty()){
auto element = reply.object().value("ocs").toObject().value("data");
auto navLinks = element.toArray();

if(navLinks.size() > 0){
if(auto account = qvariant_cast<AccountPtr>(sender()->property(propertyAccountC))){
if(QMenu *accountMenu = qvariant_cast<QMenu*>(sender()->property(propertyMenuC))){

// when there is only one account add the nav links above the settings
QAction *actionBefore = _actionSettings;

// when there is more than one account add the nav links bellow the account submenu
// when there is more than one account add the nav links above pause/unpause folder or logout action
if(AccountManager::instance()->accounts().size() > 1){
foreach(QAction *action, _storedActionsForNavApps){
qDebug() << "Action: "
<< action->text();
foreach(QAction *action, accountMenu->actions()){

// pause/unpause folder and logout actions have propertyAccountC
if(auto actionAccount = qvariant_cast<AccountStatePtr>(action->property(propertyAccountC))){
qDebug() << "Account found!"
<< actionAccount->account()->displayName();
if(actionAccount->account()->displayName() == account->displayName()){
qDebug() << "Menu found!"
<< actionAccount->account()->displayName();
if(actionAccount->account() == account){
actionBefore = action;
break;
}
Expand All @@ -806,13 +797,11 @@ void ownCloudGui::slotNavigationAppsFetched(const QJsonDocument &reply)
}
}


void ownCloudGui::slotOcsError(int statusCode, const QString &message)
{
emit serverError(statusCode, message);
}


void ownCloudGui::slotRebuildRecentMenus()
{
_recentActionsMenu->clear();
Expand Down
13 changes: 2 additions & 11 deletions src/gui/owncloudgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "systray.h"
#include "connectionvalidator.h"
#include "progressdispatcher.h"
#include "configfile.h"

#include <QObject>
#include <QPointer>
Expand All @@ -30,11 +29,6 @@
#include <QDBusConnection>
#endif

#include <QJsonArray>

class QJsonDocument;
class QJsonObject;

namespace OCC {

class Folder;
Expand Down Expand Up @@ -100,6 +94,7 @@ public slots:
void slotAccountStateChanged();
void slotTrayMessageIfServerUnsupported(Account *account);
void slotNavigationAppsFetched(const QJsonDocument &reply);

/**
* Open a share dialog for a file or folder.
*
Expand All @@ -121,14 +116,12 @@ private slots:
void slotPauseAllFolders();
void slotNewAccountWizard();


private:
void setPauseOnAllFoldersHelper(bool pause);
void setupActions();
void addAccountContextMenu(AccountStatePtr accountState, QMenu *menu, bool separateMenu);
void fetchNavigationApps(AccountStatePtr account, QMenu *accountMenu);


QPointer<Systray> _tray;
#if defined(Q_OS_MAC)
QPointer<SettingsDialogMac> _settingsDialog;
Expand Down Expand Up @@ -161,11 +154,9 @@ private slots:
QAction *_actionHelp;
QAction *_actionQuit;
QAction *_actionCrash;

QList<QAction *> _recentItemsActions;
QList<QAction *> _storedActionsForNavApps;
Application *_app;

ConfigFile _cfg;
};

} // namespace OCC
Expand Down