| 219 | } |
| 220 | |
| 221 | static void openSettingsDialog(VariableTable *table) |
| 222 | { |
| 223 | auto selectedRows = table->Table()->selectionModel()->selectedRows(); |
| 224 | if (selectedRows.empty()) { |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | auto cell = table->Table()->item(selectedRows.last().row(), 0); |
| 229 | if (!cell) { |
| 230 | return; |
| 231 | } |
| 232 | |
| 233 | auto weakVariable = GetWeakVariableByQString(cell->text()); |
| 234 | auto variable = weakVariable.lock(); |
| 235 | if (!variable) { |
| 236 | return; |
| 237 | } |
| 238 | |
| 239 | auto oldName = variable->Name(); |
| 240 | bool accepted = VariableSettingsDialog::AskForSettings( |
| 241 | GetSettingsWindow(), *variable.get()); |
| 242 | if (accepted && oldName != variable->Name()) { |
| 243 | VariableSignalManager::Instance()->Rename( |
| 244 | QString::fromStdString(oldName), |
| 245 | QString::fromStdString(variable->Name())); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | void VariableTable::Remove() |
| 250 | { |
no test coverage detected