mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Validate Error notification
This commit is contained in:
		
							parent
							
								
									9f0c6576f6
								
							
						
					
					
						commit
						aebbafc75c
					
				
					 3 changed files with 18 additions and 9 deletions
				
			
		|  | @ -1096,6 +1096,11 @@ void NotificationManager::push_notification(NotificationType type, | |||
| 	} | ||||
|     push_notification_data({ type, level, duration, text, hypertext, callback }, timestamp); | ||||
| } | ||||
| void NotificationManager::push_validate_error_notification(const std::string& text) | ||||
| { | ||||
| 	push_notification_data({ NotificationType::ValidateError, NotificationLevel::ErrorNotification, 0,  _u8L("ERROR:") + "\n" + text }, 0); | ||||
| } | ||||
| 
 | ||||
| void NotificationManager::push_slicing_error_notification(const std::string& text) | ||||
| { | ||||
| 	set_all_slicing_errors_gray(false); | ||||
|  |  | |||
|  | @ -55,8 +55,11 @@ enum class NotificationType | |||
| 	// Contains a hyperlink to execute installation of the new system profiles.
 | ||||
| 	PresetUpdateAvailable, | ||||
| //	LoadingFailed,
 | ||||
| 	// Not used - instead Slicing error is used for both slicing and validate errors.
 | ||||
| //	ValidateError,
 | ||||
| 	// Errors emmited by Print::validate
 | ||||
| 	// difference from Slicing error is that they disappear not grey out at update_background_process
 | ||||
| 	ValidateError, | ||||
| 	// Notification emitted by Print::validate
 | ||||
| 	ValidateWarning, | ||||
| 	// Slicing error produced by BackgroundSlicingProcess::validate() or by the BackgroundSlicingProcess background
 | ||||
| 	// thread thowing a SlicingError exception.
 | ||||
| 	SlicingError, | ||||
|  | @ -79,8 +82,6 @@ enum class NotificationType | |||
|     EmptyAutoColorChange, | ||||
|     // Notification about detected sign
 | ||||
|     SignDetected, | ||||
|     // Notification emitted by Print::validate
 | ||||
|     PrintValidateWarning, | ||||
|     // Notification telling user to quit SLA supports manual editing
 | ||||
|     QuitSLAManualMode, | ||||
|     // Desktop integration basic info
 | ||||
|  | @ -123,6 +124,8 @@ public: | |||
| 	// ErrorNotification and ImportantNotification are never faded out.
 | ||||
|     void push_notification(NotificationType type, NotificationLevel level, const std::string& text, const std::string& hypertext = "", | ||||
|                            std::function<bool(wxEvtHandler*)> callback = std::function<bool(wxEvtHandler*)>(), int timestamp = 0); | ||||
| 	// Creates Validate Error notification with a custom text and no fade out.
 | ||||
| 	void push_validate_error_notification(const std::string& text); | ||||
| 	// Creates Slicing Error notification with a custom text and no fade out.
 | ||||
| 	void push_slicing_error_notification(const std::string& text); | ||||
| 	// Creates Slicing Warning notification with a custom text and no fade out.
 | ||||
|  |  | |||
|  | @ -2897,7 +2897,7 @@ void Plater::priv::update_print_volume_state() | |||
| void Plater::priv::process_validation_warning(const std::string& warning) const | ||||
| { | ||||
|     if (warning.empty()) | ||||
|         notification_manager->close_notification_of_type(NotificationType::PrintValidateWarning); | ||||
|         notification_manager->close_notification_of_type(NotificationType::ValidateWarning); | ||||
|     else { | ||||
|         std::string text = warning; | ||||
|         std::string hypertext = ""; | ||||
|  | @ -2920,9 +2920,9 @@ void Plater::priv::process_validation_warning(const std::string& warning) const | |||
|         } | ||||
| 
 | ||||
|         notification_manager->push_notification( | ||||
|             NotificationType::PrintValidateWarning, | ||||
|             NotificationManager::NotificationLevel::ImportantNotification, | ||||
|             text, hypertext, action_fn | ||||
|             NotificationType::ValidateWarning, | ||||
|             NotificationManager::NotificationLevel::WarningNotification, | ||||
|             _u8L("WARNING:") + "\n" + text, hypertext, action_fn | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|  | @ -2974,6 +2974,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool | |||
|         std::string err = background_process.validate(&warning); | ||||
|         if (err.empty()) { | ||||
| 			notification_manager->set_all_slicing_errors_gray(true); | ||||
|             notification_manager->close_notification_of_type(NotificationType::ValidateError); | ||||
|             if (invalidated != Print::APPLY_STATUS_UNCHANGED && background_processing_enabled()) | ||||
|                 return_state |= UPDATE_BACKGROUND_PROCESS_RESTART; | ||||
| 
 | ||||
|  | @ -2989,7 +2990,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool | |||
|         else { | ||||
| 			// The print is not valid.
 | ||||
| 			// Show error as notification.
 | ||||
|             notification_manager->push_slicing_error_notification(err); | ||||
|             notification_manager->push_validate_error_notification(err); | ||||
|             return_state |= UPDATE_BACKGROUND_PROCESS_INVALID; | ||||
|             if (printer_technology == ptFFF) { | ||||
|                 const Print* print = background_process.fff_print(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Kocik
						David Kocik