Commit 5a886fd7 authored by cryptonotefoundation's avatar cryptonotefoundation

Improve CryptoNoteCoin settings usage

parent 585825c7
......@@ -29,5 +29,5 @@ Replace URL with git remote repository of your coin.
**4. Build**
```
mkdir build && cmake .. && make
mkdir build && cd build && cmake .. && make
```
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QCoreApplication>
#include <common/util.h>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QCommandLineParser>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "CryptoNote.h"
#include "cryptonote_core/cryptonote_basic_impl.h"
#include "cryptonote_core/cryptonote_format_utils.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <functional>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "CurrencyAdapter.h"
#include "CryptoNoteWalletConfig.h"
......@@ -39,6 +38,10 @@ QString CurrencyAdapter::getCurrencyTicker() const {
return WALLET_CURRENCY_TICKER;
}
quint64 CurrencyAdapter::getMinimumFee() const {
return m_currency.minimumFee();
}
QString CurrencyAdapter::formatAmount(quint64 _amount) const {
QString result = QString::number(_amount);
if (result.length() < getNumberOfDecimalPlaces() + 1) {
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QString>
......@@ -20,6 +19,7 @@ public:
QString getCurrencyDisplayName() const;
QString getCurrencyName() const;
QString getCurrencyTicker() const;
quint64 getMinimumFee() const;
quintptr getNumberOfDecimalPlaces() const;
QString formatAmount(quint64 _amount) const;
quint64 parseAmount(const QString& _amountString) const;
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QCoreApplication>
#include <QDateTime>
#include <QDir>
......@@ -111,8 +110,7 @@ CryptoNote::IWallet* NodeAdapter::createWallet() const {
bool NodeAdapter::init() {
Q_ASSERT(m_node == nullptr);
// TODO Insert the right URL for the local daemon
QUrl localNodeUrl = QUrl::fromUserInput("");
QUrl localNodeUrl = QUrl::fromUserInput(QString("127.0.0.1:%1").arg(cryptonote::RPC_DEFAULT_PORT));
m_node = createRpcNode(CurrencyAdapter::instance().getCurrency(), *this, localNodeUrl.host().toStdString(), localNodeUrl.port());
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QObject>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QApplication>
#include <QFile>
#include <QJsonDocument>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDir>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <csignal>
#include "SignalHandler.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QObject>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QCoreApplication>
#include <QDateTime>
#include <QLocale>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QMutex>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "AboutDialog.h"
#include "CurrencyAdapter.h"
#include "Settings.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "AddressBookDialog.h"
#include "AddressBookModel.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QApplication>
#include <QClipboard>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QFrame>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QAbstractItemModel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "AnimatedLabel.h"
namespace WalletGui {
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QLabel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "ChangePasswordDialog.h"
#include "ui_changepassworddialog.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QMovie>
#include "CurrencyAdapter.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QWidget>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QCloseEvent>
#include <QFileDialog>
#include <QInputDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QLabel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#import <objc/runtime.h>
#import <Cocoa/Cocoa.h>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "NewAddressDialog.h"
#include "ui_newaddressdialog.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "NewPasswordDialog.h"
#include "ui_newpassworddialog.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "CurrencyAdapter.h"
#include "OverviewFrame.h"
#include "TransactionFrame.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QFrame>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "PasswordDialog.h"
#include "ui_passworddialog.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QClipboard>
#include "ReceiveFrame.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QFrame>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "RecentTransactionsModel.h"
#include "SortedTransactionsModel.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QSortFilterProxyModel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "AddressBookModel.h"
#include "CurrencyAdapter.h"
#include "MainWindow.h"
......@@ -16,8 +15,6 @@
namespace WalletGui {
const quint64 MINIMAL_FEE = 1000000;
SendFrame::SendFrame(QWidget* _parent) : QFrame(_parent), m_ui(new Ui::SendFrame) {
m_ui->setupUi(this);
clearAllClicked();
......@@ -85,12 +82,7 @@ void SendFrame::sendClicked() {
}
}
quint64 fee = MINIMAL_FEE;
if (fee < MINIMAL_FEE) {
QCoreApplication::postEvent(&MainWindow::instance(), new ShowMessageEvent(tr("Minimum allowed fee is 0.01"), QtCriticalMsg));
return;
}
quint64 fee = CurrencyAdapter::instance().getMinimumFee();
if (WalletAdapter::instance().isOpen()) {
WalletAdapter::instance().sendTransaction(walletTransfers, fee, m_ui->m_paymentIdEdit->text(), m_ui->m_mixinSlider->value());
}
......@@ -100,11 +92,15 @@ void SendFrame::mixinValueChanged(int _value) {
m_ui->m_mixinEdit->setText(QString::number(_value));
}
void SendFrame::sendTransactionCompleted(CryptoNote::TransactionId _id, bool _result, const QString& _errorText) {
void SendFrame::sendTransactionCompleted(CryptoNote::TransactionId _id, bool _error, const QString& _errorText) {
Q_UNUSED(_id);
Q_UNUSED(_result);
Q_UNUSED(_errorText);
clearAllClicked();
if (_error) {
QCoreApplication::postEvent(
&MainWindow::instance(),
new ShowMessageEvent(_errorText, QtCriticalMsg));
} else {
clearAllClicked();
}
}
void SendFrame::walletActualBalanceUpdated(quint64 _balance) {
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QFrame>
......@@ -29,7 +28,7 @@ private:
QScopedPointer<Ui::SendFrame> m_ui;
QList<TransferFrame*> m_transfers;
void sendTransactionCompleted(CryptoNote::TransactionId _id, bool _result, const QString& _error_text);
void sendTransactionCompleted(CryptoNote::TransactionId _id, bool _error, const QString& _error_text);
void walletActualBalanceUpdated(quint64 _balance);
Q_SLOT void addRecipientClicked();
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QDateTime>
#include "SortedTransactionsModel.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QSortFilterProxyModel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QDateTime>
#include "CurrencyAdapter.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDialog>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QFontDatabase>
#include "MainWindow.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QDataWidgetMapper>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QFileDialog>
#include <QLabel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QFrame>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "SortedTransactionsModel.h"
#include "TransactionsListModel.h"
#include "TransactionsModel.h"
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QSortFilterProxyModel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QDateTime>
#include <QFont>
#include <QMetaEnum>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QAbstractItemModel>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QApplication>
#include <QClipboard>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QFrame>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <QEvent>
......
......@@ -72,34 +72,35 @@
<property name="topMargin">
<number>5</number>
</property>
<item row="1" column="1">
<widget class="QSlider" name="m_mixinSlider">
<item row="1" column="2">
<widget class="QLineEdit" name="m_mixinEdit">
<property name="maximumSize">
<size>
<width>200</width>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>2</number>
<property name="text">
<string notr="true"/>
</property>
<property name="tracking">
<bool>false</bool>
<property name="maxLength">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="tickInterval">
<number>1</number>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLineEdit" name="m_paymentIdEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Anonimity level:</string>
</property>
</widget>
</item>
......@@ -126,35 +127,34 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="m_mixinEdit">
<item row="1" column="1">
<widget class="QSlider" name="m_mixinSlider">
<property name="maximumSize">
<size>
<width>30</width>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string notr="true"/>
<property name="maximum">
<number>10</number>
</property>
<property name="maxLength">
<number>5</number>
<property name="pageStep">
<number>1</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="value">
<number>1</number>
</property>
<property name="readOnly">
<bool>true</bool>
<property name="tracking">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLineEdit" name="m_paymentIdEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Anonimity level:</string>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
......
......@@ -2,7 +2,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QApplication>
#include <QCommandLineParser>
#include <QLocale>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment