Refactoring of suppress background process update for clarity.

This commit is contained in:
bubnikv 2020-03-12 16:11:25 +01:00
parent 1d5249f9b0
commit 45e0079356
2 changed files with 6 additions and 6 deletions

View File

@ -5612,7 +5612,7 @@ void Plater::schedule_background_process(bool schedule/* = true*/)
this->p->suppressed_backround_processing_update = false; this->p->suppressed_backround_processing_update = false;
} }
bool Plater::is_background_process_running() const bool Plater::is_background_process_update_scheduled() const
{ {
return this->p->background_process_timer.IsRunning(); return this->p->background_process_timer.IsRunning();
} }
@ -5754,14 +5754,14 @@ bool Plater::PopupMenu(wxMenu *menu, const wxPoint& pos)
} }
SuppressBackgroundProcessingUpdate::SuppressBackgroundProcessingUpdate() : SuppressBackgroundProcessingUpdate::SuppressBackgroundProcessingUpdate() :
m_was_running(wxGetApp().plater()->is_background_process_running()) m_was_scheduled(wxGetApp().plater()->is_background_process_update_scheduled())
{ {
wxGetApp().plater()->suppress_background_process(m_was_running); wxGetApp().plater()->suppress_background_process(m_was_scheduled);
} }
SuppressBackgroundProcessingUpdate::~SuppressBackgroundProcessingUpdate() SuppressBackgroundProcessingUpdate::~SuppressBackgroundProcessingUpdate()
{ {
wxGetApp().plater()->schedule_background_process(m_was_running); wxGetApp().plater()->schedule_background_process(m_was_scheduled);
} }
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI

View File

@ -208,7 +208,7 @@ public:
void changed_object(int obj_idx); void changed_object(int obj_idx);
void changed_objects(const std::vector<size_t>& object_idxs); void changed_objects(const std::vector<size_t>& object_idxs);
void schedule_background_process(bool schedule = true); void schedule_background_process(bool schedule = true);
bool is_background_process_running() const; bool is_background_process_update_scheduled() const;
void suppress_background_process(const bool stop_background_process) ; void suppress_background_process(const bool stop_background_process) ;
void fix_through_netfabb(const int obj_idx, const int vol_idx = -1); void fix_through_netfabb(const int obj_idx, const int vol_idx = -1);
void send_gcode(); void send_gcode();
@ -345,7 +345,7 @@ public:
SuppressBackgroundProcessingUpdate(); SuppressBackgroundProcessingUpdate();
~SuppressBackgroundProcessingUpdate(); ~SuppressBackgroundProcessingUpdate();
private: private:
bool m_was_running; bool m_was_scheduled;
}; };
}} }}