diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 35f36cccd..823275d0d 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -11,6 +11,7 @@ #include "QProgressIndicator.h" #include #include +#include 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; diff --git a/src/gui/sharedialog.h b/src/gui/sharedialog.h index 0352ef915..59d725bae 100644 --- a/src/gui/sharedialog.h +++ b/src/gui/sharedialog.h @@ -70,6 +70,7 @@ private slots: void slotCheckBoxPasswordClicked(); void slotCheckBoxExpireClicked(); void slotPasswordReturnPressed(); + void slotPushButtonCopyLinkPressed(); private: void displayError(int code); void displayInfo( const QString& msg );