| 337 | lang_load_t(ui.speed_label); |
| 338 | lang_load_t(ui.match_check); |
| 339 | lang_load_pht(ui.match_name_edit); |
| 340 | lang_load_pht(ui.match_class_edit); |
| 341 | lang_load_pht(ui.match_proc_edit); |
| 342 | lang_load_t(ui.timer_check); |
| 343 | lang_load_t(ui.moveScale_label); |
| 344 | lang_load_t(ui.posScale_label); |
| 345 | TableUpdate(); |
| 346 | } |
| 347 | |
| 348 | bool TriggerUi::GroupCurrented() { return currentGroup; } |
| 349 | bool TriggerUi::TableCurrented() { return currentGroup && currentTable; } |
| 350 | bool TriggerUi::MacroCurrented() { return currentGroup && currentTable && currentMacro; } |
| 351 | bool TriggerUi::ItemCurrented() { return currentGroup && currentTable && currentMacro && (currentRow > -1); } |
| 352 | |
| 353 | void TriggerUi::TableState(int macroGroup) |
| 354 | { |
| 355 | MacroGroup* mg; |
| 356 | QTableWidget* table; |
| 357 | if (macroGroup < 0) |
| 358 | { |
| 359 | mg = currentGroup; |
| 360 | table = ui.macroGroup_table->currentTable(); |
| 361 | } |
| 362 | else |
| 363 | { |
| 364 | mg = &groups->at(macroGroup); |
| 365 | table = ui.macroGroup_table->table(macroGroup); |
| 366 | } |
| 367 | if (!mg || !table) return; |
| 368 | bool state_on = true; for (auto& i : mg->macros) { if (!i.state) { state_on = false; break; } } |
| 369 | bool state_off = true; for (auto& i : mg->macros) { if (i.state) { state_off = false; break; } } |
| 370 | if (!table) return; |
| 371 | if (state_on && state_off) table->horizontalHeaderItem(tableColumn_state)->setText(lang_trans("全部") + QiUi::Symbol::Off); |
| 372 | else if (state_on) table->horizontalHeaderItem(tableColumn_state)->setText(lang_trans("全部") + QiUi::Symbol::On); |
| 373 | else if (state_off) table->horizontalHeaderItem(tableColumn_state)->setText(lang_trans("全部") + QiUi::Symbol::Off); |
| 374 | else table->horizontalHeaderItem(tableColumn_state)->setText(lang_trans("全部") + QiUi::Symbol::Any); |
| 375 | } |
| 376 | void TriggerUi::SetTableItem(QTableWidget* table, int index, const Macro& macro) |
| 377 | { |
| 378 | // name |
| 379 | table->setItem(index, 0, new QTableWidgetItem(macro.name)); |
| 380 | table->item(index, 0)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
| 381 | // key |
nothing calls this directly
no outgoing calls
no test coverage detected