|
|
@ -751,6 +751,8 @@ void RPCConsole::on_lineEdit_returnPressed() |
|
|
|
|
|
|
|
|
|
|
|
if(!cmd.isEmpty()) |
|
|
|
if(!cmd.isEmpty()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
cmdBeforeBrowsing = QString(); |
|
|
|
|
|
|
|
|
|
|
|
message(CMD_REQUEST, cmd); |
|
|
|
message(CMD_REQUEST, cmd); |
|
|
|
Q_EMIT cmdRequest(cmd); |
|
|
|
Q_EMIT cmdRequest(cmd); |
|
|
|
// Remove command, if already in history
|
|
|
|
// Remove command, if already in history
|
|
|
@ -769,6 +771,11 @@ void RPCConsole::on_lineEdit_returnPressed() |
|
|
|
|
|
|
|
|
|
|
|
void RPCConsole::browseHistory(int offset) |
|
|
|
void RPCConsole::browseHistory(int offset) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// store current text when start browsing through the history
|
|
|
|
|
|
|
|
if (historyPtr == history.size()) { |
|
|
|
|
|
|
|
cmdBeforeBrowsing = ui->lineEdit->text(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
historyPtr += offset; |
|
|
|
historyPtr += offset; |
|
|
|
if(historyPtr < 0) |
|
|
|
if(historyPtr < 0) |
|
|
|
historyPtr = 0; |
|
|
|
historyPtr = 0; |
|
|
@ -777,6 +784,9 @@ void RPCConsole::browseHistory(int offset) |
|
|
|
QString cmd; |
|
|
|
QString cmd; |
|
|
|
if(historyPtr < history.size()) |
|
|
|
if(historyPtr < history.size()) |
|
|
|
cmd = history.at(historyPtr); |
|
|
|
cmd = history.at(historyPtr); |
|
|
|
|
|
|
|
else if (!cmdBeforeBrowsing.isNull()) { |
|
|
|
|
|
|
|
cmd = cmdBeforeBrowsing; |
|
|
|
|
|
|
|
} |
|
|
|
ui->lineEdit->setText(cmd); |
|
|
|
ui->lineEdit->setText(cmd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|