RPC console: scroll to the end when user enters a command

- Ensures that the command and reply is visible
This commit is contained in:
Wladimir J. van der Laan 2012-05-14 18:17:12 +02:00
parent b07ea7c74b
commit 5a060b8dc8
2 changed files with 11 additions and 1 deletions

View file

@ -11,6 +11,7 @@
#include <QTextEdit>
#include <QKeyEvent>
#include <QUrl>
#include <QScrollBar>
#include <boost/tokenizer.hpp>
@ -262,6 +263,8 @@ void RPCConsole::on_lineEdit_returnPressed()
history.removeFirst();
// Set pointer to end of history
historyPtr = history.size();
// Scroll console view to end
scrollToEnd();
}
}
@ -315,3 +318,9 @@ void RPCConsole::on_openDebugLogfileButton_clicked()
{
GUIUtil::openDebugLogfile();
}
void RPCConsole::scrollToEnd()
{
QScrollBar *scrollbar = ui->messagesWidget->verticalScrollBar();
scrollbar->setValue(scrollbar->maximum());
}

View file

@ -44,7 +44,8 @@ public slots:
void setNumBlocks(int count);
/** Go forward or back in history */
void browseHistory(int offset);
/** Scroll console view to end */
void scrollToEnd();
signals:
// For RPC command executor
void stopExecutor();