Cockatrice/cockatrice/src/dialogs/dlg_update.h
BruebachL aa24502129
Move logging from QDebug to QCDebug and introduce LoggingCategories. (#5491)
* Move logging from QDebug to QCDebug and introduce LoggingCategories.

* Lint.

* Unlint like one change.

* Remove .debug category since this is autofilled by Qt and used to differentiate between QCDebug and QCWarning and QCError.

* Uncomment defaults, include main category.

* Make PictureLoader logging a bit more useful.

* Lint...?

* Address comments.

* Clean up some unnecessary classes in logging statements.

* Add a new message format to the logging handler.

* Lint.

* Lint.

* Support Windows in Regex

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2025-01-19 13:14:23 +00:00

47 lines
1.2 KiB
C++

#ifndef DLG_UPDATE_H
#define DLG_UPDATE_H
#include "../client/update_downloader.h"
#include <QDialogButtonBox>
#include <QLoggingCategory>
#include <QProgressDialog>
#include <QtNetwork>
inline Q_LOGGING_CATEGORY(DlgUpdateLog, "dlg_update");
class Release;
class DlgUpdate : public QDialog
{
Q_OBJECT
public:
DlgUpdate(QWidget *parent);
private slots:
void finishedUpdateCheck(bool needToUpdate, bool isCompatible, Release *release);
void gotoDownloadPage();
void downloadUpdate();
void cancelDownload();
void updateCheckError(const QString &errorString);
void downloadSuccessful(const QUrl &filepath);
void downloadProgressMade(qint64 bytesRead, qint64 totalBytes);
void downloadError(const QString &errorString);
void closeDialog();
private:
QUrl updateUrl;
void enableUpdateButton(bool enable);
void enableOkButton(bool enable);
void addStopDownloadAndRemoveOthers(bool enable);
void beginUpdateCheck();
void setLabel(const QString &text);
QLabel *statusLabel, *descriptionLabel;
QProgressBar *progress;
QPushButton *manualDownload, *gotoDownload, *ok, *stopDownload;
QPushButton *cancel;
UpdateDownloader *uDownloader;
QDialogButtonBox *buttonBox;
};
#endif