Changeset View
Changeset View
Standalone View
Standalone View
src/qt/rpcconsole.cpp
Show All 23 Lines | |||||
#include <univalue.h> | #include <univalue.h> | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
#include "wallet/wallet.h" | #include "wallet/wallet.h" | ||||
#include <db_cxx.h> | #include <db_cxx.h> | ||||
#endif | #endif | ||||
#include <QDesktopWidget> | |||||
#include <QKeyEvent> | #include <QKeyEvent> | ||||
#include <QMenu> | #include <QMenu> | ||||
#include <QMessageBox> | #include <QMessageBox> | ||||
#include <QScrollBar> | #include <QScrollBar> | ||||
#include <QSettings> | #include <QSettings> | ||||
#include <QSignalMapper> | #include <QSignalMapper> | ||||
#include <QStringList> | #include <QStringList> | ||||
#include <QThread> | #include <QThread> | ||||
▲ Show 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | void RPCExecutor::request(const QString &command) { | ||||
} | } | ||||
} | } | ||||
RPCConsole::RPCConsole(const PlatformStyle *_platformStyle, QWidget *parent) | RPCConsole::RPCConsole(const PlatformStyle *_platformStyle, QWidget *parent) | ||||
: QWidget(parent), ui(new Ui::RPCConsole), clientModel(0), historyPtr(0), | : QWidget(parent), ui(new Ui::RPCConsole), clientModel(0), historyPtr(0), | ||||
platformStyle(_platformStyle), peersTableContextMenu(0), | platformStyle(_platformStyle), peersTableContextMenu(0), | ||||
banTableContextMenu(0), consoleFontSize(0) { | banTableContextMenu(0), consoleFontSize(0) { | ||||
ui->setupUi(this); | ui->setupUi(this); | ||||
GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); | QSettings settings; | ||||
if (!restoreGeometry( | |||||
settings.value("RPCConsoleWindowGeometry").toByteArray())) { | |||||
// Restore failed (perhaps missing setting), center the window | |||||
move(QApplication::desktop()->availableGeometry().center() - | |||||
frameGeometry().center()); | |||||
} | |||||
ui->openDebugLogfileButton->setToolTip( | ui->openDebugLogfileButton->setToolTip( | ||||
ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); | ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); | ||||
if (platformStyle->getImagesOnButtons()) { | if (platformStyle->getImagesOnButtons()) { | ||||
ui->openDebugLogfileButton->setIcon( | ui->openDebugLogfileButton->setIcon( | ||||
platformStyle->SingleColorIcon(":/icons/export")); | platformStyle->SingleColorIcon(":/icons/export")); | ||||
} | } | ||||
Show All 27 Lines | #endif | ||||
// based timer interface | // based timer interface | ||||
RPCSetTimerInterfaceIfUnset(rpcTimerInterface); | RPCSetTimerInterfaceIfUnset(rpcTimerInterface); | ||||
setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); | setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); | ||||
ui->detailWidget->hide(); | ui->detailWidget->hide(); | ||||
ui->peerHeading->setText(tr("Select a peer to view detailed information.")); | ui->peerHeading->setText(tr("Select a peer to view detailed information.")); | ||||
QSettings settings; | |||||
consoleFontSize = | consoleFontSize = | ||||
settings.value(fontSizeSettingsKey, QFontInfo(QFont()).pointSize()) | settings.value(fontSizeSettingsKey, QFontInfo(QFont()).pointSize()) | ||||
.toInt(); | .toInt(); | ||||
clear(); | clear(); | ||||
} | } | ||||
RPCConsole::~RPCConsole() { | RPCConsole::~RPCConsole() { | ||||
GUIUtil::saveWindowGeometry("nRPCConsoleWindow", this); | QSettings settings; | ||||
settings.setValue("RPCConsoleWindowGeometry", saveGeometry()); | |||||
RPCUnsetTimerInterface(rpcTimerInterface); | RPCUnsetTimerInterface(rpcTimerInterface); | ||||
delete rpcTimerInterface; | delete rpcTimerInterface; | ||||
delete ui; | delete ui; | ||||
} | } | ||||
bool RPCConsole::eventFilter(QObject *obj, QEvent *event) { | bool RPCConsole::eventFilter(QObject *obj, QEvent *event) { | ||||
if (event->type() == QEvent::KeyPress) // Special key handling | if (event->type() == QEvent::KeyPress) // Special key handling | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 787 Lines • Show Last 20 Lines |