88 lines
2.2 KiB
C++
88 lines
2.2 KiB
C++
/*
|
|
* This file is part of the Flowee project
|
|
* Copyright (C) 2011-2015 The Bitcoin Core developers
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef FLOWEE_QT_INTRO_H
|
|
#define FLOWEE_QT_INTRO_H
|
|
|
|
#include <QDialog>
|
|
#include <QMutex>
|
|
#include <QThread>
|
|
|
|
class FreespaceChecker;
|
|
|
|
namespace Ui {
|
|
class Intro;
|
|
}
|
|
|
|
/** 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.
|
|
*/
|
|
static void pickDataDirectory();
|
|
|
|
/**
|
|
* Determine default data directory for operating system.
|
|
*/
|
|
static QString getDefaultDataDirectory();
|
|
|
|
Q_SIGNALS:
|
|
void requestCheck();
|
|
void stopThread();
|
|
|
|
public Q_SLOTS:
|
|
void setStatus(int status, const QString &message, quint64 bytesAvailable);
|
|
|
|
private Q_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
|