can hide debug console

This commit is contained in:
Chris Esposito 2021-06-24 17:59:36 +10:00
parent faa07c7e3c
commit 7b0dc8e7bc
3 changed files with 24 additions and 18 deletions

View File

@ -1124,20 +1124,23 @@ void MainWindow::cycleDelayLeft_large(){
ui->controller_iso->delayUpdated(ui->controller_iso->display.delay);
}
void MainWindow::enableLabradorDebugging(){
void MainWindow::enableLabradorDebugging(bool enabled){
qDebug() << "DEBUG MODE ACTIVE";
ui->debugButton1->setVisible(1);
ui->debugButton2->setVisible(1);
ui->debugButton3->setVisible(1);
ui->debugButton1->setVisible(enabled);
ui->debugButton2->setVisible(enabled);
ui->debugButton3->setVisible(enabled);
#ifndef PLATFORM_ANDROID
ui->kickstartIsoButton->setVisible(1);
ui->kickstartIsoButton->setVisible(enabled);
#endif
ui->debugConsole->setVisible(1);
ui->debugConsole->setVisible(enabled);
new Q_DebugStream(std::cout, ui->debugConsole); //Redirect Console output to QTextEdit
Q_DebugStream::registerQDebugMessageHandler(); //Redirect qDebug() output to QTextEdit
qDebug() << "DEBUG MODE ACTIVE";
if (enabled)
{
new Q_DebugStream(std::cout, ui->debugConsole); //Redirect Console output to QTextEdit
Q_DebugStream::registerQDebugMessageHandler(); //Redirect qDebug() output to QTextEdit
qDebug() << "DEBUG MODE ACTIVE";
}
}
void MainWindow::on_actionAutomatically_Enable_Cursors_toggled(bool enabled)
@ -2149,11 +2152,6 @@ void MainWindow::on_actionFirmware_Recovery_triggered()
ui->controller_iso->driver->manualFirmwareRecovery();
}
void MainWindow::on_actionShow_Debug_Console_triggered()
{
enableLabradorDebugging();
}
void MainWindow::on_actionDAQ_Settings_triggered()
{
qDebug() << "on_actionDAQ_Settings_triggered()";
@ -2570,3 +2568,8 @@ void MainWindow::on_actionDark_Mode_triggered(bool checked)
{
setDarkMode(checked);
}
void MainWindow::on_actionShow_Debug_Console_triggered(bool checked)
{
enableLabradorDebugging(checked);
}

View File

@ -117,7 +117,7 @@ private slots:
void cycleDelayRight();
void cycleDelayLeft_large();
void cycleDelayRight_large();
void enableLabradorDebugging();
void enableLabradorDebugging(bool enabled);
//Power Supply
void on_actionAuto_Lock_toggled(bool arg1);
@ -164,8 +164,6 @@ private slots:
void on_actionFirmware_Recovery_triggered();
void on_actionShow_Debug_Console_triggered();
void on_actionDAQ_Settings_triggered();
void fileLimitReached_CH1(void);
@ -229,6 +227,8 @@ private slots:
void on_actionDark_Mode_triggered(bool checked);
void on_actionShow_Debug_Console_triggered(bool checked);
private:
//Generic Vars
Ui::MainWindow *ui;

View File

@ -1779,8 +1779,8 @@
<addaction name="actionDocumentation"/>
<addaction name="actionPinout"/>
<addaction name="actionFirmware_Recovery"/>
<addaction name="actionShow_Debug_Console"/>
<addaction name="actionAbout"/>
<addaction name="actionShow_Debug_Console"/>
</widget>
<widget class="QMenu" name="menuSignal_Generator">
<property name="title">
@ -2467,6 +2467,9 @@
</property>
</action>
<action name="actionShow_Debug_Console">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Show Debug Console</string>
</property>