aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-05-14 11:05:04 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-14 11:05:04 -0700
commit7dc04f4091eab17252da5ef8e9d11d7d72447db1 (patch)
treead715850f7504893ffd2f16238bd4c3c31628a51 /src/qt
parenta6f18e4686d764a62905b8d8cd316dcbd40bb17d (diff)
parent5a060b8dc81c6268eb0272a4a0711f2c1ddad9e1 (diff)
downloadbitcoin-7dc04f4091eab17252da5ef8e9d11d7d72447db1.tar.xz
Merge pull request #1301 from laanwj/2012_05_rpcscrolltoend
RPC console: scroll to the end when user enters a command
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/rpcconsole.cpp9
-rw-r--r--src/qt/rpcconsole.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 33b09952b7..51051f72f0 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -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());
+}
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index 9c4fab497e..0a7b10f4a2 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -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();