MCPcopy Create free account
hub / github.com/LeFroid/Viper-Browser / onScriptCreated

Method onScriptCreated

src/ui/user_scripts/UserScriptWidget.cpp:130–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void UserScriptWidget::onScriptCreated(int scriptIdx)
131{
132 UserScriptModel *model = qobject_cast<UserScriptModel*>(ui->tableViewScripts->model());
133 QModelIndex nameIdx = model->index(scriptIdx, 1);
134 QString scriptName = model->data(nameIdx, Qt::DisplayRole).toString();
135
136 UserScriptEditor *editor = new UserScriptEditor;
137 connect(editor, &UserScriptEditor::scriptModified, model, &UserScriptModel::reloadScript);
138 editor->setScriptInfo(scriptName, model->getScriptSource(scriptIdx), model->getScriptFileName(scriptIdx), scriptIdx);
139 editor->show();
140}

Callers

nothing calls this directly

Calls 5

indexMethod · 0.80
setScriptInfoMethod · 0.80
getScriptSourceMethod · 0.80
getScriptFileNameMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected