diff --git a/src/widget/about/aboutuser.cpp b/src/widget/about/aboutuser.cpp index 598cf52c7..00a649545 100644 --- a/src/widget/about/aboutuser.cpp +++ b/src/widget/about/aboutuser.cpp @@ -4,8 +4,6 @@ #include "src/persistence/profile.h" #include "src/nexus.h" -#include -#include #include #include #include @@ -18,21 +16,10 @@ AboutUser::AboutUser(ToxId &toxId, QWidget *parent) : ui->label_4->hide(); ui->aliases->hide(); - statusMessageMenu.addAction(tr("Copy"), this, SLOT(onCopyStatusMessage())); - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &AboutUser::onAcceptedClicked); connect(ui->autoaccept, &QCheckBox::clicked, this, &AboutUser::onAutoAcceptClicked); connect(ui->selectSaveDir, &QPushButton::clicked, this, &AboutUser::onSelectDirClicked); connect(ui->removeHistory, &QPushButton::clicked, this, &AboutUser::onRemoveHistoryClicked); - connect(ui->statusMessage, &QLabel::customContextMenuRequested, this, [&](const QPoint& pos) - { - if(!ui->statusMessage->text().isEmpty()) - { - QWidget* sender = static_cast(QObject::sender()); - - statusMessageMenu.exec(sender->mapToGlobal(pos)); - } - } ); this->toxId = toxId; QString dir = Settings::getInstance().getAutoAcceptDir(this->toxId); @@ -118,17 +105,6 @@ void AboutUser::onRemoveHistoryClicked() QMessageBox::Ok); } -void AboutUser::onCopyStatusMessage() -{ - QString text = ui->statusMessage->text(); - QClipboard* clipboard = QApplication::clipboard(); - - if (clipboard) - { - clipboard->setText(text, QClipboard::Clipboard); - } -} - AboutUser::~AboutUser() { delete ui; diff --git a/src/widget/about/aboutuser.h b/src/widget/about/aboutuser.h index b0089d5ec..b206b0395 100644 --- a/src/widget/about/aboutuser.h +++ b/src/widget/about/aboutuser.h @@ -2,7 +2,6 @@ #define ABOUTUSER_H #include -#include #include "src/friend.h" @@ -21,7 +20,6 @@ public: private: Ui::AboutUser *ui; - QMenu statusMessageMenu; ToxId toxId; private slots: @@ -29,7 +27,6 @@ private slots: void onAutoAcceptClicked(); void onSelectDirClicked(); void onRemoveHistoryClicked(); - void onCopyStatusMessage(); }; #endif // ABOUTUSER_H diff --git a/src/widget/about/aboutuser.ui b/src/widget/about/aboutuser.ui index 83c6128ca..7ae77ec68 100644 --- a/src/widget/about/aboutuser.ui +++ b/src/widget/about/aboutuser.ui @@ -31,19 +31,19 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + - + 0 0 - - Qt::CustomContextMenu - false @@ -56,6 +56,12 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse +