2015-01-12 13:35:11 +03:00
|
|
|
/*
|
2015-02-25 20:32:25 +03:00
|
|
|
* Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
|
2015-02-25 19:00:27 +03:00
|
|
|
* Copyright (C) 2015 by Klaas Freitag <freitag@owncloud.com>
|
2015-01-12 13:35:11 +03:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
2015-01-28 12:52:55 +03:00
|
|
|
#include "accountfwd.h"
|
2015-01-14 20:42:56 +03:00
|
|
|
#include "QProgressIndicator.h"
|
2014-09-03 18:12:21 +04:00
|
|
|
#include <QDialog>
|
2015-09-07 14:50:01 +03:00
|
|
|
#include <QVariantMap>
|
2015-10-29 13:09:10 +03:00
|
|
|
#include <QSharedPointer>
|
|
|
|
#include <QList>
|
|
|
|
|
2014-12-19 18:56:17 +03:00
|
|
|
namespace OCC {
|
2014-09-03 18:12:21 +04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ShareDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class AbstractCredentials;
|
|
|
|
class QuotaInfo;
|
2015-01-21 17:03:01 +03:00
|
|
|
class SyncResult;
|
2015-10-29 23:47:47 +03:00
|
|
|
class LinkShare;
|
|
|
|
class Share;
|
|
|
|
class ShareManager;
|
2014-09-03 18:12:21 +04:00
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief The ShareDialog class
|
|
|
|
* @ingroup gui
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2014-09-03 18:12:21 +04:00
|
|
|
class ShareDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-03-11 16:09:31 +03:00
|
|
|
explicit ShareDialog(AccountPtr account, const QString &sharePath, const QString &localPath,
|
|
|
|
bool resharingAllowed, QWidget *parent = 0);
|
2014-09-03 18:12:21 +04:00
|
|
|
~ShareDialog();
|
|
|
|
void getShares();
|
2015-01-21 17:03:01 +03:00
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
private slots:
|
2015-10-29 13:09:10 +03:00
|
|
|
void slotSharesFetched(const QList<QSharedPointer<Share>> &shares);
|
|
|
|
void slotCreateShareFetched(const QSharedPointer<LinkShare> share);
|
|
|
|
void slotCreateShareRequiresPassword();
|
|
|
|
void slotDeleteShareFetched();
|
|
|
|
void slotPasswordSet();
|
|
|
|
void slotExpireSet();
|
2015-01-11 13:19:12 +03:00
|
|
|
void slotCalendarClicked(const QDate &date);
|
2014-09-03 18:12:21 +04:00
|
|
|
void slotCheckBoxShareLinkClicked();
|
|
|
|
void slotCheckBoxPasswordClicked();
|
|
|
|
void slotCheckBoxExpireClicked();
|
|
|
|
void slotPasswordReturnPressed();
|
2015-03-11 16:57:55 +03:00
|
|
|
void slotPasswordChanged(const QString& newText);
|
2015-02-03 15:02:52 +03:00
|
|
|
void slotPushButtonCopyLinkPressed();
|
2015-01-21 15:51:16 +03:00
|
|
|
void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
|
2015-08-20 14:40:10 +03:00
|
|
|
void slotCheckBoxEditingClicked();
|
2015-10-29 13:09:10 +03:00
|
|
|
void slotPublicUploadSet();
|
2015-03-26 20:08:06 +03:00
|
|
|
|
2015-10-29 18:56:23 +03:00
|
|
|
void displayError(int code, const QString &message);
|
|
|
|
|
2015-03-26 20:08:06 +03:00
|
|
|
void done( int r );
|
2014-09-03 18:12:21 +04:00
|
|
|
private:
|
2015-02-25 15:44:12 +03:00
|
|
|
void setShareCheckBoxTitle(bool haveShares);
|
2015-01-21 17:03:01 +03:00
|
|
|
void displayError(int code);
|
2015-03-11 16:09:31 +03:00
|
|
|
void displayError(const QString& errMsg);
|
2015-03-09 16:33:02 +03:00
|
|
|
void setShareLink( const QString& url );
|
2015-03-26 19:23:29 +03:00
|
|
|
void resizeEvent(QResizeEvent *e);
|
|
|
|
void redrawElidedUrl();
|
2015-08-20 14:40:10 +03:00
|
|
|
void setPublicUpload(bool publicUpload);
|
2015-01-21 17:03:01 +03:00
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
Ui::ShareDialog *_ui;
|
2015-01-28 12:52:55 +03:00
|
|
|
AccountPtr _account;
|
2015-01-16 16:48:56 +03:00
|
|
|
QString _sharePath;
|
|
|
|
QString _localPath;
|
2015-03-09 16:33:02 +03:00
|
|
|
QString _shareUrl;
|
|
|
|
#if 0
|
2015-01-21 17:03:01 +03:00
|
|
|
QString _folderAlias;
|
|
|
|
int _uploadFails;
|
|
|
|
QString _expectedSyncFile;
|
2015-03-09 16:33:02 +03:00
|
|
|
#endif
|
2015-01-21 17:03:01 +03:00
|
|
|
|
2015-02-25 15:44:12 +03:00
|
|
|
bool _passwordJobRunning;
|
2015-01-14 21:36:42 +03:00
|
|
|
void setPassword(const QString &password);
|
2015-01-17 11:57:17 +03:00
|
|
|
void setExpireDate(const QDate &date);
|
2015-01-14 20:42:56 +03:00
|
|
|
|
|
|
|
QProgressIndicator *_pi_link;
|
|
|
|
QProgressIndicator *_pi_password;
|
|
|
|
QProgressIndicator *_pi_date;
|
2015-08-20 14:40:10 +03:00
|
|
|
QProgressIndicator *_pi_editing;
|
2015-02-25 15:44:12 +03:00
|
|
|
|
2015-10-29 16:27:49 +03:00
|
|
|
ShareManager *_manager;
|
2015-10-29 13:09:10 +03:00
|
|
|
QSharedPointer<LinkShare> _share;
|
|
|
|
|
2015-03-11 16:09:31 +03:00
|
|
|
bool _resharingAllowed;
|
2015-08-20 14:40:10 +03:00
|
|
|
bool _isFile;
|
2014-09-03 18:12:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SHAREDIALOG_H
|