removed old temporary phrase and formatPrase implementations

This commit is contained in:
Geoffray Levasseur committed 2026-11-17 11:42:28 +01:00
1 parent 6e634e13d2
commit e96b871779
14 files changed
+231 -598

No files matched your search

+4 -19
View File
@@ -50,7 +50,6 @@
#include "Messg.h"
#include "Term.h"
#include <QHash>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QPainter>
@@ -69,20 +68,6 @@ namespace {
constexpr int MaxHist = 16;
constexpr int ScrollBarWidth = 16; // matches Dpi::ScrollBar's fixed width
// Phrases/Phrases2 (StringTables.pas) aren't ported; disclosed
// plain-English placeholders for this dialog's own chrome text.
QString phrase(const QString &key)
{
static const QHash<QString, QString> table = {
{QStringLiteral("BTN_CONTENTS"), QStringLiteral("Contents")},
{QStringLiteral("BTN_BACK"), QStringLiteral("Back")},
{QStringLiteral("BTN_SEARCH"), QStringLiteral("Search")},
{QStringLiteral("SEARCH"), QStringLiteral("Search Help")},
};
const auto it = table.constFind(key);
return it != table.constEnd() ? it.value() : key;
}
// Help.txt phrases carry raw C printf-style specifiers (copied from the
// original's Format() call sites) - NOT Qt's %1/%2 .arg() syntax. Scans
// left to right, filling each %d/%s in order from args (supports formats
@@ -232,9 +217,9 @@ HelpDlg::HelpDlg(QWidget *parent) : FramedDlg(parent), ui(new Ui::HelpDlg)
helpText.loadFromFile(localizedFilePath(QStringLiteral("Help/Help.txt")));
helpContext = QStringLiteral("CONCEPTS");
ui->topBtn->setToolTip(phrase(QStringLiteral("BTN_CONTENTS")));
ui->backBtn->setToolTip(phrase(QStringLiteral("BTN_BACK")));
ui->searchBtn->setToolTip(phrase(QStringLiteral("BTN_SEARCH")));
ui->topBtn->setToolTip(phrases.lookup(QStringLiteral("BTN_CONTENTS")));
ui->backBtn->setToolTip(phrases.lookup(QStringLiteral("BTN_BACK")));
ui->searchBtn->setToolTip(phrases.lookup(QStringLiteral("BTN_SEARCH")));
ui->closeBtn->onClick = [this] { close(); };
ui->backBtn->onClick = [this] { backBtnClicked(); };
@@ -1157,7 +1142,7 @@ void HelpDlg::topBtnClicked()
void HelpDlg::searchBtnClicked()
{
auto inputDlg = std::make_unique<InputDlg>(nullptr);
inputDlg->setWindowTitle(phrase(QStringLiteral("SEARCH")));
inputDlg->setWindowTitle(phrases.lookup(QStringLiteral("SEARCH")));
inputDlg->editInput()->setText(searchContent);
inputDlg->centerToRect(geometry());
if (inputDlg->showModal() == Dpi::ModalResult::Ok && inputDlg->editInput()->text().length() >= 2) {