mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-25 15:16:02 +00:00
Merge pull request #4816 from xcfrg/log-confirmation
NOISSUE add log upload confirmation
This commit is contained in:
commit
0f41bea58a
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user