diff --git a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.cpp b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.cpp index 5bd49776a3..1cb8e5c647 100644 --- a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.cpp +++ b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.cpp @@ -154,7 +154,6 @@ SettingsResourceDownloadRow::SettingsResourceDownloadRow( , m_delete_button(*this) , m_cancel_button(*this) , m_progress_bar(*this) - , m_popup(*this) { PA_ADD_STATIC(m_data->m_resource_name_label); PA_ADD_STATIC(m_data->m_file_size_label); @@ -165,7 +164,6 @@ SettingsResourceDownloadRow::SettingsResourceDownloadRow( PA_ADD_STATIC(m_delete_button); PA_ADD_STATIC(m_cancel_button); PA_ADD_STATIC(m_progress_bar); - PA_ADD_STATIC(m_popup); update_action_state(ActionState::READY); } diff --git a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.h b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.h index 64a0a1ef0a..4241e813bf 100644 --- a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.h +++ b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadRow.h @@ -105,7 +105,6 @@ class SettingsResourceDownloadRow : public StaticTableRow, public ResourceDownlo SettingsResourceDeleteButton m_delete_button; SettingsResourceCancelButton m_cancel_button; SettingsResourceProgressBar m_progress_bar; - SettingsDownloadPopup m_popup; LifetimeSanitizer m_lifetime_sanitizer; diff --git a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadTable.cpp b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadTable.cpp index 2425146822..5ef91e1782 100644 --- a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadTable.cpp +++ b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadTable.cpp @@ -68,7 +68,6 @@ std::vector SettingsResourceDownloadTable::make_header() const{ "", "", "", - "", }; return ret; } diff --git a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.cpp b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.cpp index 4c298b4f82..d85a20ad32 100644 --- a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.cpp +++ b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.cpp @@ -70,6 +70,10 @@ SettingsDownloadButtonWidget::SettingsDownloadButtonWidget(QWidget& parent, Sett ); + // add QObject that manages the Download confirmation popup + SettingsDownloadPopupWidget* popup = new SettingsDownloadPopupWidget(m_row); + popup->setParent(this); + value.add_button_listener(*this); } @@ -368,15 +372,11 @@ void SettingsProgressBarWidget::on_reset_progress(){ ///////////////////////////////////////////////////////////////////////////////////////////////////////// // SettingsDownloadPopupWidget ///////////////////////////////////////////////////////////////////////////////////////////////////////// -template class RegisterConfigWidget; SettingsDownloadPopupWidget::~SettingsDownloadPopupWidget(){ m_row.remove_listener(*this); } -SettingsDownloadPopupWidget::SettingsDownloadPopupWidget(QWidget& parent, SettingsDownloadPopup& value) - : QWidget(&parent) - , ConfigWidget(value, *this) - // , m_value(value) - , m_row(value.row) +SettingsDownloadPopupWidget::SettingsDownloadPopupWidget(SettingsResourceDownloadRow& row) + : m_row(row) { m_row.add_listener(*this); } @@ -440,6 +440,7 @@ SettingsDownloadErrorWidget::SettingsDownloadErrorWidget(QWidget& parent, Settin , ConfigWidget(value, *this) { GlobalResourceDownloadManager::instance().add_download_listener(*this); + this->hide(); } void SettingsDownloadErrorWidget::show_download_failed_box(const std::string& resource_slug){ diff --git a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.h b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.h index 0bf877fd3f..d7667a4b4f 100644 --- a/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.h +++ b/SerialPrograms/Source/CommonFramework/ResourceDownload/SettingsResourceDownloadWidget.h @@ -107,13 +107,11 @@ class SettingsProgressBarWidget : public QWidget, public ConfigWidget, public Se }; -class SettingsDownloadPopupWidget : public QWidget, public ConfigWidget, public SettingsResourceDownloadRow::Listener{ -public: - using ParentOption = SettingsDownloadPopup; - +// NOTE: This does not inherit ConfigWidget, so it doesn't need to be added to StaticRegistrationQt +class SettingsDownloadPopupWidget : public QObject, public SettingsResourceDownloadRow::Listener{ public: ~SettingsDownloadPopupWidget(); - SettingsDownloadPopupWidget(QWidget& parent, SettingsDownloadPopup& value); + SettingsDownloadPopupWidget(SettingsResourceDownloadRow& row); public: // SettingsResourceDownloadRow::Listener virtual void on_metadata_fetch_finished(const std::string& popup_message) override;