Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sharedialog.h « gui « src - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 29f1a89fd95454b3a849a56182e9b7f8445869c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
 * Copyright (C) 2015 by Klaas Freitag <freitag@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 SHAREDIALOG_H
#define SHAREDIALOG_H

#include "accountfwd.h"
#include "QProgressIndicator.h"
#include <QDialog>
#include <QVariantMap>

namespace OCC {

namespace Ui {
class ShareDialog;
}

class AbstractCredentials;
class QuotaInfo;
class SyncResult;

/**
 * @brief The ShareDialog class
 * @ingroup gui
 */
class ShareDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ShareDialog(AccountPtr account, const QString &sharePath, const QString &localPath,
                         bool resharingAllowed, QWidget *parent = 0);
    ~ShareDialog();
    void getShares();

private slots:
    void slotSharesFetched(const QVariantMap &reply);
    void slotCreateShareFetched(const QVariantMap &reply);
    void slotDeleteShareFetched(const QVariantMap &reply);
    void slotPasswordSet(const QVariantMap &reply);
    void slotExpireSet(const QVariantMap &reply);
    void slotCalendarClicked(const QDate &date);
    void slotCheckBoxShareLinkClicked();
    void slotCheckBoxPasswordClicked();
    void slotCheckBoxExpireClicked();
    void slotPasswordReturnPressed();
    void slotPasswordChanged(const QString& newText);
    void slotPushButtonCopyLinkPressed();
    void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
    void slotCheckBoxEditingClicked();
    void slotPublicUploadSet(const QVariantMap &reply);

    void done( int r );
private:
    void setShareCheckBoxTitle(bool haveShares);
    void displayError(int code);
    void displayError(const QString& errMsg);
    void setShareLink( const QString& url );
    void resizeEvent(QResizeEvent *e);
    void redrawElidedUrl();
    void setPublicUpload(bool publicUpload);

    Ui::ShareDialog *_ui;
    AccountPtr _account;
    QString _sharePath;
    QString _localPath;
    QString _shareUrl;
#if 0
    QString _folderAlias;
    int     _uploadFails;
    QString _expectedSyncFile;
#endif

    bool _passwordJobRunning;
    QList<QVariant> _shares;
    qulonglong _public_share_id;
    void setPassword(const QString &password);
    void setExpireDate(const QDate &date);

    QProgressIndicator *_pi_link;
    QProgressIndicator *_pi_password;
    QProgressIndicator *_pi_date;
    QProgressIndicator *_pi_editing;

    bool _resharingAllowed;
    bool _isFile;
};

}

#endif // SHAREDIALOG_H