ProgressCallback: Eliminate redundancy and drop C format strings
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#pragma once
|
||||
@ -11,7 +11,7 @@
|
||||
#include <QtWidgets/QProgressDialog>
|
||||
#include <atomic>
|
||||
|
||||
class QtModalProgressCallback final : public QObject, public BaseProgressCallback
|
||||
class QtModalProgressCallback final : public QObject, public ProgressCallback
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -22,19 +22,14 @@ public:
|
||||
QProgressDialog& GetDialog() { return m_dialog; }
|
||||
|
||||
void SetCancellable(bool cancellable) override;
|
||||
void SetTitle(const char* title) override;
|
||||
void SetStatusText(const char* text) override;
|
||||
void SetTitle(const std::string_view title) override;
|
||||
void SetStatusText(const std::string_view text) override;
|
||||
void SetProgressRange(u32 range) override;
|
||||
void SetProgressValue(u32 value) override;
|
||||
|
||||
void DisplayError(const char* message) override;
|
||||
void DisplayWarning(const char* message) override;
|
||||
void DisplayInformation(const char* message) override;
|
||||
void DisplayDebugMessage(const char* message) override;
|
||||
|
||||
void ModalError(const char* message) override;
|
||||
bool ModalConfirmation(const char* message) override;
|
||||
void ModalInformation(const char* message) override;
|
||||
void ModalError(const std::string_view message) override;
|
||||
bool ModalConfirmation(const std::string_view message) override;
|
||||
void ModalInformation(const std::string_view message) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void dialogCancelled();
|
||||
@ -47,7 +42,7 @@ private:
|
||||
float m_show_delay;
|
||||
};
|
||||
|
||||
class QtAsyncProgressThread : public QThread, public BaseProgressCallback
|
||||
class QtAsyncProgressThread : public QThread, public ProgressCallback
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -58,19 +53,14 @@ public:
|
||||
bool IsCancelled() const override;
|
||||
|
||||
void SetCancellable(bool cancellable) override;
|
||||
void SetTitle(const char* title) override;
|
||||
void SetStatusText(const char* text) override;
|
||||
void SetTitle(const std::string_view title) override;
|
||||
void SetStatusText(const std::string_view text) override;
|
||||
void SetProgressRange(u32 range) override;
|
||||
void SetProgressValue(u32 value) override;
|
||||
|
||||
void DisplayError(const char* message) override;
|
||||
void DisplayWarning(const char* message) override;
|
||||
void DisplayInformation(const char* message) override;
|
||||
void DisplayDebugMessage(const char* message) override;
|
||||
|
||||
void ModalError(const char* message) override;
|
||||
bool ModalConfirmation(const char* message) override;
|
||||
void ModalInformation(const char* message) override;
|
||||
void ModalError(const std::string_view message) override;
|
||||
bool ModalConfirmation(const std::string_view message) override;
|
||||
void ModalInformation(const std::string_view message) override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void titleUpdated(const QString& title);
|
||||
|
||||
Reference in New Issue
Block a user