MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / openSettingsDialog

Function openSettingsDialog

lib/variables/variable-tab.cpp:221–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221static 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
249void VariableTable::Remove()
250{

Callers 1

VariableTableMethod · 0.70

Calls 5

GetWeakVariableByQStringFunction · 0.85
GetSettingsWindowFunction · 0.50
emptyMethod · 0.45
NameMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected