Usability improvements for Extended Table Widget and SQL

results pane

Copy for multi-line text data surrounds the text with the
<pre> tag in the HTML version for avoiding line white-space
adjustments in the pasted text. See #1058

Do not use binary data in the "Use as Filter" option.

Indicate the existence of an error in the background of the
SQL results frame. The error-indicators is reused for
disabling this functionality.

When nothing is shown, a placeholder text hints the
objective of the results pane.

The preference label for the font size of this pane is
modified for consistency (SQL Log is another widget).
This commit is contained in:
mgrojo
2017-11-19 00:57:42 +01:00
parent e60e9ffc75
commit 87e1b9bc7c
6 changed files with 36 additions and 9 deletions

View File

@@ -55,10 +55,17 @@ QString SqlExecutionArea::getSelectedSql() const
return ui->editEditor->selectedText().trimmed().replace(QChar(0x2029), '\n');
}
void SqlExecutionArea::finishExecution(const QString& result)
void SqlExecutionArea::finishExecution(const QString& result, const bool ok)
{
m_columnsResized = false;
ui->editErrors->setPlainText(result);
// Set reddish background when not ok
if (showErrorIndicators)
if (ok)
ui->editErrors->setStyleSheet("");
else
ui->editErrors->setStyleSheet("color: white; background-color: rgb(255, 102, 102)");
}
void SqlExecutionArea::fetchedData()
@@ -135,6 +142,12 @@ void SqlExecutionArea::reloadSettings()
// Set prefetch settings
model->setChunkSize(Settings::getValue("db", "prefetchsize").toInt());
// Check if error indicators are enabled for the not-ok background clue
showErrorIndicators = Settings::getValue("editor", "error_indicators").toBool();
if (!showErrorIndicators)
ui->editErrors->setStyleSheet("");
}
void SqlExecutionArea::find(QString expr, bool forward)