Bitcoin ABC  0.22.13
P2P Digital Currency
intro.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_INTRO_H
6 #define BITCOIN_QT_INTRO_H
7 
8 #include <QDialog>
9 #include <QMutex>
10 #include <QThread>
11 
12 static const bool DEFAULT_CHOOSE_DATADIR = false;
13 
14 class FreespaceChecker;
15 
16 namespace interfaces {
17 class Node;
18 }
19 
20 namespace Ui {
21 class Intro;
22 }
23 
28 class Intro : public QDialog {
29  Q_OBJECT
30 
31 public:
32  explicit Intro(QWidget *parent = nullptr, int64_t blockchain_size_gb = 0,
33  int64_t chain_state_size_gb = 0);
34  ~Intro();
35 
36  QString getDataDirectory();
37  void setDataDirectory(const QString &dataDir);
38 
51  static bool showIfNeeded(bool &did_show_intro, bool &prune);
52 
53 Q_SIGNALS:
54  void requestCheck();
55 
56 public Q_SLOTS:
57  void setStatus(int status, const QString &message, quint64 bytesAvailable);
58 
59 private Q_SLOTS:
60  void on_dataDirectory_textChanged(const QString &arg1);
61  void on_ellipsisButton_clicked();
62  void on_dataDirDefault_clicked();
63  void on_dataDirCustom_clicked();
64 
65 private:
66  Ui::Intro *ui;
67  QThread *thread;
68  QMutex mutex;
69  bool signalled;
70  QString pathToCheck;
71  const int64_t m_blockchain_size_gb;
72  const int64_t m_chain_state_size_gb;
75  int64_t m_required_space_gb{0};
76  uint64_t m_bytes_available{0};
77  const int64_t m_prune_target_gb;
78 
79  void startThread();
80  void checkPath(const QString &dataDir);
81  QString getPathToCheck();
82  void UpdatePruneLabels(bool prune_checked);
83  void UpdateFreeSpaceLabel();
84 
85  friend class FreespaceChecker;
86 };
87 
88 #endif // BITCOIN_QT_INTRO_H
static const bool DEFAULT_CHOOSE_DATADIR
Definition: intro.h:12
bool signalled
Definition: intro.h:69
const int64_t m_blockchain_size_gb
Definition: intro.h:71
Ui::Intro * ui
Definition: intro.h:66
const int64_t m_chain_state_size_gb
Definition: intro.h:72
const int64_t m_prune_target_gb
Definition: intro.h:77
QMutex mutex
Definition: intro.h:68
QThread * thread
Definition: intro.h:67
QString pathToCheck
Definition: intro.h:70
Introduction screen (pre-GUI startup).
Definition: intro.h:28