Browse Source

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

Yuriy Puchkov 4 years ago
parent
commit
3b9fb6aeca
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/widgets/historywidget.cpp

+ 11 - 1
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)));