mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 20:51:12 -06:00 
			
		
		
		
	Close updated item info notification at new item loading
This commit is contained in:
		
							parent
							
								
									5a45c94ccd
								
							
						
					
					
						commit
						b1c1055963
					
				
					 3 changed files with 11 additions and 1 deletions
				
			
		|  | @ -373,7 +373,7 @@ void NotificationManager::PopNotification::init() | ||||||
| void NotificationManager::PopNotification::set_next_window_size(ImGuiWrapper& imgui) | void NotificationManager::PopNotification::set_next_window_size(ImGuiWrapper& imgui) | ||||||
| {  | {  | ||||||
| 	m_window_height = m_multiline ? | 	m_window_height = m_multiline ? | ||||||
| 		m_lines_count * m_line_height : | 		std::max(m_lines_count, (size_t)2) * m_line_height : | ||||||
| 		2 * m_line_height; | 		2 * m_line_height; | ||||||
| 	m_window_height += 1 * m_line_height; // top and bottom
 | 	m_window_height += 1 * m_line_height; // top and bottom
 | ||||||
| } | } | ||||||
|  | @ -1055,6 +1055,8 @@ void NotificationManager::UpdatedItemsInfoNotification::add_type(InfoItemType ty | ||||||
| 
 | 
 | ||||||
| 	std::string text; | 	std::string text; | ||||||
| 	for (it = m_types_and_counts.begin(); it != m_types_and_counts.end(); ++it) { | 	for (it = m_types_and_counts.begin(); it != m_types_and_counts.end(); ++it) { | ||||||
|  | 		if ((*it).second == 0) | ||||||
|  | 			continue; | ||||||
| 		text += std::to_string((*it).second); | 		text += std::to_string((*it).second); | ||||||
| 		text += _L_PLURAL(" Object was loaded with "," Objects were loaded with ", (*it).second).ToUTF8().data(); | 		text += _L_PLURAL(" Object was loaded with "," Objects were loaded with ", (*it).second).ToUTF8().data(); | ||||||
| 		switch ((*it).first) { | 		switch ((*it).first) { | ||||||
|  | @ -1066,6 +1068,7 @@ void NotificationManager::UpdatedItemsInfoNotification::add_type(InfoItemType ty | ||||||
| 		default: BOOST_LOG_TRIVIAL(error) << "Unknown InfoItemType: " << (*it).second; break; | 		default: BOOST_LOG_TRIVIAL(error) << "Unknown InfoItemType: " << (*it).second; break; | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | 	m_state = EState::Unknown; | ||||||
| 	NotificationData data { get_data().type, get_data().level , get_data().duration, text }; | 	NotificationData data { get_data().type, get_data().level , get_data().duration, text }; | ||||||
| 	update(data); | 	update(data); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -214,6 +214,7 @@ public: | ||||||
| 	bool is_hint_notification_open(); | 	bool is_hint_notification_open(); | ||||||
| 	// Forces Hints to reload its content when next hint should be showed
 | 	// Forces Hints to reload its content when next hint should be showed
 | ||||||
| 	void deactivate_loaded_hints(); | 	void deactivate_loaded_hints(); | ||||||
|  | 	// Adds counter to existing UpdatedItemsInfo notification or opens new one
 | ||||||
| 	void push_updated_item_info_notification(InfoItemType type); | 	void push_updated_item_info_notification(InfoItemType type); | ||||||
| 	// Close old notification ExportFinished.
 | 	// Close old notification ExportFinished.
 | ||||||
| 	void new_export_began(bool on_removable); | 	void new_export_began(bool on_removable); | ||||||
|  | @ -653,6 +654,11 @@ private: | ||||||
| 		} | 		} | ||||||
| 		void count_spaces() override; | 		void count_spaces() override; | ||||||
| 		void add_type(InfoItemType type); | 		void add_type(InfoItemType type); | ||||||
|  | 		void close() override{  | ||||||
|  | 			for (auto& tac : m_types_and_counts) | ||||||
|  | 				tac.second = 0; | ||||||
|  | 			PopNotification::close();  | ||||||
|  | 		} | ||||||
| 	protected: | 	protected: | ||||||
| 		void render_left_sign(ImGuiWrapper& imgui) override; | 		void render_left_sign(ImGuiWrapper& imgui) override; | ||||||
| 		std::vector<std::pair<InfoItemType, size_t>> m_types_and_counts; | 		std::vector<std::pair<InfoItemType, size_t>> m_types_and_counts; | ||||||
|  |  | ||||||
|  | @ -2600,6 +2600,7 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode | ||||||
|     // so 3D-scene should be updated before object additing to the ObjectList
 |     // so 3D-scene should be updated before object additing to the ObjectList
 | ||||||
|     this->view3D->reload_scene(false, (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH); |     this->view3D->reload_scene(false, (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH); | ||||||
| 
 | 
 | ||||||
|  |     notification_manager->close_notification_of_type(NotificationType::UpdatedItemsInfo); | ||||||
|     for (const size_t idx : obj_idxs) { |     for (const size_t idx : obj_idxs) { | ||||||
|         wxGetApp().obj_list()->add_object_to_list(idx); |         wxGetApp().obj_list()->add_object_to_list(idx); | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Kocik
						David Kocik