Files
SilentDragonXLite/src/mainwindow.h
earthorbit e7b08612fa Themeability (#186)
* add css (qss)

* Include css

* Merge pull request #6 from Fair-Exchange/css

Css

* fix

* beta blue

* fix

* YellowFevers UI work

* Merge pull request #7 from Fair-Exchange/css

Css - YellowFevers UI work

* Update mainwindow.cpp

* Update mainwindow.ui

* Merge pull request #6 from OleksandrBlack/css

move Tx list to balance tab

* Ease of use

General usability improvements

* Delete main.css

* style for tab

* Merge pull request #7 from YellowFeveRs/UI-work

General UI improvements

* updated tab styling

* Merge pull request #8 from Fair-Exchange/css

Css

* fix

* fix for Windows

* fix for Windows

* fix

* Merge pull request #10 from Fair-Exchange/master

Merge pull request #4 from OleksandrBlack/master

* Merge pull request #10 from Fair-Exchange/master

Merge pull request #4 from OleksandrBlack/master

* Merge pull request #11 from OleksandrBlack/css

Css

* Merge pull request #12 from OleksandrBlack/style

blue prepare

* revert

* Update zec_qt_wallet_zh.ts

* Update zec_qt_wallet_es.ts

* Update zec_qt_wallet_fr.ts

* Update zec_qt_wallet_it.ts

* Update zec_qt_wallet_pt.ts

* Update json.hpp

* Update json.hpp

* Update about.ui

* Update mainwindow.ui

* Update connection.ui

* Update connection.cpp

* Update connection.cpp

* Update application.qrc

* Update mainwindow.cpp

* Update settings.ui
2019-09-27 10:27:15 -07:00

156 lines
3.7 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "precompiled.h"
#include "logger.h"
#include "recurring.h"
// Forward declare to break circular dependency.
class RPC;
class Settings;
class WSServer;
class WormholeClient;
using json = nlohmann::json;
// Struct used to hold destination info when sending a Tx.
struct ToFields {
QString addr;
double amount;
QString txtMemo;
QString encodedMemo;
};
// Struct used to represent a Transaction.
struct Tx {
QString fromAddr;
QList<ToFields> toAddrs;
double fee;
};
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
void updateLabelsAutoComplete();
RPC* getRPC() { return rpc; }
QCompleter* getLabelCompleter() { return labelCompleter; }
QRegExpValidator* getAmountValidator() { return amtValidator; }
QString doSendTxValidations(Tx tx);
void setDefaultPayFrom();
void replaceWormholeClient(WormholeClient* newClient);
bool isWebsocketListening();
void createWebsocket(QString wormholecode);
void stopWebsocket();
void balancesReady();
void payZcashURI(QString uri = "", QString myAddr = "");
void validateAddress();
void updateLabels();
void updateTAddrCombo(bool checked);
void updateFromCombo();
// Disable recurring on mainnet
void disableRecurring();
// Check whether the RPC is returned and payments are ready to be made
bool isPaymentsReady() { return uiPaymentsReady; }
Ui::MainWindow* ui;
QLabel* statusLabel;
QLabel* statusIcon;
QLabel* loadingLabel;
QWidget* zcashdtab;
Logger* logger;
void doClose();
public slots:
void slot_change_theme(const QString& themeName);
private:
void closeEvent(QCloseEvent* event);
void setupSendTab();
void setupTransactionsTab();
void setupReceiveTab();
void setupBalancesTab();
void setupZcashdTab();
void setupTurnstileDialog();
void setupSettingsModal();
void setupStatusBar();
void clearSendForm();
Tx createTxFromSendPage();
bool confirmTx(Tx tx, RecurringPaymentInfo* rpi);
void turnstileDoMigration(QString fromAddr = "");
void turnstileProgress();
void cancelButton();
void sendButton();
void inputComboTextChanged(int index);
void addAddressSection();
void maxAmountChecked(int checked);
void editSchedule();
void addressChanged(int number, const QString& text);
void amountChanged (int number, const QString& text);
void addNewZaddr(bool sapling);
std::function<void(bool)> addZAddrsToComboList(bool sapling);
void memoButtonClicked(int number, bool includeReplyTo = false);
void setMemoEnabled(int number, bool enabled);
void donate();
void addressBook();
void postToZBoard();
void importPrivKey();
void exportAllKeys();
void exportKeys(QString addr = "");
void backupWalletDat();
void exportTransactions();
void doImport(QList<QString>* keys);
void restoreSavedStates();
bool eventFilter(QObject *object, QEvent *event);
bool uiPaymentsReady = false;
QString pendingURIPayment;
WSServer* wsserver = nullptr;
WormholeClient* wormhole = nullptr;
RPC* rpc = nullptr;
QCompleter* labelCompleter = nullptr;
QRegExpValidator* amtValidator = nullptr;
QRegExpValidator* feesValidator = nullptr;
RecurringPaymentInfo* sendTxRecurringInfo = nullptr;
QMovie* loadingMovie;
};
#endif // MAINWINDOW_H