From 3b9fb6aeca012ee4b51df0f39122ba1e8e977a83 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Wed, 17 Feb 2021 15:29:13 +0200 Subject: [PATCH] fix after merging - Open Url & Copy Url in the history, delete question in the history --- src/widgets/historywidget.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/widgets/historywidget.cpp b/src/widgets/historywidget.cpp index 866060e5..f5d7f17b 100644 --- a/src/widgets/historywidget.cpp +++ b/src/widgets/historywidget.cpp @@ -96,7 +96,7 @@ void HistoryWidget::addLine(const QString& path, const QString& fileName) History history; HISTORY_FILE_NAME unpackFileName = history.unpackFileName(fileName); - QString url; + QString url = "https://imgur.com/" + unpackFileName.file; // load pixmap QPixmap pixmap; @@ -153,6 +153,16 @@ void HistoryWidget::addLine(const QString& path, const QString& fileName) buttonDelete->setIcon(QIcon(":/img/material/black/delete.svg")); buttonDelete->setMinimumHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); connect(buttonDelete, &QPushButton::clicked, this, [=]() { + if (ConfigHandler().historyConfirmationToDelete() && + QMessageBox::No == + QMessageBox::question( + this, + tr("Confirm to delete"), + tr("Are you sure you want to delete a screenshot from the " + "latest uploads and server?"), + QMessageBox::Yes | QMessageBox::No)) { + return; + } QDesktopServices::openUrl( QUrl(QStringLiteral("https://imgur.com/delete/%1") .arg(unpackFileName.token)));