mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
Mark unsaved project title with * (#5910)
* Mark unsaved project title with *
This commit is contained in:
parent
b47810435a
commit
5ff93fe103
4 changed files with 35 additions and 3 deletions
|
@ -2572,6 +2572,7 @@ struct Plater::priv
|
|||
//BBS store bbs project name
|
||||
wxString get_project_name();
|
||||
void set_project_name(const wxString& project_name);
|
||||
void update_title_dirty_status();
|
||||
|
||||
// Call after plater and Canvas#D is initialized
|
||||
void init_notification_manager();
|
||||
|
@ -7649,6 +7650,25 @@ void Plater::priv::set_project_name(const wxString& project_name)
|
|||
#endif
|
||||
}
|
||||
|
||||
void Plater::priv::update_title_dirty_status()
|
||||
{
|
||||
if (m_project_name.empty())
|
||||
return;
|
||||
|
||||
wxString title;
|
||||
if (is_project_dirty())
|
||||
title = "*" + m_project_name;
|
||||
else
|
||||
title = m_project_name;
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
wxGetApp().mainframe->topbar()->SetTitle(title);
|
||||
#else
|
||||
wxGetApp().mainframe->SetTitle(title);
|
||||
wxGetApp().mainframe->update_title_colour_after_set_title();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Plater::priv::set_project_filename(const wxString& filename)
|
||||
{
|
||||
boost::filesystem::path full_path = into_path(filename);
|
||||
|
@ -8525,6 +8545,7 @@ void Plater::priv::undo_redo_to(std::vector<UndoRedo::Snapshot>::const_iterator
|
|||
}
|
||||
|
||||
dirty_state.update_from_undo_redo_stack(m_undo_redo_stack_main.project_modified());
|
||||
update_title_dirty_status();
|
||||
}
|
||||
|
||||
void Plater::priv::update_after_undo_redo(const UndoRedo::Snapshot& snapshot, bool /* temp_snapshot_was_taken */)
|
||||
|
@ -8941,6 +8962,7 @@ int Plater::save_project(bool saveAs)
|
|||
}
|
||||
catch (...) {}
|
||||
|
||||
update_title_dirty_status();
|
||||
return wxID_YES;
|
||||
}
|
||||
|
||||
|
@ -12778,8 +12800,10 @@ void Plater::on_config_change(const DynamicPrintConfig &config)
|
|||
if (update_scheduled)
|
||||
update();
|
||||
|
||||
if (p->main_frame->is_loaded())
|
||||
if (p->main_frame->is_loaded()) {
|
||||
this->p->schedule_background_process();
|
||||
update_title_dirty_status();
|
||||
}
|
||||
}
|
||||
|
||||
void Plater::set_bed_shape() const
|
||||
|
@ -14282,6 +14306,11 @@ bool Plater::PopupObjectTableBySelection()
|
|||
return p->PopupObjectTable(obj_idx, vol_idx, pos);
|
||||
}
|
||||
|
||||
void Plater::update_title_dirty_status()
|
||||
{
|
||||
p->update_title_dirty_status();
|
||||
}
|
||||
|
||||
|
||||
wxMenu* Plater::plate_menu() { return p->menus.plate_menu(); }
|
||||
wxMenu* Plater::object_menu() { return p->menus.object_menu(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue