2015-11-01 00:21:09 +03:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2015-11-05 11:58:16 +03:00
|
|
|
#ifndef SHAREUSERGROUPWIDGET_H
|
|
|
|
#define SHAREUSERGROUPWIDGET_H
|
2015-11-01 00:21:09 +03:00
|
|
|
|
|
|
|
#include "accountfwd.h"
|
|
|
|
#include "QProgressIndicator.h"
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QVariantMap>
|
|
|
|
#include <QSharedPointer>
|
|
|
|
#include <QList>
|
2015-11-05 14:30:34 +03:00
|
|
|
#include <QVector>
|
2015-11-05 00:00:35 +03:00
|
|
|
|
|
|
|
class QCompleter;
|
2015-11-11 13:51:33 +03:00
|
|
|
class QModelIndex;
|
2015-11-05 00:00:35 +03:00
|
|
|
|
2015-11-01 00:21:09 +03:00
|
|
|
namespace OCC {
|
|
|
|
|
|
|
|
namespace Ui {
|
2015-11-05 11:58:16 +03:00
|
|
|
class ShareUserGroupWidget;
|
|
|
|
class ShareWidget;
|
2015-11-01 00:21:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class AbstractCredentials;
|
|
|
|
class QuotaInfo;
|
|
|
|
class SyncResult;
|
|
|
|
class Share;
|
2015-11-05 14:30:34 +03:00
|
|
|
class Sharee;
|
2015-11-01 00:21:09 +03:00
|
|
|
class ShareManager;
|
2015-11-05 00:00:35 +03:00
|
|
|
class ShareeModel;
|
2015-11-01 00:21:09 +03:00
|
|
|
|
2015-11-05 11:58:16 +03:00
|
|
|
class ShareWidget : public QWidget
|
2015-11-01 00:21:09 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-11-05 11:58:16 +03:00
|
|
|
explicit ShareWidget(QSharedPointer<Share> Share, QWidget *parent = 0);
|
|
|
|
~ShareWidget();
|
2015-11-01 00:21:09 +03:00
|
|
|
|
2015-11-05 17:01:29 +03:00
|
|
|
QSharedPointer<Share> share() const;
|
|
|
|
|
2015-11-01 00:21:09 +03:00
|
|
|
signals:
|
2015-11-05 11:58:16 +03:00
|
|
|
void shareDeleted(ShareWidget *share);
|
2015-11-01 00:21:09 +03:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deleteShareButton_clicked();
|
|
|
|
void slotPermissionsChanged();
|
2015-11-13 12:27:26 +03:00
|
|
|
void slotEditPermissionsChanged();
|
|
|
|
void on_permissionToggleButton_clicked();
|
2015-11-01 00:21:09 +03:00
|
|
|
|
|
|
|
void slotShareDeleted();
|
|
|
|
void slotPermissionsSet();
|
|
|
|
|
|
|
|
private:
|
2015-11-13 12:27:26 +03:00
|
|
|
void displayPermissions();
|
|
|
|
|
2015-11-05 11:58:16 +03:00
|
|
|
Ui::ShareWidget *_ui;
|
2015-11-01 00:21:09 +03:00
|
|
|
QSharedPointer<Share> _share;
|
2015-11-13 12:27:26 +03:00
|
|
|
bool _showDetailedPermissions;
|
2015-11-01 00:21:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The ShareDialog (user/group) class
|
|
|
|
* @ingroup gui
|
|
|
|
*/
|
2015-11-05 11:58:16 +03:00
|
|
|
class ShareUserGroupWidget : public QWidget
|
2015-11-01 00:21:09 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-11-05 11:58:16 +03:00
|
|
|
explicit ShareUserGroupWidget(AccountPtr account,
|
2015-11-01 00:21:09 +03:00
|
|
|
const QString &sharePath,
|
|
|
|
const QString &localPath,
|
|
|
|
bool resharingAllowed,
|
|
|
|
QWidget *parent = 0);
|
2015-11-05 11:58:16 +03:00
|
|
|
~ShareUserGroupWidget();
|
2015-11-02 00:23:22 +03:00
|
|
|
|
|
|
|
public slots:
|
2015-11-01 00:21:09 +03:00
|
|
|
void getShares();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotSharesFetched(const QList<QSharedPointer<Share>> &shares);
|
2015-11-02 00:23:22 +03:00
|
|
|
|
2015-11-05 00:00:35 +03:00
|
|
|
void on_shareeLineEdit_textChanged(const QString &text);
|
2015-11-02 00:23:22 +03:00
|
|
|
void on_searchPushButton_clicked();
|
2015-11-05 00:00:35 +03:00
|
|
|
|
|
|
|
void slotUpdateCompletion();
|
|
|
|
void slotCompleterActivated(const QModelIndex & index);
|
2015-11-02 00:23:22 +03:00
|
|
|
|
2015-11-01 00:21:09 +03:00
|
|
|
private:
|
2015-11-05 11:58:16 +03:00
|
|
|
Ui::ShareUserGroupWidget *_ui;
|
2015-11-01 00:21:09 +03:00
|
|
|
AccountPtr _account;
|
|
|
|
QString _sharePath;
|
|
|
|
QString _localPath;
|
|
|
|
|
2015-11-05 00:00:35 +03:00
|
|
|
QCompleter *_completer;
|
|
|
|
ShareeModel *_completerModel;
|
|
|
|
|
2015-11-01 00:21:09 +03:00
|
|
|
bool _resharingAllowed;
|
|
|
|
bool _isFile;
|
|
|
|
|
|
|
|
ShareManager *_manager;
|
2015-11-05 14:30:34 +03:00
|
|
|
QVector<QSharedPointer<Sharee>> _sharees;
|
2015-11-01 00:21:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-05 11:58:16 +03:00
|
|
|
#endif // SHAREUSERGROUPWIDGET_H
|