Compare commits

..

2 Commits

Author SHA1 Message Date
mrdeveloper 65772823af Export multisig methods to libwalletqt
4 years ago
mrdeveloper 9235db2520 Extend libwallet for multisig info
4 years ago

3
.gitmodules vendored

@ -7,6 +7,3 @@
[submodule "contrib/tor"]
path = contrib/tor
url = https://git.torproject.org/tor.git
[submodule "contrib/KDMacTouchBar"]
path = contrib/KDMacTouchBar
url = https://github.com/KDAB/KDMacTouchBar.git

@ -30,7 +30,7 @@ if(DEBUG)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
set(MONERO_HEAD "a6bf6dbb8f1637ccffee1a30d2285324a3ce4d66")
set(MONERO_HEAD "a39fd7ea978053929da63dcdb8073806573be5ba")
set(BUILD_GUI_DEPS ON)
set(ARCH "x86-64")
set(BUILD_64 ON)
@ -365,8 +365,4 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CXX_SECURITY_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}")
if(APPLE)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar")
endif()
add_subdirectory(src)

@ -1 +0,0 @@
Subproject commit 470c4316460bb8c3e23bfa37c79c8621ef3f1b4c

@ -1 +1 @@
Subproject commit a6bf6dbb8f1637ccffee1a30d2285324a3ce4d66
Subproject commit a39fd7ea978053929da63dcdb8073806573be5ba

