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();
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
clearHintText();
|
||||
|
@ -113,6 +121,10 @@ void IOConsoleDialog::acceptInput()
|
|||
g_free(error_str);
|
||||
}
|
||||
}
|
||||
else {
|
||||
setHintText("Code evaluated successfully.");
|
||||
connect(ui->inputPlainTextEdit, &QPlainTextEdit::textChanged, this, &IOConsoleDialog::clearSuccessHint);
|
||||
}
|
||||
}
|
||||
|
||||
void IOConsoleDialog::appendOutputText(const QString &text)
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
private slots:
|
||||
void acceptInput();
|
||||
void on_clearActivated(void);
|
||||
void clearSuccessHint(void);
|
||||
|
||||
private:
|
||||
Ui::IOConsoleDialog *ui;
|
||||
|
|
Loading…
Reference in New Issue