2015-01-12 13:35:11 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
#ifndef SHAREDIALOG_H
|
|
|
|
#define SHAREDIALOG_H
|
|
|
|
|
|
|
|
#include "networkjobs.h"
|
2015-01-14 20:42:56 +03:00
|
|
|
#include "QProgressIndicator.h"
|
2014-09-03 18:12:21 +04:00
|
|
|
#include <QDialog>
|
2015-01-12 16:48:31 +03:00
|
|
|
#include <QTreeWidgetItem>
|
2014-09-03 18:12:21 +04:00
|
|
|
|
2014-12-19 18:56:17 +03:00
|
|
|
namespace OCC {
|
2014-09-03 18:12:21 +04:00
|
|
|
|
|
|
|
class OcsShareJob : public AbstractNetworkJob {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-01-12 13:35:11 +03:00
|
|
|
explicit OcsShareJob(const QByteArray& verb, const QUrl& url, const QUrl& postData, AccountPtr account, QObject* parent = 0);
|
2014-09-03 18:12:21 +04:00
|
|
|
public slots:
|
|
|
|
void start() Q_DECL_OVERRIDE;
|
|
|
|
signals:
|
|
|
|
void jobFinished(QString reply);
|
|
|
|
private slots:
|
|
|
|
virtual bool finished() Q_DECL_OVERRIDE;
|
|
|
|
private:
|
|
|
|
QByteArray _verb;
|
|
|
|
QUrl _url;
|
|
|
|
QUrl _postData;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ShareDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class AbstractCredentials;
|
|
|
|
class Account;
|
|
|
|
class QuotaInfo;
|
|
|
|
class MirallAccessManager;
|
|
|
|
|
|
|
|
class ShareDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-01-14 12:35:09 +03:00
|
|
|
explicit ShareDialog(const QString &path, const bool &isDir, QWidget *parent = 0);
|
2014-09-03 18:12:21 +04:00
|
|
|
~ShareDialog();
|
|
|
|
void getShares();
|
2015-01-14 12:35:09 +03:00
|
|
|
void setPath(const QString &path, const bool &isDir);
|
2014-09-03 18:12:21 +04:00
|
|
|
QString getPath();
|
|
|
|
private slots:
|
2015-01-11 13:19:12 +03:00
|
|
|
void slotSharesFetched(const QString &reply);
|
|
|
|
void slotCreateShareFetched(const QString &reply);
|
|
|
|
void slotDeleteShareFetched(const QString &reply);
|
|
|
|
void slotPasswordSet(const QString &reply);
|
|
|
|
void slotExpireSet(const QString &reply);
|
|
|
|
void slotCalendarClicked(const QDate &date);
|
2014-09-03 18:12:21 +04:00
|
|
|
void slotCheckBoxShareLinkClicked();
|
|
|
|
void slotCheckBoxPasswordClicked();
|
|
|
|
void slotCheckBoxExpireClicked();
|
|
|
|
void slotPasswordReturnPressed();
|
2015-01-12 16:48:31 +03:00
|
|
|
|
2015-01-13 18:33:57 +03:00
|
|
|
void slotUserShareWidgetClicked(QTreeWidgetItem *item, const int column);
|
2015-01-14 16:21:18 +03:00
|
|
|
void slotUpdateShareReply(const QString &reply);
|
2015-01-12 23:18:57 +03:00
|
|
|
void slotAddUserShareClicked();
|
2015-01-14 15:37:58 +03:00
|
|
|
void slotAddShareReply(const QString &reply);
|
2015-01-12 23:18:57 +03:00
|
|
|
void slotDeleteUserShareClicked();
|
2015-01-14 15:37:58 +03:00
|
|
|
void slotDeleteShareReply(const QString &reply);
|
2015-01-13 18:33:57 +03:00
|
|
|
void slotGroupShareWidgetClicked(QTreeWidgetItem *item, const int column);
|
|
|
|
void slotAddGroupShareClicked();
|
|
|
|
void slotDeleteGroupShareClicked();
|
2014-09-03 18:12:21 +04:00
|
|
|
private:
|
|
|
|
Ui::ShareDialog *_ui;
|
|
|
|
QString _path;
|
2015-01-14 12:35:09 +03:00
|
|
|
bool _isDir;
|
2014-09-03 18:12:21 +04:00
|
|
|
QList<QVariant> _shares;
|
2014-12-24 16:44:35 +03:00
|
|
|
qulonglong _public_share_id;
|
2014-09-09 03:50:31 +04:00
|
|
|
void setPassword(QString password);
|
2015-01-12 12:14:45 +03:00
|
|
|
void setExpireDate(const QString &date);
|
2015-01-14 15:21:53 +03:00
|
|
|
int checkJsonReturnCode(const QString &reply);
|
2015-01-14 20:42:56 +03:00
|
|
|
|
|
|
|
QProgressIndicator *_pi_link;
|
|
|
|
QProgressIndicator *_pi_password;
|
|
|
|
QProgressIndicator *_pi_date;
|
2014-09-03 18:12:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SHAREDIALOG_H
|