Bitcoin Core  21.99.0
P2P Digital Currency
intro.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2019 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 {
30  Q_OBJECT
31 
32 public:
33  explicit Intro(QWidget *parent = nullptr,
34  int64_t blockchain_size_gb = 0, int64_t chain_state_size_gb = 0);
35  ~Intro();
36 
37  QString getDataDirectory();
38  void setDataDirectory(const QString &dataDir);
39 
50  static bool showIfNeeded(bool& did_show_intro, bool& prune);
51 
52 Q_SIGNALS:
53  void requestCheck();
54 
55 public Q_SLOTS:
56  void setStatus(int status, const QString &message, quint64 bytesAvailable);
57 
58 private Q_SLOTS:
59  void on_dataDirectory_textChanged(const QString &arg1);
63 
64 private:
65  Ui::Intro *ui;
66  QThread *thread;
67  QMutex mutex;
68  bool signalled;
69  QString pathToCheck;
70  const int64_t m_blockchain_size_gb;
71  const int64_t m_chain_state_size_gb;
73  int64_t m_required_space_gb{0};
74  uint64_t m_bytes_available{0};
75  const int64_t m_prune_target_gb;
76 
77  void startThread();
78  void checkPath(const QString &dataDir);
79  QString getPathToCheck();
80  void UpdatePruneLabels(bool prune_checked);
81  void UpdateFreeSpaceLabel();
82 
83  friend class FreespaceChecker;
84 };
85 
86 #endif // BITCOIN_QT_INTRO_H
Intro::on_dataDirCustom_clicked
void on_dataDirCustom_clicked()
Definition: intro.cpp:313
interfaces
Definition: dummywallet.cpp:10
Intro::m_chain_state_size_gb
const int64_t m_chain_state_size_gb
Definition: intro.h:71
Intro::~Intro
~Intro()
Definition: intro.cpp:157
Intro::getDataDirectory
QString getDataDirectory()
Definition: intro.cpp:165
Intro::m_bytes_available
uint64_t m_bytes_available
Definition: intro.h:74
Intro::Intro
Intro(QWidget *parent=nullptr, int64_t blockchain_size_gb=0, int64_t chain_state_size_gb=0)
Definition: intro.cpp:121
Intro::on_dataDirectory_textChanged
void on_dataDirectory_textChanged(const QString &arg1)
Definition: intro.cpp:294
Intro::setStatus
void setStatus(int status, const QString &message, quint64 bytesAvailable)
Definition: intro.cpp:251
Intro::on_dataDirDefault_clicked
void on_dataDirDefault_clicked()
Definition: intro.cpp:308
Intro::m_required_space_gb
int64_t m_required_space_gb
Total required space (in GB) depending on user choice (prune or not prune).
Definition: intro.h:73
Intro::UpdatePruneLabels
void UpdatePruneLabels(bool prune_checked)
Definition: intro.cpp:355
Intro::UpdateFreeSpaceLabel
void UpdateFreeSpaceLabel()
Definition: intro.cpp:279
Intro::m_blockchain_size_gb
const int64_t m_blockchain_size_gb
Definition: intro.h:70
Intro::signalled
bool signalled
Definition: intro.h:68
FreespaceChecker
Definition: intro.cpp:37
Intro::ui
Ui::Intro * ui
Definition: intro.h:65
Intro::on_ellipsisButton_clicked
void on_ellipsisButton_clicked()
Definition: intro.cpp:301
Intro::checkPath
void checkPath(const QString &dataDir)
Definition: intro.cpp:333
Ui
Definition: addressbookpage.h:14
Intro::m_prune_target_gb
const int64_t m_prune_target_gb
Definition: intro.h:75
Intro::pathToCheck
QString pathToCheck
Definition: intro.h:69
Intro::mutex
QMutex mutex
Definition: intro.h:67
Intro::thread
QThread * thread
Definition: intro.h:66
Intro::getPathToCheck
QString getPathToCheck()
Definition: intro.cpp:345
DEFAULT_CHOOSE_DATADIR
static const bool DEFAULT_CHOOSE_DATADIR
Definition: intro.h:12
Intro::startThread
void startThread()
Definition: intro.cpp:319
Intro::setDataDirectory
void setDataDirectory(const QString &dataDir)
Definition: intro.cpp:170
Intro
Introduction screen (pre-GUI startup).
Definition: intro.h:28
Intro::showIfNeeded
static bool showIfNeeded(bool &did_show_intro, bool &prune)
Determine data directory.
Definition: intro.cpp:185
Intro::requestCheck
void requestCheck()