@ -201,14 +201,6 @@ target_link_libraries(feather
${QRENCODE_LIBRARY}
)
if(APPLE)
target_link_libraries(feather
KDMacTouchBar
)
target_include_directories(feather
PUBLIC ../contrib/KDMacTouchBar)
endif()
if(NOT APPLE)
target_link_libraries(feather
Qt5::QSvgIconPlugin

@ -9,14 +9,12 @@
#include <QDesktopWidget>
#include "appcontext.h"
#include "globals.h"
#include "utils/tails.h"
#include "utils/whonix.h"
#include "utils/utils.h"
#include "utils/prices.h"
#include "utils/networktype.h"
#include "utils/wsclient.h"
#include "utils/config.h"
// libwalletqt
#include "libwalletqt/WalletManager.h"
@ -30,6 +28,7 @@
#include "model/SubaddressModel.h"
#include "utils/keysfiles.h"
#include "utils/networktype.h"
#include "utils/config.h"
Prices *AppContext::prices = nullptr;
@ -196,7 +195,7 @@ void AppContext::initWS() {
void AppContext::onCancelTransaction(PendingTransaction *tx, const QString &address) {
// tx cancelled by user
double amount = tx->amount() / globals::cdiv;
double amount = tx->amount() / AppContext::cdiv;
emit createTransactionCancelled(address, amount);
this->currentWallet->disposeTransaction(tx);
}
@ -235,8 +234,8 @@ void AppContext::onCreateTransaction(const QString &address, const double amount
return;
}
auto balance = this->currentWallet->balance() / globals::cdiv;
auto unlocked_balance = this->currentWallet->unlockedBalance() / globals::cdiv;
auto balance = this->currentWallet->balance() / AppContext::cdiv;
auto unlocked_balance = this->currentWallet->unlockedBalance() / AppContext::cdiv;
if(!all && amount > unlocked_balance) {
emit createTransactionError("Not enough money to spend");
return;
@ -245,7 +244,7 @@ void AppContext::onCreateTransaction(const QString &address, const double amount
return;
}
auto amount_num = static_cast<quint64>(amount * globals::cdiv);
auto amount_num = static_cast<quint64>(amount * AppContext::cdiv);
qDebug() << "creating tx";
if(all || amount == balance)
this->currentWallet->createTransactionAllAsync(address, "", this->tx_mixin, this->tx_priority);
@ -692,19 +691,19 @@ AppContext::~AppContext() {
// ############################################## LIBWALLET QT #########################################################
void AppContext::onMoneySpent(const QString &txId, quint64 amount) {
auto amount_num = amount / globals::cdiv;
auto amount_num = amount / AppContext::cdiv;
qDebug() << Q_FUNC_INFO << txId << " " << QString::number(amount_num);
}
void AppContext::onMoneyReceived(const QString &txId, quint64 amount) {
// Incoming tx included in a block.
auto amount_num = amount / globals::cdiv;
auto amount_num = amount / AppContext::cdiv;
qDebug() << Q_FUNC_INFO << txId << " " << QString::number(amount_num);
}
void AppContext::onUnconfirmedMoneyReceived(const QString &txId, quint64 amount) {
// Incoming transaction in pool
auto amount_num = amount / globals::cdiv;
auto amount_num = amount / AppContext::cdiv;
qDebug() << Q_FUNC_INFO << txId << " " << QString::number(amount_num);
if(this->currentWallet->synchronized()) {
@ -791,12 +790,12 @@ void AppContext::storeWallet() {
void AppContext::updateBalance() {
if(!this->currentWallet)
return;
throw std::runtime_error("this should not happen, ever");
AppContext::balance = this->currentWallet->balance() / globals::cdiv;
AppContext::balance = this->currentWallet->balance() / AppContext::cdiv;
auto balance_str = QString::number(balance, 'f');
double unlocked = this->currentWallet->unlockedBalance() / globals::cdiv;
double unlocked = this->currentWallet->unlockedBalance() / AppContext::cdiv;
auto unlocked_str = QString::number(unlocked, 'f');
emit balanceUpdated(balance, unlocked, balance_str, unlocked_str);

@ -69,6 +69,7 @@ public:
const unsigned int kdfRounds = 1;
PendingTransaction::Priority tx_priority = PendingTransaction::Priority::Priority_Low;
quint32 tx_mixin = static_cast<const quint32 &>(10);
static constexpr const double cdiv = 1e12;
QString seedLanguage = "English"; // 14 word `monero-seed` only has English
QNetworkAccessManager *network;

@ -42,14 +42,14 @@ CoinsWidget::CoinsWidget(QWidget *parent)
// context menu
ui->coins->setContextMenuPolicy(Qt::CustomContextMenu);
m_thawOutputAction = new QAction("Thaw output", this);
m_freezeOutputAction = new QAction("Freeze output", this);
m_thawOutputAction = new QAction("Thaw output");
m_freezeOutputAction = new QAction("Freeze output");
m_freezeAllSelectedAction = new QAction("Freeze selected", this);
m_thawAllSelectedAction = new QAction("Thaw selected", this);
m_freezeAllSelectedAction = new QAction("Freeze selected");
m_thawAllSelectedAction = new QAction("Thaw selected");
m_viewOutputAction = new QAction(QIcon(":/assets/images/info.png"), "Details", this);
m_sweepOutputAction = new QAction("Sweep output", this);
m_viewOutputAction = new QAction(QIcon(":/assets/images/info.png"), "Details");
m_sweepOutputAction = new QAction("Sweep output");
connect(m_freezeOutputAction, &QAction::triggered, this, &CoinsWidget::freezeOutput);
connect(m_thawOutputAction, &QAction::triggered, this, &CoinsWidget::thawOutput);
connect(m_viewOutputAction, &QAction::triggered, this, &CoinsWidget::viewOutput);
@ -65,7 +65,7 @@ CoinsWidget::CoinsWidget(QWidget *parent)
void CoinsWidget::setModel(CoinsModel * model, Coins * coins) {
m_coins = coins;
m_model = model;
m_proxyModel = new CoinsProxyModel(this);
m_proxyModel = new CoinsProxyModel;
m_proxyModel->setSourceModel(m_model);
ui->coins->setModel(m_proxyModel);
ui->coins->setColumnHidden(CoinsModel::Spent, true);
@ -207,7 +207,6 @@ void CoinsWidget::onSweepOutput() {
qCritical() << "key image: " << keyImage;
emit sweepOutput(keyImage, dialog->address(), dialog->churn(), dialog->outputs());
dialog->deleteLater();
}
void CoinsWidget::copy(copyField field) {

@ -8,7 +8,6 @@
#include "model/ModelUtils.h"
#include "libwalletqt/WalletManager.h"
#include "txconfadvdialog.h"
#include "globals.h"
#include <QMessageBox>
@ -32,15 +31,15 @@ TxConfDialog::TxConfDialog(AppContext *ctx, PendingTransaction *tx, const QStrin
};
QString amount = WalletManager::displayAmount(tx->amount());
QString amount_fiat = convert(tx->amount() / globals::cdiv);
QString amount_fiat = convert(tx->amount() / AppContext::cdiv);
ui->label_amount->setText(QString("%1 (%2 %3)").arg(amount, amount_fiat, preferredCur));
QString fee = WalletManager::displayAmount(tx->fee());
QString fee_fiat = convert(tx->fee() / globals::cdiv);
QString fee_fiat = convert(tx->fee() / AppContext::cdiv);
ui->label_fee->setText(QString("%1 (%2 %3)").arg(fee, fee_fiat, preferredCur));
QString total = WalletManager::displayAmount(tx->amount() + tx->fee());
QString total_fiat = convert((tx->amount() + tx->fee()) / globals::cdiv);
QString total_fiat = convert((tx->amount() + tx->fee()) / AppContext::cdiv);
ui->label_total->setText(QString("%1 (%2 %3)").arg(total, total_fiat, preferredCur));
ui->label_address->setText(ModelUtils::displayAddress(address, 2));

@ -1,14 +0,0 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#ifndef FEATHER_GLOBALS_H
#define FEATHER_GLOBALS_H
#include <QtGlobal>
namespace globals
{
const qreal cdiv = 1e12;
}
#endif //FEATHER_GLOBALS_H

@ -3,10 +3,6 @@
#include "Wallet.h"
#include <chrono>
#include <stdexcept>
#include <thread>
#include "PendingTransaction.h"
#include "UnsignedTransaction.h"
#include "TransactionHistory.h"
@ -32,8 +28,6 @@
#include <QVector>
#include <QMutexLocker>
#include "utils/ScopeGuard.h"
namespace {
static const int DAEMON_BLOCKCHAIN_HEIGHT_CACHE_TTL_SECONDS = 5;
static const int DAEMON_BLOCKCHAIN_TARGET_HEIGHT_CACHE_TTL_SECONDS = 30;
@ -107,20 +101,6 @@ bool Wallet::disconnected() const
return m_disconnected;
}
bool Wallet::refreshing() const
{
return m_refreshing;
}
void Wallet::refreshingSet(bool value)
{
if (m_refreshing.exchange(value) != value)
{
emit refreshingChanged();
}
}
void Wallet::setConnectionStatus(ConnectionStatus value)
{
if (m_connectionStatus == value)
@ -265,7 +245,7 @@ void Wallet::initAsync(
emit walletCreationHeightChanged();
qDebug() << "init async finished - starting refresh";
connected(true);
startRefresh();
m_walletImpl->startRefresh();
}
});
if (future.first)
@ -476,14 +456,56 @@ bool Wallet::importOutputs(const QString& path) {
return m_walletImpl->importOutputs(path.toStdString());
}
void Wallet::startRefresh()
bool Wallet::refresh()
{
m_refreshEnabled = true;
qDebug() << "refresh async";
m_walletImpl->refreshAsync();
}
void Wallet::pauseRefresh()
void Wallet::startRefresh() const
{
m_refreshEnabled = false;
m_walletImpl->startRefresh();
}
void Wallet::pauseRefresh() const
{
m_walletImpl->pauseRefresh();
}
QString Wallet::getMultisigInfo() {
return QString::fromStdString(m_walletImpl->getMultisigInfo());
}
QString Wallet::makeMultisig(QList<QString> &info, uint32_t threashold) {
std::vector<std::string> infos;
for(int i = 0; i < info.length(); i++) {
infos.push_back(info[i].toStdString());
}
QString multisig_info;
return multisig_info.fromStdString(m_walletImpl->makeMultisig(infos, threashold));
}
bool Wallet::finalizeMultisig(QList<QString> &multisigInfos) {
std::vector<std::string> infos;
for(int i = 0; i < multisigInfos.length(); i++) {
infos.push_back(multisigInfos[i].toStdString());
}
return m_walletImpl->finalizeMultisig(infos);
}
bool Wallet::exportMultisigImages(QString &image) {
std::string img = image.toStdString();
auto ret = m_walletImpl->exportMultisigImages(img);
image.fromStdString(img);
return ret;
}
void Wallet::importMultisigImages(QList<QString> &images) {
std::vector<std::string> imgs;
for(int i = 0; i < images.length(); i++) {
imgs.push_back(images[i].toStdString());
}
m_walletImpl->importMultisigImages(imgs);
}
PendingTransaction *Wallet::createTransaction(const QString &dst_addr, const QString &payment_id,
@ -594,29 +616,6 @@ bool Wallet::submitTxFile(const QString &fileName) const
return m_walletImpl->importKeyImages(fileName.toStdString() + "_keyImages");
}
bool Wallet::refresh(bool historyAndSubaddresses /* = true */)
{
refreshingSet(true);
const auto cleanup = sg::make_scope_guard([this]() noexcept {
refreshingSet(false);
});
{
QMutexLocker locker(&m_asyncMutex);
bool result = m_walletImpl->refresh();
if (historyAndSubaddresses)
{
m_history->refresh(currentSubaddressAccount());
m_subaddress->refresh(currentSubaddressAccount());
m_subaddressAccount->getAll();
}
if (result)
emit updated();
return result;
}
}
void Wallet::commitTransactionAsync(PendingTransaction *t)
{
m_scheduler.run([this, t] {
@ -1100,8 +1099,6 @@ Wallet::Wallet(Monero::Wallet *w, QObject *parent)
, m_subaddressAccount(nullptr)
, m_subaddressAccountModel(nullptr)
, m_coinsModel(nullptr)
, m_refreshEnabled(false)
, m_refreshing(false)
, m_scheduler(this)
{
m_history = new TransactionHistory(m_walletImpl->history(), this);
@ -1120,17 +1117,12 @@ Wallet::Wallet(Monero::Wallet *w, QObject *parent)
m_connectionStatusRunning = false;
m_daemonUsername = "";
m_daemonPassword = "";
startRefreshThread();
}
Wallet::~Wallet()
{
qDebug("~Wallet: Closing wallet");
pauseRefresh();
m_walletImpl->stop();
m_scheduler.shutdownWaitForFinished();
delete m_addressBook;
@ -1160,32 +1152,3 @@ Wallet::~Wallet()
m_walletListener = NULL;
qDebug("m_walletImpl deleted");
}
void Wallet::startRefreshThread()
{
const auto future = m_scheduler.run([this] {
constexpr const std::chrono::seconds refreshInterval{10};
constexpr const std::chrono::milliseconds intervalResolution{100};
auto last = std::chrono::steady_clock::now();
while (!m_scheduler.stopping())
{
if (m_refreshEnabled)
{
const auto now = std::chrono::steady_clock::now();
const auto elapsed = now - last;
if (elapsed >= refreshInterval)
{
refresh(false);
last = std::chrono::steady_clock::now();
}
}
std::this_thread::sleep_for(intervalResolution);
}
});
if (!future.first)
{
throw std::runtime_error("failed to start auto refresh thread");
}
}

@ -50,7 +50,6 @@ class Wallet : public QObject, public PassprasePrompter
{
Q_OBJECT
Q_PROPERTY(bool disconnected READ disconnected NOTIFY disconnectedChanged)
Q_PROPERTY(bool refreshing READ refreshing NOTIFY refreshingChanged)
Q_PROPERTY(QString seed READ getSeed)
Q_PROPERTY(QString seedLanguage READ getSeedLanguage)
Q_PROPERTY(Status status READ status)
@ -200,11 +199,18 @@ public:
Q_INVOKABLE bool importOutputs(const QString& path);
//! refreshes the wallet
Q_INVOKABLE bool refresh(bool historyAndSubaddresses = false);
Q_INVOKABLE bool refresh();
// pause/resume refresh
Q_INVOKABLE void startRefresh();
Q_INVOKABLE void pauseRefresh();
Q_INVOKABLE void startRefresh() const;
Q_INVOKABLE void pauseRefresh() const;
//! multisig wallet
Q_INVOKABLE QString getMultisigInfo();
Q_INVOKABLE QString makeMultisig(QList<QString> &info, uint32_t threashold);
Q_INVOKABLE bool finalizeMultisig(QList<QString> &multisigInfos);
Q_INVOKABLE bool exportMultisigImages(QString &image);
Q_INVOKABLE void importMultisigImages(QList<QString> &images);
//! returns current wallet's block height
//! (can be less than daemon's blockchain height when wallet sync in progress)
@ -412,7 +418,6 @@ signals:
void currentSubaddressAccountChanged() const;
void disconnectedChanged() const;
void proxyAddressChanged() const;
void refreshingChanged() const;
private:
Wallet(QObject * parent = nullptr);
@ -430,13 +435,9 @@ private:
const QString& proxyAddress);
bool disconnected() const;
bool refreshing() const;
void refreshingSet(bool value);
void setConnectionStatus(ConnectionStatus value);
QString getProxyAddress() const;
void setProxyAddress(QString address);
void startRefreshThread();
private:
friend class WalletManager;

@ -351,14 +351,6 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
// window title
connect(m_ctx, &AppContext::setTitle, this, &QMainWindow::setWindowTitle);
// init touchbar
#ifdef Q_OS_MAC
m_touchbar = new KDMacTouchBar(this);
m_touchbarActionWelcome = new QAction(QIcon(":/assets/images/feather.png"), "Welcome to Feather!");
m_touchbarWalletItems = {ui->actionSettings, ui->actionCalculator, ui->actionKeys, ui->actionDonate_to_Feather};
m_touchbarWizardItems = {m_touchbarActionWelcome};
#endif
// setup some UI
this->initMain();
this->initWidgets();
@ -390,7 +382,6 @@ void MainWindow::initMain() {
this->show();
m_wizard = this->createWizard(WalletWizard::Page_Menu);
m_wizard->show();
this->touchbarShowWizard();
}
void MainWindow::initMenu() {
@ -554,20 +545,6 @@ void MainWindow::onWalletClosed(WalletWizard::Page page) {
this->showWizard(page);
}
void MainWindow::touchbarShowWizard() {
#ifdef Q_OS_MAC
m_touchbar->clear();
for(auto* action: m_touchbarWizardItems) m_touchbar->addAction(action);
#endif
}
void MainWindow::touchbarShowWallet() {
#ifdef Q_OS_MAC
m_touchbar->clear();
for(auto* action: m_touchbarWalletItems) m_touchbar->addAction(action);
#endif
}
void MainWindow::onWalletCreatedError(const QString &err) {
Utils::showMessageBox("Wallet creation error", err, true);
this->showWizard(WalletWizard::Page_CreateWallet);
@ -594,7 +571,6 @@ void MainWindow::onWalletOpenedError(const QString &err) {
QMessageBox::warning(this, "Wallet open error", err);
this->setWindowTitle("Feather");
this->showWizard(WalletWizard::Page_OpenWallet);
this->touchbarShowWizard();
}
void MainWindow::onWalletCreated(Wallet *wallet) {
@ -654,24 +630,14 @@ void MainWindow::onWalletOpened() {
connect(m_ctx->currentWallet->coins(), &Coins::coinThawed, [this]{
m_ctx->storeWallet();
});
this->touchbarShowWallet();
}
void MainWindow::onBalanceUpdated(double balance, double unlocked, const QString &balance_str, const QString &unlocked_str) {
qDebug() << Q_FUNC_INFO;
bool hide = config()->get(Config::hideBalance).toBool();
auto label_str = QString("Balance: %1 XMR").arg(unlocked_str);
if(balance > unlocked)
label_str += QString(" (+%1 XMR unconfirmed)").arg(QString::number(balance - unlocked, 'f'));
if (hide) {
label_str = "Balance: HIDDEN";
}
m_statusLabelBalance->setText(label_str);
m_balanceWidget->setHidden(hide);
}
void MainWindow::onSynchronized() {

@ -4,10 +4,6 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#ifdef Q_OS_MAC
#include "src/kdmactouchbar.h"
#endif
#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QScreen>
@ -158,8 +154,6 @@ private:
void showNodeExhaustedMessage();
void showWSNodeExhaustedMessage();
void createUnsignedTxDialog(UnsignedTransaction *tx);
void touchbarShowWizard();
void touchbarShowWallet();
WalletWizard *createWizard(WalletWizard::Page startPage);
@ -198,12 +192,7 @@ private:
SubaddressProxyModel *subaddressProxyModel;
TransactionHistoryModel *txHistModel;
CoinsModel *coinsModel;
#ifdef Q_OS_MAC
QAction *m_touchbarActionWelcome;
KDMacTouchBar *m_touchbar;
QList<QAction *> m_touchbarWalletItems;
QList<QAction *> m_touchbarWizardItems;
#endif
QSignalMapper *m_tabShowHideSignalMapper;
QMap<QString, ToggleTab*> m_tabShowHideMapper;
WalletWizard *m_wizard = nullptr;

@ -6,7 +6,6 @@
#include "Coins.h"
#include <wallet/api/wallet2_api.h>
#include "ModelUtils.h"
#include "globals.h"
#include <QDebug>
#include <QHash>
@ -191,14 +190,10 @@ QVariant CoinsModel::parseTransactionInfo(const CoinsInfo &cInfo, int column, in
case SpentHeight:
return cInfo.spentHeight();
case Amount:
{
if (role == Qt::UserRole) {
return cInfo.amount() / globals::cdiv;
}
return QString::number(cInfo.amount() / globals::cdiv, 'f', 12);
}
return QString::number(cInfo.amount() / 1e12, 'f', 12);
case Frozen:
return cInfo.frozen();
default:
{
qCritical() << "Unimplemented role";

@ -7,7 +7,6 @@
CoinsProxyModel::CoinsProxyModel(QObject *parent)
: QSortFilterProxyModel(parent)
{
setSortRole(Qt::UserRole);
}
bool CoinsProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const

@ -4,7 +4,6 @@
#include "TransactionHistoryModel.h"
#include "TransactionHistory.h"
#include "TransactionInfo.h"
#include "globals.h"
#include <QDateTime>
#include <QDebug>
@ -152,7 +151,7 @@ QVariant TransactionHistoryModel::parseTransactionInfo(const TransactionInfo &tI
}
case Column::Amount:
{
QString amount = QString::number(tInfo.atomicAmount() / globals::cdiv, 'f', 4);
QString amount = QString::number(tInfo.atomicAmount() / 1e12, 'f', 4);
amount = (tInfo.direction() == TransactionInfo::Direction_Out && tInfo.amount() > 0) ? "-" + amount : "+" + amount;
return amount;
}

@ -74,7 +74,7 @@ void SendWidget::fillAddress(const QString &address) {
void SendWidget::sendClicked() {
double amount = 0.0;
QString currency = ui->comboCurrencySelection->currentText();
QString recipient = ui->lineAddress->text().simplified().remove(' ');
QString recipient = ui->lineAddress->text(); // @TODO: regex
QString description = ui->lineDescription->text();
if(recipient.isEmpty()) {
QMessageBox::warning(this, "Malformed recipient", "The recipient address was not correct");

@ -22,11 +22,6 @@ Settings::Settings(QWidget *parent) :
connect(ui->btnCopyToClipboard, &QPushButton::clicked, this, &Settings::copyToClipboard);
connect(ui->checkBox_checkForAppUpdates, &QCheckBox::clicked, this, &Settings::checkboxExternalLinkWarn);
connect(ui->checkBox_externalLink, &QCheckBox::clicked, this, &Settings::checkboxExternalLinkWarn);
connect(ui->checkBox_hideBalance, &QCheckBox::toggled, [this](bool toggled){
config()->set(Config::hideBalance, toggled);
m_ctx->updateBalance();
});
connect(ui->closeButton, &QDialogButtonBox::accepted, this, &Settings::close);
// nodes
@ -37,7 +32,6 @@ Settings::Settings(QWidget *parent) :
// setup checkboxes
ui->checkBox_externalLink->setChecked(config()->get(Config::warnOnExternalLink).toBool());
ui->checkBox_checkForAppUpdates->setChecked(config()->get(Config::checkForAppUpdates).toBool());
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
// setup comboboxes
auto settingsHomeWidget = config()->get(Config::homeWidget).toString();

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1019</width>
<height>396</height>
<height>358</height>
</rect>
</property>
<property name="windowTitle">
@ -175,11 +175,6 @@
<string>moneroblocks.info</string>
</property>
</item>
<item>
<property name="text">
<string>blockchair.com</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
@ -196,13 +191,6 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_hideBalance">
<property name="text">
<string>Hide balance</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_node">

@ -57,13 +57,13 @@ QWidget
outline: 0;
}
QWidget::item:hover
QWidget:item:hover
{
background-color: #3daee9;
color: #eff0f1;
}
QWidget::item:selected
QWidget:item:selected
{
background-color: #3daee9;
}
@ -525,7 +525,7 @@ QTextEdit
QPlainTextEdit
{
background-color: #232629;
background-color: #232629;;
color: #eff0f1;
border-radius: 0.2ex;
border: 0.1ex solid #76797c;

@ -54,13 +54,13 @@ QWidget
outline: 0;
}
QWidget::item:hover
QWidget:item:hover
{
background-color: #33A4DF;
color: #31363B;
}
QWidget::item:selected
QWidget:item:selected
{
background-color: #33A4DF;
}
@ -567,7 +567,7 @@ QMainWindow::separator:hover
color: white;
padding-left: 0.4ex;
border: 0.1ex solid #BAB9B8;
spacing: 0.2ex;
spacing: 0.2x;
}
QMenu::separator
@ -1659,14 +1659,12 @@ QPushButton:flat {
border: none;
}
QScrollBar::handle:vertical,
QScrollBar::handle:horizontal
QScrollBar::handle:vertical
{
background-color: #BAB9B8;
}
QScrollBar:vertical,
QScrollBar:horizontal
QScrollBar:vertical
{
background-color: #eff0f1;
border: 0.1ex transparent #eff0f1;

@ -47,7 +47,6 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::geometry, {QS("geometry"), {}}},
{Config::windowState, {QS("windowState"), {}}},
{Config::firstRun,{QS("firstRun"), false}},
{Config::hideBalance, {QS("hideBalance"), false}}
};

@ -44,8 +44,7 @@ public:
showTabXMRig,
geometry,
windowState,
firstRun,
hideBalance
firstRun
};
~Config() override;

@ -25,9 +25,6 @@ struct FeatherNode {
FeatherNode(QString _address, unsigned int height, bool online) : height(height), online(online){
// wonky ipv4/host parsing, should be fine(tm)(c).
if(_address.isEmpty()) return;
if(_address.contains("https://")) {
this->isHttps = true;
}
_address = _address.replace("https://", "");
_address = _address.replace("http://", "");
if(_address.contains("@")){ // authentication, user/pass
@ -59,7 +56,6 @@ struct FeatherNode {
bool tor = false;
bool isConnecting = false;
bool isActive = false;
bool isHttps = false;
QString generateFull() {
QString auth;
@ -69,7 +65,7 @@ struct FeatherNode {
}
QString as_url() {
return QString("%1://%2/get_info").arg(this->isHttps ? "https": "http",this->full);
return QString("http://%1/get_info").arg(this->full);
}
bool operator == (const FeatherNode &other) const {

@ -3,17 +3,9 @@
#include "scheduler.h"
#include <mutex>
#include <QThreadPool>
FutureScheduler::FutureScheduler(QObject *parent)
: QObject(parent), Alive(0), Stopping(false)
{
static std::once_flag once;
std::call_once(once, []() {
QThreadPool::globalInstance()->setMaxThreadCount(4);
});
}
FutureScheduler::~FutureScheduler()

@ -382,11 +382,6 @@ QString Utils::blockExplorerLink(const QString &blockExplorer, NetworkType::Type
return QString("https://moneroblocks.info/tx/%1").arg(txid);
}
}
else if (blockExplorer == "blockchair.com") {
if (nettype == NetworkType::MAINNET) {
return QString("https://blockchair.com/monero/transaction/%1").arg(txid);
}
}
switch (nettype) {
case NetworkType::MAINNET:

@ -7,7 +7,6 @@
#include "libwalletqt/Wallet.h"
#include "appcontext.h"
#include "globals.h"
#include "utils/xmrto.h"
XmrToOrder::XmrToOrder(AppContext *ctx, UtilsNetworking *network, QString baseUrl, bool clearnet, XmrToRates *rates, QObject *parent) :
@ -39,7 +38,7 @@ void XmrToOrder::onTransactionCancelled(const QString &address, double amount) {
void XmrToOrder::onTransactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid) {
// listener for all outgoing transactions - will try to match the exact amount to this order.
if(this->state == OrderState::Status_OrderUnpaid){
if(tx->amount() / globals::cdiv == this->incoming_amount_total) {
if(tx->amount() / AppContext::cdiv == this->incoming_amount_total) {
if(!status) {
this->errorMsg = "TX failed to commit";
this->changeState(OrderState::Status_OrderFailed);
@ -222,7 +221,7 @@ void XmrToOrder::changeState(OrderState _state) {
case OrderState::Status_OrderUnpaid:
// need to send Monero
if(!m_paymentRequested) {
auto unlocked_balance = m_ctx->currentWallet->unlockedBalance() / globals::cdiv;
auto unlocked_balance = m_ctx->currentWallet->unlockedBalance() / AppContext::cdiv;
if (this->incoming_amount_total >= unlocked_balance) {
this->state = OrderState::Status_OrderFailed;
emit orderFailed(this);

@ -8,9 +8,9 @@
#include <QDesktopServices>
#include "ccswidget.h"
#include "ui_ccswidget.h"
#include "ui_csswidget.h"
#include "utils/utils.h"
#include "ccsprogressdelegate.h"
#include "cssprogressdelegate.h"
CCSWidget::CCSWidget(QWidget *parent) :
QWidget(parent),

@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#include "ccsprogressdelegate.h"
#include "cssprogressdelegate.h"
#include <QApplication>

@ -59,7 +59,7 @@
<bool>false</bool>
</property>
<property name="text">
<string>Powered by ccs.getmonero.org</string>
<string>Powered by css.getmonero.org</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>

@ -178,11 +178,6 @@ void XMRigWidget::onStartClicked() {
else
address = config()->get(Config::xmrigPool).toString();
if(address.contains("cryptonote.social") && !username.contains(".")) {
// cryptonote social requires <addr>.<username>, we'll just grab a few chars from primary addy
username = QString("%1.%2").arg(username, m_ctx->currentWallet->address(0, 0).mid(0, 6));
}
m_ctx->XMRig->start(xmrigPath, m_threads, address, username, password, ui->relayTor->isChecked(), ui->check_tls->isChecked());
ui->btn_start->setEnabled(false);
ui->btn_stop->setEnabled(true);

@ -57,7 +57,7 @@ private:
QMenu *m_contextMenu;
unsigned int m_threads;
QStringList m_urls;
QStringList m_pools{"pool.xmr.pt:9000", "pool.supportxmr.com:9000", "mine.xmrpool.net:443", "xmrpool.eu:9999", "xmr-eu1.nanopool.org:14433", "pool.minexmr.com:6666", "us-west.minexmr.com:6666", "monerohash.com:9999", "cryptonote.social:5555", "cryptonote.social:5556"};
QStringList m_pools{"pool.xmr.pt:9000", "pool.supportxmr.com:9000", "mine.xmrpool.net:443", "xmrpool.eu:9999", "xmr-eu1.nanopool.org:14433", "pool.minexmr.com:6666", "us-west.minexmr.com:6666", "monerohash.com:9999"};
};
#endif // REDDITWIDGET_H

@ -30,6 +30,8 @@ int MenuPage::nextId() const {
return WalletWizard::Page_Restore;
if(ui->radioViewOnly->isChecked())
return WalletWizard::Page_ViewOnly;
if(ui->radioCreateMultisig->isChecked())
return WalletWizard::Page_CreateMultisigWallet;
return 0;
}

@ -34,6 +34,13 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioCreateMultisig">
<property name="text">
<string>Create new multisig wallet</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioOpen">
<property name="text">

@ -66,10 +66,6 @@ int OpenWalletPage::nextId() const {
bool OpenWalletPage::validatePage() {
QModelIndex index = ui->walletTable->currentIndex();
if(!index.isValid()) {
Utils::showMessageBox("Wallet not selected", "Please select a wallet from the list.", true);
return false;
}
QString walletPath = index.model()->data(index.siblingAtColumn(WalletKeysFilesModel::ModelColumns::Path), Qt::UserRole).toString();
auto autoWallet = ui->openOnStartup->isChecked() ? QString("%1%2").arg(m_ctx->networkType).arg(walletPath) : "";

@ -17,7 +17,7 @@ class WalletWizard : public QWizard
Q_OBJECT
public:
enum Page { Page_Menu, Page_CreateWallet, Page_CreateWalletSeed, Page_OpenWallet, Page_Network, Page_Restore, Page_ViewOnly };
enum Page { Page_Menu, Page_CreateWallet, Page_CreateWalletSeed, Page_OpenWallet, Page_Network, Page_Restore, Page_ViewOnly, Page_CreateMultisigWallet };
explicit WalletWizard(AppContext *ctx, WalletWizard::Page startPage = WalletWizard::Page::Page_Menu, QWidget *parent = nullptr);
signals:

Loading…
Cancel
Save