2013-11-04 16:20:43 +01:00
|
|
|
// Copyright (c) 2011-2013 The Bitcoin developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2013-05-19 17:36:01 +02:00
|
|
|
#ifndef INTRO_H
|
|
|
|
#define INTRO_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QMutex>
|
2013-04-13 07:13:08 +02:00
|
|
|
#include <QThread>
|
|
|
|
|
|
|
|
class FreespaceChecker;
|
2013-05-19 17:36:01 +02:00
|
|
|
|
|
|
|
namespace Ui {
|
2014-09-05 13:18:35 +02:00
|
|
|
class Intro;
|
2013-05-19 17:36:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Introduction screen (pre-GUI startup).
|
|
|
|
Allows the user to choose a data directory,
|
|
|
|
in which the wallet and block chain will be stored.
|
|
|
|
*/
|
|
|
|
class Intro : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Intro(QWidget *parent = 0);
|
|
|
|
~Intro();
|
|
|
|
|
|
|
|
QString getDataDirectory();
|
|
|
|
void setDataDirectory(const QString &dataDir);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine data directory. Let the user choose if the current one doesn't exist.
|
|
|
|
*
|
|
|
|
* @note do NOT call global GetDataDir() before calling this function, this
|
|
|
|
* will cause the wrong path to be cached.
|
|
|
|
*/
|
2014-03-11 08:32:07 +01:00
|
|
|
static void pickDataDirectory();
|
2013-05-19 17:36:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine default data directory for operating system.
|
|
|
|
*/
|
|
|
|
static QString getDefaultDataDirectory();
|
2013-07-23 12:00:41 +02:00
|
|
|
|
2013-05-19 17:36:01 +02:00
|
|
|
signals:
|
|
|
|
void requestCheck();
|
|
|
|
void stopThread();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setStatus(int status, const QString &message, quint64 bytesAvailable);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_dataDirectory_textChanged(const QString &arg1);
|
|
|
|
void on_ellipsisButton_clicked();
|
|
|
|
void on_dataDirDefault_clicked();
|
|
|
|
void on_dataDirCustom_clicked();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::Intro *ui;
|
|
|
|
QThread *thread;
|
|
|
|
QMutex mutex;
|
|
|
|
bool signalled;
|
|
|
|
QString pathToCheck;
|
|
|
|
|
|
|
|
void startThread();
|
|
|
|
void checkPath(const QString &dataDir);
|
|
|
|
QString getPathToCheck();
|
|
|
|
|
|
|
|
friend class FreespaceChecker;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INTRO_H
|