fix after merging - Open Url & Copy Url in the history, delete question in the history

This commit is contained in:
Yuriy Puchkov
2021-02-17 15:29:13 +02:00
parent 894556d681
commit 3b9fb6aeca

View File

@@ -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)));