Skip to content

Commit

Permalink
Set errors if packing/unpacking failed
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Apr 25, 2024
1 parent 2922dfa commit babd4d5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
14 changes: 12 additions & 2 deletions source/src/gui/dt_comp_pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,24 @@ dt_comp_pack::dt_comp_pack(dt_app& app)

m_progress = 100.0f;
m_app.get_systems().core.is_working = false;
m_app.get_systems().core.has_errors = false;
m_app.get_systems().core.errors = "";

m_app.set_taskbar_status(dvsku::dv_taskbar_status::no_progress);
m_app.set_taskbar_progress(0U);

if (result.status == libevp::evp_result_status::ok)
if (result.status == libevp::evp_result_status::ok) {
m_app.play_sound(dvsku::dv_sound_type::success);
else if (result.status == libevp::evp_result_status::error)
}
else if (result.status == libevp::evp_result_status::error) {
m_app.play_sound(dvsku::dv_sound_type::warning);

if (!result.message.empty()) {
m_app.get_systems().core.has_errors = true;
m_app.get_systems().core.errors = result.message;
}
}

};
m_context.update_callback = [this](float progress) {
std::lock_guard<std::mutex> guard(m_app.get_systems().core.mutex);
Expand Down
13 changes: 11 additions & 2 deletions source/src/gui/dt_comp_unpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,23 @@ dt_comp_unpack::dt_comp_unpack(dt_app& app)

m_progress = 100.0f;
m_app.get_systems().core.is_working = false;
m_app.get_systems().core.has_errors = false;
m_app.get_systems().core.errors = "";

m_app.set_taskbar_status(dvsku::dv_taskbar_status::no_progress);
m_app.set_taskbar_progress(0U);

if (result.status == libevp::evp_result_status::ok)
if (result.status == libevp::evp_result_status::ok) {
m_app.play_sound(dvsku::dv_sound_type::success);
else if (result.status == libevp::evp_result_status::error)
}
else if (result.status == libevp::evp_result_status::error) {
m_app.play_sound(dvsku::dv_sound_type::warning);

if (!result.message.empty()) {
m_app.get_systems().core.has_errors = true;
m_app.get_systems().core.errors = result.message;
}
}
};
m_context.update_callback = [this](float progress) {
std::lock_guard<std::mutex> guard(m_app.get_systems().core.mutex);
Expand Down

0 comments on commit babd4d5

Please sign in to comment.