aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/module/GlobalRegisterTable.cpp22
-rw-r--r--src/ui/dialog/controller/ModuleControllerDialog.cpp20
2 files changed, 28 insertions, 14 deletions
diff --git a/src/core/module/GlobalRegisterTable.cpp b/src/core/module/GlobalRegisterTable.cpp
index 006118b3..bac51d85 100644
--- a/src/core/module/GlobalRegisterTable.cpp
+++ b/src/core/module/GlobalRegisterTable.cpp
@@ -44,7 +44,7 @@ class GlobalRegisterTable::Impl {
public:
struct RTNode {
QString name;
- QString type = "NODE";
+ QString type = tr("NODE");
int version = 0;
const std::type_info* value_type = nullptr;
std::optional<std::any> value = std::nullopt;
@@ -79,7 +79,7 @@ class GlobalRegisterTable::Impl {
}
current->name = segments.back();
- current->type = "LEAF";
+ current->type = tr("LEAF");
current->value = v;
current->value_type = &v.type();
version = ++current->version;
@@ -190,7 +190,7 @@ class GlobalRegisterTableTreeModel::Impl {
}
static auto Any2QVariant(std::optional<std::any> op) -> QVariant {
- if (!op) return "<EMPTY>";
+ if (!op) return tr("<EMPTY>");
auto& o = op.value();
if (o.type() == typeid(QString)) {
@@ -229,7 +229,7 @@ class GlobalRegisterTableTreeModel::Impl {
if (o.type() == typeid(bool)) {
return QVariant::fromValue(std::any_cast<bool>(o));
}
- return "<UNSUPPORTED>";
+ return tr("<UNSUPPORTED>");
}
[[nodiscard]] auto Index(int row, int column, const QModelIndex& parent) const
@@ -252,25 +252,25 @@ class GlobalRegisterTableTreeModel::Impl {
if (!parent_node || parent_node == root_node_) return {};
- int row =
- parent_node->parent.lock()->children.keys().indexOf(parent_node->name);
+ int const row = static_cast<int>(
+ parent_node->parent.lock()->children.keys().indexOf(parent_node->name));
return parent_->createIndex(row, 0, parent_node.data());
}
[[nodiscard]] static auto HeaderData(int section, Qt::Orientation orientation,
int role) -> QVariant {
- if (role != Qt::DisplayRole) return QVariant();
+ if (role != Qt::DisplayRole) return {};
if (orientation == Qt::Horizontal) {
switch (section) {
case 0:
- return QString("Key");
+ return tr("Key");
case 1:
- return QString("Type");
+ return tr("Type");
case 2:
- return QString("Value Type");
+ return tr("Value Type");
case 3:
- return QString("Value");
+ return tr("Value");
default:
return {};
}
diff --git a/src/ui/dialog/controller/ModuleControllerDialog.cpp b/src/ui/dialog/controller/ModuleControllerDialog.cpp
index 8dfd8dd6..8c04d728 100644
--- a/src/ui/dialog/controller/ModuleControllerDialog.cpp
+++ b/src/ui/dialog/controller/ModuleControllerDialog.cpp
@@ -46,6 +46,16 @@ ModuleControllerDialog::ModuleControllerDialog(QWidget* parent)
ui_->setupUi(this);
ui_->actionsGroupBox->hide();
+ ui_->moduleInfoLabel->setText(tr("Module Informations"));
+ ui_->actionsGroupBox->setTitle(tr("Actions"));
+ ui_->showModsDirButton->setText(tr("Show Mods Directory"));
+
+ ui_->tabWidget->setTabText(0, tr("Registered Modules"));
+ ui_->tabWidget->setTabText(1, tr("Global Register Table"));
+ ui_->tabWidget->setTabText(2, tr("Debugger"));
+
+ this->setWindowTitle(tr("Module Controller"));
+
connect(ui_->moduleListView, &ModuleListView::SignalSelectModule, this,
&ModuleControllerDialog::slot_load_module_details);
@@ -84,6 +94,10 @@ ModuleControllerDialog::ModuleControllerDialog(QWidget* parent)
QDesktopServices::openUrl(QUrl::fromLocalFile(
GlobalSettingStation::GetInstance().GetModulesDir()));
});
+
+#ifdef RELEASE
+ ui_->tabWidget->setTabEnabled(2, false);
+#endif
}
void ModuleControllerDialog::slot_load_module_details(
@@ -113,7 +127,7 @@ void ModuleControllerDialog::slot_load_module_details(
QString buffer;
QTextStream info(&buffer);
- info << "# BASIC INFO" << Qt::endl << Qt::endl;
+ info << "# " << tr("BASIC INFO") << Qt::endl << Qt::endl;
info << " - " << tr("ID") << ": " << module->GetModuleIdentifier()
<< Qt::endl;
@@ -135,7 +149,7 @@ void ModuleControllerDialog::slot_load_module_details(
info << Qt::endl;
- info << "# METADATA" << Qt::endl << Qt::endl;
+ info << "# " << tr("METADATA") << Qt::endl << Qt::endl;
for (const auto& metadata : module->GetModuleMetaData().asKeyValueRange()) {
info << " - " << metadata.first << ": " << metadata.second << "\n";
@@ -144,7 +158,7 @@ void ModuleControllerDialog::slot_load_module_details(
info << Qt::endl;
if (if_activated) {
- info << "# Listening Event" << Qt::endl << Qt::endl;
+ info << "# " << tr("Listening Event") << Qt::endl << Qt::endl;
auto listening_event_ids = module_manager_->GetModuleListening(module_id);
for (const auto& event_id : listening_event_ids) {