Sharedialog: add copy button text and actually connect the button

This commit is contained in:
Roeland Jago Douma 2015-02-03 13:02:52 +01:00
parent 9d93642102
commit 48254579a2
2 changed files with 10 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include "QProgressIndicator.h"
#include <QBuffer>
#include <QFileIconProvider>
#include <QClipboard>
namespace {
int SHARETYPE_PUBLIC = 3;
@ -28,6 +29,8 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
setAttribute(Qt::WA_DeleteOnClose);
_ui->setupUi(this);
_ui->pushButton_copy->setIcon(QIcon::fromTheme("edit-copy"));
_ui->pushButton_copy->setText("Copy URL");
connect(_ui->pushButton_copy, SIGNAL(clicked(bool)), SLOT(slotPushButtonCopyLinkPressed()));
// the following progress indicator widgets are added to layouts which makes them
// automatically deleted once the dialog dies.
@ -321,6 +324,12 @@ void ShareDialog::slotCheckBoxExpireClicked()
}
}
void ShareDialog::slotPushButtonCopyLinkPressed()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(_ui->lineEdit_shareLink->text());
}
int ShareDialog::checkJsonReturnCode(const QString &reply, QString &message)
{
bool success;

View file

@ -70,6 +70,7 @@ private slots:
void slotCheckBoxPasswordClicked();
void slotCheckBoxExpireClicked();
void slotPasswordReturnPressed();
void slotPushButtonCopyLinkPressed();
private:
void displayError(int code);
void displayInfo( const QString& msg );