Skip to content
Snippets Groups Projects

Bugs 3089

Merged tatiana.novikova requested to merge bugs-3089 into develop
4 files
+ 40
18
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -7,6 +7,8 @@ DapConsoleRightPanelForm
@@ -7,6 +7,8 @@ DapConsoleRightPanelForm
property string commandQuery
property string commandQuery
///@detalis historyQuery Text of command from the command history.
///@detalis historyQuery Text of command from the command history.
property string historyQuery
property string historyQuery
 
///@detalis historyQueryIndex Index of command from the command history.
 
property string historyQueryIndex
///@detalis historySize Num of history command at right panel.
///@detalis historySize Num of history command at right panel.
property int historySize: 10
property int historySize: 10
@@ -23,7 +25,6 @@ DapConsoleRightPanelForm
@@ -23,7 +25,6 @@ DapConsoleRightPanelForm
//Returns true if item 'someElement' is already exist at list 'someModel'.
//Returns true if item 'someElement' is already exist at list 'someModel'.
function findElement(someModel, someElement)
function findElement(someModel, someElement)
{
{
console.log("someElement.query", someElement.query)
for(var i = 0; i < someModel.count; ++i)
for(var i = 0; i < someModel.count; ++i)
if(someModel.get(i).query === someElement.query)
if(someModel.get(i).query === someElement.query)
{
{
@@ -36,22 +37,28 @@ DapConsoleRightPanelForm
@@ -36,22 +37,28 @@ DapConsoleRightPanelForm
onCommandQueryChanged:
onCommandQueryChanged:
{
{
console.log("commandQuery", commandQuery)
//Adding only new element
//Adding only new element
if(!findElement(modelHistoryConsole, {query: commandQuery}))
if(!findElement(modelHistoryConsole, {query: commandQuery}))
{
{
if(commandQuery !== "")
if(commandQuery !== "")
{
modelHistoryConsole.insert(0, {query: commandQuery});
modelHistoryConsole.insert(0, {query: commandQuery});
}
}
}
else
else
modelHistoryConsole.insert(0, {query: commandQuery});
modelHistoryConsole.insert(0, {query: commandQuery});
//History is limited by historySize and realized as FIFO
//History is limited by historySize and realized as FIFO
if(historySize < modelHistoryConsole.count)
if(historySize < modelHistoryConsole.count)
{
modelHistoryConsole.remove(modelHistoryConsole.count-1);
modelHistoryConsole.remove(modelHistoryConsole.count-1);
 
}
 
 
//Handler for the doubleClick on right history panel
 
onHistoryQueryIndexChanged:
 
{
 
if(historyQueryIndex > -1)
 
{
 
historyQuery = modelHistoryConsole.get(historyQueryIndex).query;
 
historyQueryIndex = -1;
 
historyQuery = ""
}
}
}
}
}
}
Loading