}
void CoinsWidget::freezeCoins(QStringList &pubkeys) {
- for (auto &pubkey : pubkeys) {
- m_wallet->coins()->freeze(pubkey);
- }
- m_wallet->coins()->refresh();
+ m_wallet->coins()->freeze(pubkeys);
m_wallet->updateBalance();
}
void CoinsWidget::thawCoins(QStringList &pubkeys) {
- for (auto &pubkey : pubkeys) {
- m_wallet->coins()->thaw(pubkey);
- }
- m_wallet->coins()->refresh();
+ m_wallet->coins()->thaw(pubkeys);
m_wallet->updateBalance();
}
void disallowSending();
private slots:
- void onDataPasted(const QString &data);
+ void onDataFromQR(const QString &data);
private:
void setupComboBox();
return m_rows.length();
}
-void Coins::freeze(QString &publicKey)
+void Coins::freeze(QStringList &publicKeys)
{
crypto::public_key pk;
- if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk))
- {
- qWarning() << "Invalid public key: " << publicKey;
- return;
- }
- try
- {
- m_wallet2->freeze(pk);
- refresh();
- }
- catch (const std::exception& e)
- {
- qWarning() << "freeze: " << e.what();
+ for (const auto& publicKey : publicKeys) {
+ if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk))
+ {
+ qWarning() << "Invalid public key: " << publicKey;
+ continue;
+ }
+
+ try
+ {
+ m_wallet2->freeze(pk);
+ }
+ catch (const std::exception& e)
+ {
+ qWarning() << "freeze: " << e.what();
+ }
}
- emit coinFrozen();
+ refresh();
}
-void Coins::thaw(QString &publicKey)
+void Coins::thaw(QStringList &publicKeys)
{
crypto::public_key pk;
- if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk))
- {
- qWarning() << "Invalid public key: " << publicKey;
- return;
- }
- try
- {
- m_wallet2->thaw(pk);
- refresh();
- }
- catch (const std::exception& e)
- {
- qWarning() << "thaw: " << e.what();
+ for (const auto& publicKey : publicKeys) {
+ if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk))
+ {
+ qWarning() << "Invalid public key: " << publicKey;
+ continue;
+ }
+
+ try
+ {
+ m_wallet2->thaw(pk);
+ }
+ catch (const std::exception& e)
+ {
+ qWarning() << "thaw: " << e.what();
+ }
}
- emit coinThawed();
+ refresh();
}
QVector<CoinsInfo*> Coins::coins_from_txid(const QString &txid)
CoinsInfo * coin(int index);
void refresh();
void refreshUnlocked();
- void freeze(QString &publicKey);
- void thaw(QString &publicKey);
+
+ void freeze(QStringList &publicKeys);
+ void thaw(QStringList &publicKeys);
+
QVector<CoinsInfo*> coins_from_txid(const QString &txid);
QVector<CoinsInfo*> coinsFromKeyImage(const QStringList &keyimages);
void setDescription(const QString &publicKey, quint32 accountIndex, const QString &description);
signals:
void refreshStarted() const;
void refreshFinished() const;
- void coinFrozen() const;
- void coinThawed() const;
void descriptionChanged() const;
private: