##// END OF EJS Templates
Create 'Rename action' in variable menu
Alexandre Leroux -
r635:0276e1c7063e
parent child
Show More
@@ -172,12 +172,23 void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept
172
172
173 // Adds menu-specific actions
173 // Adds menu-specific actions
174 if (!selectedVariables.isEmpty()) {
174 if (!selectedVariables.isEmpty()) {
175 tableMenu.addSeparator();
176
177 // 'Rename' action (only if one variable selected)
178 if (selectedVariables.size() == 1) {
179 auto selectedVariable = selectedVariables.front();
180
181 auto renameFun = [&selectedVariable, &model, this]() {
182 };
183
184 tableMenu.addAction(tr("Rename..."), renameFun);
185 }
186
175 // 'Delete' action
187 // 'Delete' action
176 auto deleteFun = [&selectedVariables]() {
188 auto deleteFun = [&selectedVariables]() {
177 sqpApp->variableController().deleteVariables(selectedVariables);
189 sqpApp->variableController().deleteVariables(selectedVariables);
178 };
190 };
179
191
180 tableMenu.addSeparator();
181 tableMenu.addAction(QIcon{":/icones/delete.png"}, tr("Delete"), deleteFun);
192 tableMenu.addAction(QIcon{":/icones/delete.png"}, tr("Delete"), deleteFun);
182 }
193 }
183
194
General Comments 0
You need to be logged in to leave comments. Login now