Qt: Add "success" hint to IO Console Dialog
This commit is contained in:
parent
5a1da4f692
commit
5d35745f01
|
@ -85,6 +85,14 @@ void IOConsoleDialog::clearHintText()
|
||||||
ui->hintLabel->clear();
|
ui->hintLabel->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IOConsoleDialog::clearSuccessHint()
|
||||||
|
{
|
||||||
|
// Text changed so we no longer have a success.
|
||||||
|
ui->hintLabel->clear();
|
||||||
|
// Disconnect this slot until the next success.
|
||||||
|
disconnect(ui->inputPlainTextEdit, &QPlainTextEdit::textChanged, this, &IOConsoleDialog::clearSuccessHint);
|
||||||
|
}
|
||||||
|
|
||||||
void IOConsoleDialog::acceptInput()
|
void IOConsoleDialog::acceptInput()
|
||||||
{
|
{
|
||||||
clearHintText();
|
clearHintText();
|
||||||
|
@ -113,6 +121,10 @@ void IOConsoleDialog::acceptInput()
|
||||||
g_free(error_str);
|
g_free(error_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
setHintText("Code evaluated successfully.");
|
||||||
|
connect(ui->inputPlainTextEdit, &QPlainTextEdit::textChanged, this, &IOConsoleDialog::clearSuccessHint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IOConsoleDialog::appendOutputText(const QString &text)
|
void IOConsoleDialog::appendOutputText(const QString &text)
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
void acceptInput();
|
void acceptInput();
|
||||||
void on_clearActivated(void);
|
void on_clearActivated(void);
|
||||||
|
void clearSuccessHint(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::IOConsoleDialog *ui;
|
Ui::IOConsoleDialog *ui;
|
||||||
|
|
Loading…
Reference in New Issue