Replaces numbered place marker %2 with %1.
[bitcoinplatinum.git] / src / qt / intro.h
blob5b428b379c4949abfa9c6e308d44803a9ed25ed7
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.
5 #ifndef BITCOIN_QT_INTRO_H
6 #define BITCOIN_QT_INTRO_H
8 #include <QDialog>
9 #include <QMutex>
10 #include <QThread>
12 static const bool DEFAULT_CHOOSE_DATADIR = false;
14 class FreespaceChecker;
16 namespace Ui {
17 class Intro;
20 /** Introduction screen (pre-GUI startup).
21 Allows the user to choose a data directory,
22 in which the wallet and block chain will be stored.
24 class Intro : public QDialog
26 Q_OBJECT
28 public:
29 explicit Intro(QWidget *parent = 0);
30 ~Intro();
32 QString getDataDirectory();
33 void setDataDirectory(const QString &dataDir);
35 /**
36 * Determine data directory. Let the user choose if the current one doesn't exist.
38 * @returns true if a data directory was selected, false if the user cancelled the selection
39 * dialog.
41 * @note do NOT call global GetDataDir() before calling this function, this
42 * will cause the wrong path to be cached.
44 static bool pickDataDirectory();
46 /**
47 * Determine default data directory for operating system.
49 static QString getDefaultDataDirectory();
51 Q_SIGNALS:
52 void requestCheck();
53 void stopThread();
55 public Q_SLOTS:
56 void setStatus(int status, const QString &message, quint64 bytesAvailable);
58 private Q_SLOTS:
59 void on_dataDirectory_textChanged(const QString &arg1);
60 void on_ellipsisButton_clicked();
61 void on_dataDirDefault_clicked();
62 void on_dataDirCustom_clicked();
64 private:
65 Ui::Intro *ui;
66 QThread *thread;
67 QMutex mutex;
68 bool signalled;
69 QString pathToCheck;
71 void startThread();
72 void checkPath(const QString &dataDir);
73 QString getPathToCheck();
75 friend class FreespaceChecker;
78 #endif // BITCOIN_QT_INTRO_H