RPCConsole::RPCConsole(QWidget* parent) : QDialog(parent), ui(new Ui::RPCConsole), clientModel(0), historyPtr(0), cachedNodeid(-1) { ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); #ifndef Q_OS_MAC ui->openDebugLogfileButton->setIcon(QIcon(":/icons/export")); #endif // Install event filter for up and down arrow ui->lineEdit->installEventFilter(this); ui->messagesWidget->installEventFilter(this); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); connect(ui->btnClearTrafficGraph, SIGNAL(clicked()), ui->trafficGraph, SLOT(clear())); // Wallet Repair Buttons connect(ui->btn_salvagewallet, SIGNAL(clicked()), this, SLOT(walletSalvage())); connect(ui->btn_rescan, SIGNAL(clicked()), this, SLOT(walletRescan())); connect(ui->btn_zapwallettxes1, SIGNAL(clicked()), this, SLOT(walletZaptxes1())); connect(ui->btn_zapwallettxes2, SIGNAL(clicked()), this, SLOT(walletZaptxes2())); connect(ui->btn_upgradewallet, SIGNAL(clicked()), this, SLOT(walletUpgrade())); connect(ui->btn_reindex, SIGNAL(clicked()), this, SLOT(walletReindex())); // set library version labels ui->openSSLVersion->setText(SSLeay_version(SSLEAY_VERSION)); #ifdef ENABLE_WALLET ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0)); ui->wallet_path->setText(QString::fromStdString(GetDataDir().string() + QDir::separator().toLatin1() + GetArg("-wallet", "wallet.dat"))); #else ui->label_berkeleyDBVersion->hide(); ui->berkeleyDBVersion->hide(); #endif startExecutor(); setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); ui->peerHeading->setText(tr("Select a peer to view detailed information.")); clear(); }
RPCConsole::RPCConsole(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), ui(new Ui::RPCConsole), clientModel(0), historyPtr(0), cachedNodeid(-1), peersTableContextMenu(0), banTableContextMenu(0) { ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); #ifndef Q_OS_MAC ui->openDebugLogfileButton->setIcon(QIcon(":/icons/export")); #endif // Install event filter for up and down arrow ui->lineEdit->installEventFilter(this); ui->messagesWidget->installEventFilter(this); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); connect(ui->btnClearTrafficGraph, SIGNAL(clicked()), ui->trafficGraph, SLOT(clear())); // Wallet Repair Buttons connect(ui->btn_salvagewallet, SIGNAL(clicked()), this, SLOT(walletSalvage())); connect(ui->btn_rescan, SIGNAL(clicked()), this, SLOT(walletRescan())); connect(ui->btn_zapwallettxes1, SIGNAL(clicked()), this, SLOT(walletZaptxes1())); connect(ui->btn_zapwallettxes2, SIGNAL(clicked()), this, SLOT(walletZaptxes2())); connect(ui->btn_upgradewallet, SIGNAL(clicked()), this, SLOT(walletUpgrade())); connect(ui->btn_reindex, SIGNAL(clicked()), this, SLOT(walletReindex())); connect(ui->btn_resync, SIGNAL(clicked()), this, SLOT(walletResync())); // set library version labels ui->openSSLVersion->setText(SSLeay_version(SSLEAY_VERSION)); #ifdef ENABLE_WALLET std::string strPathCustom = GetArg("-backuppath", ""); std::string strxIONPathCustom = GetArg("-xionbackuppath", ""); int nCustomBackupThreshold = GetArg("-custombackupthreshold", DEFAULT_CUSTOMBACKUPTHRESHOLD); if(!strPathCustom.empty()) { ui->wallet_custombackuppath->setText(QString::fromStdString(strPathCustom)); ui->wallet_custombackuppath_label->show(); ui->wallet_custombackuppath->show(); } if(!strxIONPathCustom.empty()) { ui->wallet_customxionbackuppath->setText(QString::fromStdString(strxIONPathCustom)); ui->wallet_customxionbackuppath_label->setVisible(true); ui->wallet_customxionbackuppath->setVisible(true); } if((!strPathCustom.empty() || !strxIONPathCustom.empty()) && nCustomBackupThreshold > 0) { ui->wallet_custombackupthreshold->setText(QString::fromStdString(std::to_string(nCustomBackupThreshold))); ui->wallet_custombackupthreshold_label->setVisible(true); ui->wallet_custombackupthreshold->setVisible(true); } ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0)); ui->wallet_path->setText(QString::fromStdString(GetDataDir().string() + QDir::separator().toLatin1() + GetArg("-wallet", "wallet.dat"))); #else ui->label_berkeleyDBVersion->hide(); ui->berkeleyDBVersion->hide(); #endif // Register RPC timer interface rpcTimerInterface = new QtRPCTimerInterface(); // avoid accidentally overwriting an existing, non QTThread // based timer interface RPCSetTimerInterfaceIfUnset(rpcTimerInterface); startExecutor(); setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); ui->peerHeading->setText(tr("Select a peer to view detailed information.")); clear(); }