Added support to rename query tool and debugger tabs. Fixes #4230

Fixed an issue where non-closeable tabs are getting closed. Fixes #5923
This commit is contained in:
Nikhil Mohite
2020-10-23 17:16:31 +05:30
committed by Akshay Joshi
parent c2ad97d0ab
commit c86a3d64fc
10 changed files with 90 additions and 20 deletions

View File

@@ -441,6 +441,21 @@ define([
method: 'DELETE',
});
});
// Panel Rename event
panel.on(wcDocker.EVENT.RENAME, function(panel_data) {
Alertify.prompt('', panel_data.$titleText[0].textContent,
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
debuggerUtils.setDebuggerTitle(panel, self.preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
}
},
// We will execute this function when user clicks on the Cancel
// button. Do nothing just close it.
function(evt) { evt.cancel = false; }
).set({'title': gettext('Rename Panel')});
});
}
})
.fail(function(xhr) {

View File

@@ -787,6 +787,21 @@ define([
method: 'DELETE',
});
});
// Panel Rename event
panel.on(wcDocker.EVENT.RENAME, function(panel_data) {
Alertify.prompt('', panel_data.$titleText[0].textContent,
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
debuggerUtils.setDebuggerTitle(panel, self.preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
}
},
// We will execute this function when user clicks on the Cancel
// button. Do nothing just close it.
function(evt) { evt.cancel = false; }
).set({'title': gettext('Rename Panel')});
});
}
var _url;

View File

@@ -42,8 +42,14 @@ function getProcedureId(treeInfoObject) {
return objectId;
}
function setDebuggerTitle(panel, preferences, function_name, schema_name, database_name) {
var debugger_title_placeholder = preferences['debugger_tab_title_placeholder'];
function setDebuggerTitle(panel, preferences, function_name, schema_name, database_name, custom_title) {
var debugger_title_placeholder = '';
if(custom_title) {
debugger_title_placeholder = custom_title;
} else {
debugger_title_placeholder = preferences['debugger_tab_title_placeholder'];
}
var placeholders = debugger_title_placeholder.split('%');
var title = '';