diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2015-11-05 11:58:16 +0300 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2015-11-05 11:58:16 +0300 |
commit | 3e4612a1f0c66e522d84359a479c1fc0e2f2c85b (patch) | |
tree | 0f84ecac37d6705fb69c6786a59a0fe25a831596 /src/gui/shareusergroupwidget.h | |
parent | 90cbd461ab3e7ce6c4a5bf5aa03117409f65e2ab (diff) |
[Sharing] Reorganized sharedialog code
Now we have 1 simple dialog that includes 2 widgets.
* ShareLinkWidget (for link shares)
* ShareUserGroupWidget (for user/group shares)
The ShareUserGroupWidget is only included if the server version is >=
8.2.0
For <8.2.0 the old behavior is preserved
Diffstat (limited to 'src/gui/shareusergroupwidget.h')
-rw-r--r-- | src/gui/shareusergroupwidget.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/src/gui/shareusergroupwidget.h b/src/gui/shareusergroupwidget.h new file mode 100644 index 000000000..b14896afc --- /dev/null +++ b/src/gui/shareusergroupwidget.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) by Roeland Jago Douma <roeland@owncloud.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#ifndef SHAREUSERGROUPWIDGET_H +#define SHAREUSERGROUPWIDGET_H + +#include "accountfwd.h" +#include "QProgressIndicator.h" +#include <QDialog> +#include <QWidget> +#include <QVariantMap> +#include <QSharedPointer> +#include <QList> + + +class QCompleter; + +namespace OCC { + +namespace Ui { +class ShareUserGroupWidget; +class ShareWidget; +} + +class AbstractCredentials; +class QuotaInfo; +class SyncResult; +class Share; +class ShareManager; +class ShareeModel; + +class ShareWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ShareWidget(QSharedPointer<Share> Share, QWidget *parent = 0); + ~ShareWidget(); + +signals: + void shareDeleted(ShareWidget *share); + +private slots: + void on_deleteShareButton_clicked(); + void slotPermissionsChanged(); + + void slotShareDeleted(); + void slotPermissionsSet(); + +private: + Ui::ShareWidget *_ui; + QSharedPointer<Share> _share; +}; + + +/** + * @brief The ShareDialog (user/group) class + * @ingroup gui + */ +class ShareUserGroupWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ShareUserGroupWidget(AccountPtr account, + const QString &sharePath, + const QString &localPath, + bool resharingAllowed, + QWidget *parent = 0); + ~ShareUserGroupWidget(); + +public slots: + void getShares(); + +private slots: + void slotSharesFetched(const QList<QSharedPointer<Share>> &shares); + + void on_shareeLineEdit_textChanged(const QString &text); + void on_searchPushButton_clicked(); + + void slotUpdateCompletion(); + void slotCompleterActivated(const QModelIndex & index); + +private: + Ui::ShareUserGroupWidget *_ui; + AccountPtr _account; + QString _sharePath; + QString _localPath; + + QCompleter *_completer; + ShareeModel *_completerModel; + + bool _resharingAllowed; + bool _isFile; + + ShareManager *_manager; +}; + +} + +#endif // SHAREUSERGROUPWIDGET_H |