From 48254579a2d5c5beeeae7d3ed8e2cb59b9f92394 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 3 Feb 2015 13:02:52 +0100 Subject: [PATCH] Sharedialog: add copy button text and actually connect the button --- src/gui/sharedialog.cpp | 9 +++++++++ src/gui/sharedialog.h | 1 + 2 files changed, 10 insertions(+) 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 );