mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -07:00
Misc startup improvement (#3740)
* Misc startup improvement * fix paths * clangiftw * reworked save sets dialog * Unified load and save steps for tokens and spoilers; added "finished" page * linting1 * linting2 * wording * undo layout change * wording * fix spoiler path again * simplify phrase * lint * lint fix Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
This commit is contained in:
parent
e084bd18a9
commit
1d8fb79e11
11 changed files with 402 additions and 504 deletions
62
oracle/src/pagetemplates.h
Normal file
62
oracle/src/pagetemplates.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#ifndef PAGETEMPLATES_H
|
||||
#define PAGETEMPLATES_H
|
||||
|
||||
#include <QWizardPage>
|
||||
|
||||
class OracleWizard;
|
||||
class QCheckBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QProgressBar;
|
||||
|
||||
class OracleWizardPage : public QWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit OracleWizardPage(QWidget *parent = nullptr) : QWizardPage(parent){};
|
||||
virtual void retranslateUi() = 0;
|
||||
|
||||
protected:
|
||||
inline OracleWizard *wizard()
|
||||
{
|
||||
return (OracleWizard *)QWizardPage::wizard();
|
||||
};
|
||||
};
|
||||
|
||||
class SimpleDownloadFilePage : public OracleWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SimpleDownloadFilePage(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void downloadFile(QUrl url);
|
||||
virtual QString getDefaultUrl() = 0;
|
||||
virtual QString getCustomUrlSettingsKey() = 0;
|
||||
virtual QString getDefaultSavePath() = 0;
|
||||
virtual QString getWindowTitle() = 0;
|
||||
virtual QString getFileType() = 0;
|
||||
bool saveToFile();
|
||||
bool internalSaveToFile(const QString &fileName);
|
||||
|
||||
protected:
|
||||
QByteArray downloadData;
|
||||
QLabel *urlLabel;
|
||||
QLabel *pathLabel;
|
||||
QLineEdit *urlLineEdit;
|
||||
QPushButton *urlButton;
|
||||
QLabel *progressLabel;
|
||||
QProgressBar *progressBar;
|
||||
QCheckBox *defaultPathCheckBox;
|
||||
|
||||
signals:
|
||||
void parsedDataReady();
|
||||
private slots:
|
||||
void actRestoreDefaultUrl();
|
||||
void actDownloadProgress(qint64 received, qint64 total);
|
||||
void actDownloadFinished();
|
||||
};
|
||||
|
||||
#endif // PAGETEMPLATES_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue