Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ std::vector<std::string> SettingsResourceDownloadTable::make_header() const{
"",
"",
"",
"",
};
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -368,15 +372,11 @@ void SettingsProgressBarWidget::on_reset_progress(){
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// SettingsDownloadPopupWidget
/////////////////////////////////////////////////////////////////////////////////////////////////////////
template class RegisterConfigWidget<SettingsDownloadPopupWidget>;
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);
}
Expand Down Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading