Merge pull request #4816 from xcfrg/log-confirmation

NOISSUE add log upload confirmation
This commit is contained in:
Petr Mrázek 2022-07-06 08:51:33 +02:00 committed by GitHub
commit 0f41bea58a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include "ui/GuiUtil.h"
#include "ui/ColorCache.h"
#include "ui/dialogs/CustomMessageBox.h"
#include <BuildConfig.h>
@ -238,6 +239,18 @@ void LogPage::on_btnPaste_clicked()
if(!m_model)
return;
auto response = CustomMessageBox::selectable(
this,
tr("Log upload"),
tr("Are you sure you want to upload a log file?"),
QMessageBox::Warning,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No
)->exec();
if (response != QMessageBox::Yes)
return;
//FIXME: turn this into a proper task and move the upload logic out of GuiUtil!
m_model->append(
MessageLevel::Launcher,

View File

@ -21,6 +21,7 @@
#include "ui/GuiUtil.h"
#include "RecursiveFileSystemWatcher.h"
#include "ui/dialogs/CustomMessageBox.h"
#include <GZip.h>
#include <FileSystem.h>
#include <QShortcut>
@ -179,6 +180,18 @@ void OtherLogsPage::on_btnReload_clicked()
void OtherLogsPage::on_btnPaste_clicked()
{
auto response = CustomMessageBox::selectable(
this,
tr("Log upload"),
tr("Are you sure you want to upload a log file?"),
QMessageBox::Warning,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No
)->exec();
if (response != QMessageBox::Yes)
return;
GuiUtil::uploadPaste(ui->text->toPlainText(), this);
}