Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: edit error/warning messages color of message logger #1247

Merged
merged 7 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Added

- Use [Kate's Syntax highlighter](https://api.kde.org/frameworks/syntax-highlighting/html/) engine for Code Highlighting. (#1101)
- Add options to select error/warning messages colors for message logger. (#521 and #1247)

### Fixied

Expand Down
4 changes: 2 additions & 2 deletions src/Core/MessageLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ void MessageLogger::info(const QString &head, const QString &body, bool htmlEsca
void MessageLogger::warn(const QString &head, const QString &body, bool htmlEscaped)
{
LOG_INFO(INFO_OF(head) << INFO_OF(body));
message(head, body, "green", htmlEscaped);
message(head, body, SettingsHelper::getWarnMessageColor(), htmlEscaped);
}

void MessageLogger::error(const QString &head, const QString &body, bool htmlEscaped)
{
LOG_INFO(INFO_OF(head) << INFO_OF(body));
message(head, body, "red", htmlEscaped);
message(head, body, SettingsHelper::getErrorMessageColor(), htmlEscaped);
}

void MessageLogger::onAnchorClicked(const QUrl &link)
Expand Down
3 changes: 2 additions & 1 deletion src/Settings/PreferencesWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QMainWindow(parent)
.end()
.dir(TRKEY("Appearance"))
.page(TRKEY("General"),{"Locale", "UI Style", "Editor Theme", "Opacity", "Test Case Maximum Height",
"Show Compile And Run Only", "Display EOLN In Diff", "Extra Bottom Margin"})
"Show Compile And Run Only", "Display EOLN In Diff", "Extra Bottom Margin",
"Error Message Color", "Warn Message Color"})
.page(TRKEY("Font"), {"Show Only Monospaced Font", "Editor Font", "Test Cases Font", "Message Logger Font",
"Use Custom Application Font", "Custom Application Font"})
.end()
Expand Down
18 changes: 18 additions & 0 deletions src/Settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1243,5 +1243,23 @@
"name": "Display Stopwatch"
}
]
},
{
"name": "Error Message Color",
"desc": "Color of error messages",
"type": "QString",
"ui": "QComboBox",
"param": "QStringList {\"aqua\", \"black\", \"blue\", \"fuchsia\", \"gray\", \"green\", \"lime\", \"maroon\", \"navy\", \"olive\", \"orange\", \"purple\", \"red\", \"silver\", \"teal\", \"white\", \"yellow\"}",
"default": "red",
"tip": "Color of error messages"
},
{
"name": "Warn Message Color",
"desc": "Color of warning messages",
"type": "QString",
"ui": "QComboBox",
"param": "QStringList {\"aqua\", \"black\", \"blue\", \"fuchsia\", \"gray\", \"green\", \"lime\", \"maroon\", \"navy\", \"olive\", \"orange\", \"purple\", \"red\", \"silver\", \"teal\", \"white\", \"yellow\"}",
"default": "green",
"tip": "Color of warning messages"
}
]
8 changes: 8 additions & 0 deletions translations/el_GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,14 @@ This may reduce distractions caused by stopwatch updates.</source>
<source>Highlight lines containing diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of error messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of warning messages</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutItem</name>
Expand Down
8 changes: 8 additions & 0 deletions translations/es_MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,14 @@ Es una lista de &lt;nombre de ruta predeterminada&gt;, separadas por comas, y pu
<source>Highlight lines containing diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of error messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of warning messages</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutItem</name>
Expand Down
8 changes: 8 additions & 0 deletions translations/pt_BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,14 @@ Isso pode reduzir distrações causadas pelas atualizações do cronômetro.</tr
<source>Highlight lines containing diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of error messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of warning messages</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutItem</name>
Expand Down
8 changes: 8 additions & 0 deletions translations/ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2698,6 +2698,14 @@ This may reduce distractions caused by stopwatch updates.</source>
<source>Highlight lines containing diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of error messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of warning messages</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutItem</name>
Expand Down
8 changes: 8 additions & 0 deletions translations/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,14 @@ This may reduce distractions caused by stopwatch updates.</source>
<source>Highlight lines containing diagnostics</source>
<translation>高亮包含代码提示的行</translation>
</message>
<message>
<source>Color of error messages</source>
<translation>错误信息的颜色</translation>
</message>
<message>
<source>Color of warning messages</source>
<translation>警告信息的颜色</translation>
</message>
</context>
<context>
<name>ShortcutItem</name>
Expand Down
8 changes: 8 additions & 0 deletions translations/zh_TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,14 @@ This may reduce distractions caused by stopwatch updates.</source>
<source>Highlight lines containing diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of error messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color of warning messages</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutItem</name>
Expand Down
Loading