rewrote debug message handler

This commit is contained in:
itsmattkc
2019-01-12 00:54:39 +11:00
parent 0be6130861
commit 9924315508
26 changed files with 301 additions and 231 deletions
+26
View File
@@ -0,0 +1,26 @@
#include "debugdialog.h"
#include <QTextEdit>
#include <QVBoxLayout>
#include "debug.h"
DebugDialog* debug_dialog = NULL;
DebugDialog::DebugDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle("Debug Log");
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
textEdit = new QTextEdit();
layout->addWidget(textEdit);
}
void DebugDialog::update_log() {
textEdit->setHtml(get_debug_str());
}
void DebugDialog::showEvent(QShowEvent *) {
update_log();
}
+21
View File
@@ -0,0 +1,21 @@
#ifndef DEBUGDIALOG_H
#define DEBUGDIALOG_H
#include <QDialog>
class QTextEdit;
class DebugDialog : public QDialog {
Q_OBJECT
public:
DebugDialog(QWidget* parent = 0);
public slots:
void update_log();
protected:
void showEvent(QShowEvent* event);
private:
QTextEdit* textEdit;
};
extern DebugDialog* debug_dialog;
#endif // DEBUGDIALOG_H
+5 -5
View File
@@ -62,8 +62,8 @@ ExportDialog::ExportDialog(QWidget *parent) :
rangeCombobox->setCurrentIndex(0);
if (sequence->using_workarea) {
rangeCombobox->setEnabled(true);
if (sequence->enable_workarea) rangeCombobox->setCurrentIndex(1);
rangeCombobox->setEnabled(true);
if (sequence->enable_workarea) rangeCombobox->setCurrentIndex(1);
}
format_strings.resize(FORMAT_SIZE);
@@ -286,7 +286,7 @@ void ExportDialog::format_changed(int index)
default_acodec = 1;
break;
default:
dout << "[ERROR] Invalid format selection - this is a bug, please inform the developers";
qCritical() << "Invalid format selection - this is a bug, please inform the developers";
}
AVCodec* codec_info;
@@ -388,7 +388,7 @@ void ExportDialog::export_action() {
ext = "tif";
break;
default:
dout << "[ERROR] Invalid codec selection for an image sequence";
qCritical() << "Invalid codec selection for an image sequence";
QMessageBox::critical(this, "Invalid codec", "Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers.", QMessageBox::Ok);
return;
}
@@ -453,7 +453,7 @@ void ExportDialog::export_action() {
}
break;
default:
dout << "[ERROR] Invalid format - this is a bug, please inform the developers";
qCritical() << "Invalid format - this is a bug, please inform the developers";
QMessageBox::critical(this, "Invalid format", "Couldn't determine output format. This is a bug, please contact the developers.", QMessageBox::Ok);
return;
}