You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

intro.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Copyright (c) 2011-2013 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. #ifndef BITCOIN_QT_INTRO_H
  5. #define BITCOIN_QT_INTRO_H
  6. #include <QDialog>
  7. #include <QMutex>
  8. #include <QThread>
  9. static const bool DEFAULT_CHOOSE_DATADIR = false;
  10. class FreespaceChecker;
  11. namespace Ui {
  12. class Intro;
  13. }
  14. /** Introduction screen (pre-GUI startup).
  15. Allows the user to choose a data directory,
  16. in which the wallet and block chain will be stored.
  17. */
  18. class Intro : public QDialog
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit Intro(QWidget *parent = 0);
  23. ~Intro();
  24. QString getDataDirectory();
  25. void setDataDirectory(const QString &dataDir);
  26. /**
  27. * Determine data directory. Let the user choose if the current one doesn't exist.
  28. *
  29. * @note do NOT call global GetDataDir() before calling this function, this
  30. * will cause the wrong path to be cached.
  31. */
  32. static void pickDataDirectory();
  33. /**
  34. * Determine default data directory for operating system.
  35. */
  36. static QString getDefaultDataDirectory();
  37. Q_SIGNALS:
  38. void requestCheck();
  39. void stopThread();
  40. public Q_SLOTS:
  41. void setStatus(int status, const QString &message, quint64 bytesAvailable);
  42. private Q_SLOTS:
  43. void on_dataDirectory_textChanged(const QString &arg1);
  44. void on_ellipsisButton_clicked();
  45. void on_dataDirDefault_clicked();
  46. void on_dataDirCustom_clicked();
  47. private:
  48. Ui::Intro *ui;
  49. QThread *thread;
  50. QMutex mutex;
  51. bool signalled;
  52. QString pathToCheck;
  53. void startThread();
  54. void checkPath(const QString &dataDir);
  55. QString getPathToCheck();
  56. friend class FreespaceChecker;
  57. };
  58. #endif // BITCOIN_QT_INTRO_H