#include "ui_MainWindow.h"
#include <QFileDialog>
+#include <QInputDialog>
#include <QMessageBox>
#include "config-feather.h"
connect(ui->actionLoadSignedTxFromText, &QAction::triggered, this, &MainWindow::loadSignedTxFromText);
connect(ui->actionImport_transaction, &QAction::triggered, this, &MainWindow::importTransaction);
connect(ui->actionPay_to_many, &QAction::triggered, this, &MainWindow::payToMany);
+ connect(ui->actionAddress_checker, &QAction::triggered, this, &MainWindow::showAddressChecker);
connect(ui->actionCalculator, &QAction::triggered, this, &MainWindow::showCalcWindow);
connect(ui->actionCreateDesktopEntry, &QAction::triggered, this, &MainWindow::onCreateDesktopEntry);
dialog.exec();
}
+void MainWindow::showAddressChecker() {
+ QString address = QInputDialog::getText(this, "Address Checker", "Address: ");
+ if (address.isEmpty()) {
+ return;
+ }
+
+ if (!WalletManager::addressValid(address, constants::networkType)) {
+ QMessageBox::warning(this, "Address Checker", "Invalid address.");
+ return;
+ }
+
+ SubaddressIndex index = m_ctx->wallet->subaddressIndex(address);
+ if (!index.isValid()) {
+ // TODO: probably mention lookahead here
+ QMessageBox::warning(this, "Address Checker", "This address does not belong to this wallet.");
+ return;
+ } else {
+ QMessageBox::information(this, "Address Checker", QString("This address belongs to Account #%1").arg(index.major));
+ }
+}
+
void MainWindow::showNodeExhaustedMessage() {
// Spawning dialogs inside a lambda can cause system freezes on linux so we have to do it this way ¯\_(ツ)_/¯
<x>0</x>
<y>0</y>
<width>977</width>
- <height>28</height>
+ <height>27</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<addaction name="actionImport_transaction"/>
<addaction name="separator"/>
<addaction name="actionPay_to_many"/>
+ <addaction name="actionAddress_checker"/>
<addaction name="actionCalculator"/>
<addaction name="actionCreateDesktopEntry"/>
</widget>
<string>Show Searchbar</string>
</property>
</action>
+ <action name="actionAddress_checker">
+ <property name="text">
+ <string>Address checker</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>