mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-20 02:53:57 +00:00
fix: Auto Update Link
This commit is contained in:
@@ -7,28 +7,29 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include "citron/updater/updater_service.h"
|
#include "citron/updater/updater_service.h"
|
||||||
|
|
||||||
// Forward declare QString for the helper function.
|
|
||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class UpdaterDialog;
|
class UpdaterDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Updater {
|
namespace Updater {
|
||||||
|
|
||||||
// Add the declaration for the date formatting helper function.
|
// Declarations for helper functions
|
||||||
QString FormatDateTimeString(const std::string& iso_string);
|
QString FormatDateTimeString(const std::string& iso_string);
|
||||||
|
|
||||||
class UpdaterDialog : public QDialog {
|
QString FormatChangelog(const std::string& raw_changelog);
|
||||||
|
|
||||||
|
class UpdaterDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UpdaterDialog(QWidget* parent = nullptr);
|
explicit UpdaterDialog(QWidget* parent = nullptr);
|
||||||
~UpdaterDialog() override;
|
~UpdaterDialog() override;
|
||||||
|
|
||||||
void CheckForUpdates(const std::string& update_url);
|
void CheckForUpdates(const std::string& update_url);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void OnUpdateCheckCompleted(bool has_update, const Updater::UpdateInfo& update_info);
|
void OnUpdateCheckCompleted(bool has_update, const Updater::UpdateInfo& update_info);
|
||||||
void OnUpdateDownloadProgress(int percentage, qint64 bytes_received, qint64 bytes_total);
|
void OnUpdateDownloadProgress(int percentage, qint64 bytes_received, qint64 bytes_total);
|
||||||
void OnUpdateInstallProgress(int percentage, const QString& current_file);
|
void OnUpdateInstallProgress(int percentage, const QString& current_file);
|
||||||
@@ -39,7 +40,7 @@ private slots:
|
|||||||
void OnCloseButtonClicked();
|
void OnCloseButtonClicked();
|
||||||
void OnRestartButtonClicked();
|
void OnRestartButtonClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class State { Checking, NoUpdate, UpdateAvailable, Downloading, Installing, Completed, Error };
|
enum class State { Checking, NoUpdate, UpdateAvailable, Downloading, Installing, Completed, Error };
|
||||||
|
|
||||||
void SetupUI();
|
void SetupUI();
|
||||||
@@ -60,6 +61,6 @@ private:
|
|||||||
qint64 total_download_size;
|
qint64 total_download_size;
|
||||||
qint64 downloaded_bytes;
|
qint64 downloaded_bytes;
|
||||||
QTimer* progress_timer;
|
QTimer* progress_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Updater
|
} // namespace Updater
|
||||||
|
|||||||
Reference in New Issue
Block a user