aboutsummaryrefslogtreecommitdiff
path: root/src/qt/rpcconsole.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-03-14 09:18:51 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2016-03-14 09:20:29 +0100
commit3798e5de334c3deb5f71302b782f6b8fbd5087f1 (patch)
tree460781f463b7b271c0ff4496d263431825867d51 /src/qt/rpcconsole.cpp
parent0fa88ef784dda77422fdb20b7358803f9b30a5c1 (diff)
parentce7413fcb7d28bd72e5ade7dc9756504de766fc2 (diff)
Merge #7613: Add autocomplete to bitcoin-qt's console window.
ce7413f Add autocomplete to bitcoin-qt's console window. (Luv Khemani)
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r--src/qt/rpcconsole.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 4e2530ffab..06fa85c34b 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -36,6 +36,7 @@
#include <QThread>
#include <QTime>
#include <QTimer>
+#include <QStringList>
#if QT_VERSION < 0x050000
#include <QUrl>
@@ -446,6 +447,18 @@ void RPCConsole::setClientModel(ClientModel *model)
ui->buildDate->setText(model->formatBuildDate());
ui->startupTime->setText(model->formatClientStartupTime());
ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));
+
+ //Setup autocomplete and attach it
+ QStringList wordList;
+ std::vector<std::string> commandList = tableRPC.listCommands();
+ for (size_t i = 0; i < commandList.size(); ++i)
+ {
+ wordList << commandList[i].c_str();
+ }
+
+ autoCompleter = new QCompleter(wordList, this);
+ ui->lineEdit->setCompleter(autoCompleter);
+
}
}