diff --git a/tools/chatgui/src/channellist.cpp b/tools/chatgui/src/channellist.cpp index 7ba95cc7a..5209d88b7 100644 --- a/tools/chatgui/src/channellist.cpp +++ b/tools/chatgui/src/channellist.cpp @@ -20,6 +20,7 @@ #include #include #include +#include extern "C" { #include "../../lib/debug_config.h" @@ -281,6 +282,29 @@ ChannelList::ChannelList(DbManager* db, QWidget *parent) plusBtn->setStyleSheet(actionStyle); connect(plusBtn, &QPushButton::clicked, this, [this] { emit joinRequested(); }); fl->addWidget(plusBtn); + auto* helpBtn = new QPushButton(QStringLiteral("?"), footer); + helpBtn->setObjectName("messageFormattingHelpButton"); helpBtn->setFixedSize(34, 34); + helpBtn->setCursor(Qt::PointingHandCursor); helpBtn->setProperty("instantTooltip", true); + helpBtn->setToolTip(QCoreApplication::translate("ChatGui", "Message formatting")); + helpBtn->setAccessibleName(helpBtn->toolTip()); helpBtn->setStyleSheet(actionStyle + "font-size: 22px; font-weight: bold;"); + fl->addWidget(helpBtn); + connect(helpBtn, &QPushButton::clicked, this, [this] { + auto* help = new QMessageBox(QMessageBox::Information, QCoreApplication::translate("ChatGui", "Message formatting"), + QCoreApplication::translate("ChatGui", + "**text** — bold\n" + "__text__ — italic\n" + "~~text~~ — strikethrough\n\n" + "Use paired tags on one line, without spaces next to the text.\n\n" + "Code blocks: put ``` on separate lines, as shown:\n" + "```cpp\n" + "int value = 42;\n" + "```\n\n" + "The language after ``` is optional: the chat will try to detect it.\n" + "Use ```text to disable highlighting. Copy copies the whole block."), QMessageBox::Ok, this); + help->setObjectName("messageFormattingHelp"); help->setAttribute(Qt::WA_DeleteOnClose); + help->setTextFormat(Qt::PlainText); help->setTextInteractionFlags(Qt::TextSelectableByMouse); help->open(); + DEBUG_INFO(DEBUG_CATEGORY_CHAT, "message formatting help opened"); + }); DEBUG_DEBUG(DEBUG_CATEGORY_CHAT, "channel actions initialized icons=group-plus/enter icon_px=28 button=40x38 background=transparent tooltip_delay_ms=0"); DEBUG_DEBUG(DEBUG_CATEGORY_CHAT, "connection monitor button initialized icon=diagnostics icon_px=24 button=34x34 tooltip_delay_ms=0"); diff --git a/tools/chatgui/translations/chatgui_en.ts b/tools/chatgui/translations/chatgui_en.ts index 1bc719836..3b8abca7c 100644 --- a/tools/chatgui/translations/chatgui_en.ts +++ b/tools/chatgui/translations/chatgui_en.ts @@ -3,6 +3,11 @@ ChatGui + Message formattingMessage formatting + + **text** — bold __text__ — italic ~~text~~ — strikethrough Use paired tags on one line, without spaces next to the text. Code blocks: put ``` on separate lines, as shown: ```cpp int value = 42; ``` The language after ``` is optional: the chat will try to detect it. Use ```text to disable highlighting. Copy copies the whole block. + **text** — bold __text__ — italic ~~text~~ — strikethrough Use paired tags on one line, without spaces next to the text. Code blocks: put ``` on separate lines, as shown: ```cpp int value = 42; ``` The language after ``` is optional: the chat will try to detect it. Use ```text to disable highlighting. Copy copies the whole block. + Device group nameDevice group name Could not rename device groupCould not rename device group Expand devicesExpand devices diff --git a/tools/chatgui/translations/chatgui_ru.ts b/tools/chatgui/translations/chatgui_ru.ts index e9a41e35f..52dfa7751 100644 --- a/tools/chatgui/translations/chatgui_ru.ts +++ b/tools/chatgui/translations/chatgui_ru.ts @@ -3,6 +3,11 @@ ChatGui + Message formattingФорматирование сообщений + + **text** — bold __text__ — italic ~~text~~ — strikethrough Use paired tags on one line, without spaces next to the text. Code blocks: put ``` on separate lines, as shown: ```cpp int value = 42; ``` The language after ``` is optional: the chat will try to detect it. Use ```text to disable highlighting. Copy copies the whole block. + **текст** — жирный __текст__ — курсив ~~текст~~ — зачёркнутый Ставьте парные теги в одной строке, без пробелов рядом с текстом. Блок кода: ``` должны быть на отдельных строках, как в примере: ```cpp int value = 42; ``` Язык после ``` необязателен: чат попробует определить его сам. Укажите ```text для кода без подсветки. Copy копирует весь блок. + Device group nameИмя группы устройств Could not rename device groupНе удалось переименовать группу устройств Expand devicesРазвернуть устройства