Add URL to explain message macros (#4712)

* Add URL Link to Explain Message Macros

* Add URL Link to Explain Message Macros

* Revert custom shortcuts wiki link

* Conform to formatting guidelines
This commit is contained in:
SlightlyCircuitous 2022-12-11 17:54:06 -05:00 committed by GitHub
parent 2c94a6a64e
commit e9f1992c7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View file

@ -796,6 +796,9 @@ MessagesSettingsPage::MessagesSettingsPage()
connect(&chatMentionCompleterCheckbox, SIGNAL(stateChanged(int)), &SettingsCache::instance(), connect(&chatMentionCompleterCheckbox, SIGNAL(stateChanged(int)), &SettingsCache::instance(),
SLOT(setChatMentionCompleter(int))); SLOT(setChatMentionCompleter(int)));
explainMessagesLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse);
explainMessagesLabel.setOpenExternalLinks(true);
ignoreUnregUsersMainChat.setChecked(SettingsCache::instance().getIgnoreUnregisteredUsers()); ignoreUnregUsersMainChat.setChecked(SettingsCache::instance().getIgnoreUnregisteredUsers());
ignoreUnregUserMessages.setChecked(SettingsCache::instance().getIgnoreUnregisteredUserMessages()); ignoreUnregUserMessages.setChecked(SettingsCache::instance().getIgnoreUnregisteredUserMessages());
connect(&ignoreUnregUsersMainChat, SIGNAL(stateChanged(int)), &SettingsCache::instance(), connect(&ignoreUnregUsersMainChat, SIGNAL(stateChanged(int)), &SettingsCache::instance(),
@ -887,12 +890,15 @@ MessagesSettingsPage::MessagesSettingsPage()
messageListLayout->addWidget(messageToolBar); messageListLayout->addWidget(messageToolBar);
messageListLayout->addWidget(messageList); messageListLayout->addWidget(messageList);
messageShortcuts = new QGroupBox; auto *messagesLayout = new QVBoxLayout; // combines the explainer label with the actual messages widget pieces
messageShortcuts->setLayout(messageListLayout); messagesLayout->addLayout(messageListLayout);
messagesLayout->addWidget(&explainMessagesLabel);
auto *mainLayout = new QVBoxLayout; messageGroupBox = new QGroupBox; // draws a box around the above layout and allows it to be titled
messageGroupBox->setLayout(messagesLayout);
mainLayout->addWidget(messageShortcuts); auto *mainLayout = new QVBoxLayout; // combines the messages groupbox with the rest of the menu
mainLayout->addWidget(messageGroupBox);
mainLayout->addWidget(chatGroupBox); mainLayout->addWidget(chatGroupBox);
mainLayout->addWidget(highlightGroupBox); mainLayout->addWidget(highlightGroupBox);
@ -993,7 +999,9 @@ void MessagesSettingsPage::retranslateUi()
highlightGroupBox->setTitle(tr("Custom alert words")); highlightGroupBox->setTitle(tr("Custom alert words"));
chatMentionCheckBox.setText(tr("Enable chat mentions")); chatMentionCheckBox.setText(tr("Enable chat mentions"));
chatMentionCompleterCheckbox.setText(tr("Enable mention completer")); chatMentionCompleterCheckbox.setText(tr("Enable mention completer"));
messageShortcuts->setTitle(tr("In-game message macros")); messageGroupBox->setTitle(tr("In-game message macros"));
explainMessagesLabel.setText(
QString("<a href='%1'>%2</a>").arg(WIKI_CUSTOM_SHORTCUTS).arg(tr("How to use in-game message macros")));
ignoreUnregUsersMainChat.setText(tr("Ignore chat room messages sent by unregistered users")); ignoreUnregUsersMainChat.setText(tr("Ignore chat room messages sent by unregistered users"));
ignoreUnregUserMessages.setText(tr("Ignore private messages sent by unregistered users")); ignoreUnregUserMessages.setText(tr("Ignore private messages sent by unregistered users"));
invertMentionForeground.setText(tr("Invert text color")); invertMentionForeground.setText(tr("Invert text color"));

View file

@ -202,13 +202,14 @@ private:
QCheckBox roomHistory; QCheckBox roomHistory;
QGroupBox *chatGroupBox; QGroupBox *chatGroupBox;
QGroupBox *highlightGroupBox; QGroupBox *highlightGroupBox;
QGroupBox *messageShortcuts; QGroupBox *messageGroupBox;
QLineEdit *mentionColor; QLineEdit *mentionColor;
QLineEdit *highlightColor; QLineEdit *highlightColor;
QLineEdit *customAlertString; QLineEdit *customAlertString;
QLabel hexLabel; QLabel hexLabel;
QLabel hexHighlightLabel; QLabel hexHighlightLabel;
QLabel customAlertStringLabel; QLabel customAlertStringLabel;
QLabel explainMessagesLabel;
void storeSettings(); void storeSettings();
void updateMentionPreview(); void updateMentionPreview();