mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
This commit is contained in:
parent
8dbdd24c8e
commit
b29bd9e070
272 changed files with 13378 additions and 9535 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#ifndef ORACLEWIZARD_H
|
||||
#define ORACLEWIZARD_H
|
||||
|
||||
#include <QWizard>
|
||||
#include <QFutureWatcher>
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
#include <QWizard>
|
||||
#include <utility>
|
||||
|
||||
class QCheckBox;
|
||||
|
|
@ -22,194 +22,203 @@ class QSettings;
|
|||
class OracleWizard : public QWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit OracleWizard(QWidget *parent = nullptr);
|
||||
void accept() override;
|
||||
void enableButtons();
|
||||
void disableButtons();
|
||||
void retranslateUi();
|
||||
void setTokensData(QByteArray _tokensData) { tokensData = std::move(_tokensData); }
|
||||
bool hasTokensData() { return !tokensData.isEmpty(); }
|
||||
bool saveTokensToFile(const QString & fileName);
|
||||
public:
|
||||
explicit OracleWizard(QWidget *parent = nullptr);
|
||||
void accept() override;
|
||||
void enableButtons();
|
||||
void disableButtons();
|
||||
void retranslateUi();
|
||||
void setTokensData(QByteArray _tokensData)
|
||||
{
|
||||
tokensData = std::move(_tokensData);
|
||||
}
|
||||
bool hasTokensData()
|
||||
{
|
||||
return !tokensData.isEmpty();
|
||||
}
|
||||
bool saveTokensToFile(const QString &fileName);
|
||||
|
||||
public:
|
||||
OracleImporter *importer;
|
||||
QSettings *settings;
|
||||
public:
|
||||
OracleImporter *importer;
|
||||
QSettings *settings;
|
||||
|
||||
private slots:
|
||||
void updateLanguage();
|
||||
private slots:
|
||||
void updateLanguage();
|
||||
|
||||
private:
|
||||
QByteArray tokensData;
|
||||
private:
|
||||
QByteArray tokensData;
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *event) override;
|
||||
protected:
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
|
||||
class OracleWizardPage : public QWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit OracleWizardPage(QWidget *parent = nullptr): QWizardPage(parent) {};
|
||||
virtual void retranslateUi() = 0;
|
||||
public:
|
||||
explicit OracleWizardPage(QWidget *parent = nullptr) : QWizardPage(parent){};
|
||||
virtual void retranslateUi() = 0;
|
||||
|
||||
protected:
|
||||
inline OracleWizard *wizard() { return (OracleWizard*) QWizardPage::wizard(); };
|
||||
protected:
|
||||
inline OracleWizard *wizard()
|
||||
{
|
||||
return (OracleWizard *)QWizardPage::wizard();
|
||||
};
|
||||
};
|
||||
|
||||
class IntroPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit IntroPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
public:
|
||||
explicit IntroPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
private:
|
||||
QStringList findQmFiles();
|
||||
QString languageName(const QString &qmFile);
|
||||
private:
|
||||
QStringList findQmFiles();
|
||||
QString languageName(const QString &qmFile);
|
||||
|
||||
private:
|
||||
QLabel *label, *languageLabel, *versionLabel;
|
||||
QComboBox *languageBox;
|
||||
private:
|
||||
QLabel *label, *languageLabel, *versionLabel;
|
||||
QComboBox *languageBox;
|
||||
|
||||
private slots:
|
||||
void languageBoxChanged(int index);
|
||||
private slots:
|
||||
void languageBoxChanged(int index);
|
||||
};
|
||||
|
||||
class LoadSetsPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LoadSetsPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LoadSetsPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void readSetsFromByteArray(QByteArray data);
|
||||
void downloadSetsFile(QUrl url);
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void readSetsFromByteArray(QByteArray data);
|
||||
void downloadSetsFile(QUrl url);
|
||||
|
||||
private:
|
||||
QRadioButton *urlRadioButton;
|
||||
QRadioButton *fileRadioButton;
|
||||
QLineEdit *urlLineEdit;
|
||||
QLineEdit *fileLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QPushButton *fileButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
private:
|
||||
QRadioButton *urlRadioButton;
|
||||
QRadioButton *fileRadioButton;
|
||||
QLineEdit *urlLineEdit;
|
||||
QLineEdit *fileLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QPushButton *fileButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
|
||||
QNetworkAccessManager *nam;
|
||||
QFutureWatcher<bool> watcher;
|
||||
QFuture<bool> future;
|
||||
QNetworkAccessManager *nam;
|
||||
QFutureWatcher<bool> watcher;
|
||||
QFuture<bool> future;
|
||||
|
||||
private slots:
|
||||
void actLoadSetsFile();
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgressSetsFile(qint64 received, qint64 total);
|
||||
void actDownloadFinishedSetsFile();
|
||||
void importFinished();
|
||||
void zipDownloadFailed(const QString &message);
|
||||
private slots:
|
||||
void actLoadSetsFile();
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgressSetsFile(qint64 received, qint64 total);
|
||||
void actDownloadFinishedSetsFile();
|
||||
void importFinished();
|
||||
void zipDownloadFailed(const QString &message);
|
||||
};
|
||||
|
||||
class SaveSetsPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SaveSetsPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
public:
|
||||
explicit SaveSetsPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
private:
|
||||
QTextEdit *messageLog;
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
private:
|
||||
QTextEdit *messageLog;
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
|
||||
protected:
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
bool validatePage() override;
|
||||
protected:
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
bool validatePage() override;
|
||||
|
||||
private slots:
|
||||
void updateTotalProgress(int cardsImported, int setIndex, const QString &setName);
|
||||
private slots:
|
||||
void updateTotalProgress(int cardsImported, int setIndex, const QString &setName);
|
||||
};
|
||||
|
||||
class LoadSpoilersPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LoadSpoilersPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
public:
|
||||
explicit LoadSpoilersPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
private:
|
||||
QLabel *urlLabel;
|
||||
QLineEdit *urlLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
QNetworkAccessManager *nam;
|
||||
private:
|
||||
QLabel *urlLabel;
|
||||
QLineEdit *urlLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
QNetworkAccessManager *nam;
|
||||
|
||||
private slots:
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgressSpoilersFile(qint64 received, qint64 total);
|
||||
void actDownloadFinishedSpoilersFile();
|
||||
private slots:
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgressSpoilersFile(qint64 received, qint64 total);
|
||||
void actDownloadFinishedSpoilersFile();
|
||||
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void downloadSpoilersFile(QUrl url);
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void downloadSpoilersFile(QUrl url);
|
||||
};
|
||||
|
||||
class SaveSpoilersPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SaveSpoilersPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
public:
|
||||
explicit SaveSpoilersPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
private:
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
private:
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
|
||||
protected:
|
||||
bool validatePage() override;
|
||||
protected:
|
||||
bool validatePage() override;
|
||||
};
|
||||
|
||||
class LoadTokensPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LoadTokensPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
public:
|
||||
explicit LoadTokensPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void downloadTokensFile(QUrl url);
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void downloadTokensFile(QUrl url);
|
||||
|
||||
private:
|
||||
QLabel *urlLabel;
|
||||
QLineEdit *urlLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
QNetworkAccessManager *nam;
|
||||
private:
|
||||
QLabel *urlLabel;
|
||||
QLineEdit *urlLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
QNetworkAccessManager *nam;
|
||||
|
||||
private slots:
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgressTokensFile(qint64 received, qint64 total);
|
||||
void actDownloadFinishedTokensFile();
|
||||
private slots:
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgressTokensFile(qint64 received, qint64 total);
|
||||
void actDownloadFinishedTokensFile();
|
||||
};
|
||||
|
||||
class SaveTokensPage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SaveTokensPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
public:
|
||||
explicit SaveTokensPage(QWidget *parent = nullptr);
|
||||
void retranslateUi() override;
|
||||
|
||||
private:
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
private:
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
|
||||
protected:
|
||||
bool validatePage() override;
|
||||
protected:
|
||||
bool validatePage() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue