2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2022-02-10 10:26:41 +00:00
|
|
|
// SPDX-FileCopyrightText: 2020-2022 The Monero Project
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-05-20 14:04:59 +00:00
|
|
|
#ifndef FEATHER_CALCWIDGET_H
|
|
|
|
#define FEATHER_CALCWIDGET_H
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-05-02 18:22:38 +00:00
|
|
|
#include <QWidget>
|
2021-05-26 13:14:53 +00:00
|
|
|
#include <QComboBox>
|
2022-02-23 22:27:20 +00:00
|
|
|
#include <QTimer>
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class CalcWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CalcWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit CalcWidget(QWidget *parent = nullptr);
|
2020-12-28 04:39:20 +00:00
|
|
|
~CalcWidget() override;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
public slots:
|
2021-02-03 19:40:35 +00:00
|
|
|
void skinChanged();
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-05-20 14:04:59 +00:00
|
|
|
private slots:
|
|
|
|
void initComboBox();
|
2021-05-26 13:14:53 +00:00
|
|
|
void showCalcConfigureDialog();
|
|
|
|
void onPricesReceived();
|
2021-05-20 14:04:59 +00:00
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
private:
|
2021-05-20 14:04:59 +00:00
|
|
|
void convert(bool reverse);
|
2021-05-26 13:14:53 +00:00
|
|
|
void setupComboBox(QComboBox *comboBox, const QStringList &crypto, const QStringList &fiat);
|
2022-02-23 22:27:20 +00:00
|
|
|
void updateStatus();
|
2021-05-02 18:22:38 +00:00
|
|
|
|
2021-06-27 12:13:05 +00:00
|
|
|
QScopedPointer<Ui::CalcWidget> ui;
|
2020-10-07 10:36:04 +00:00
|
|
|
bool m_comboBoxInit = false;
|
2022-02-23 22:27:20 +00:00
|
|
|
QTimer m_statusTimer;
|
2020-10-07 10:36:04 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 14:04:59 +00:00
|
|
|
#endif // FEATHER_CALCWIDGET_H
|