mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-20 07:11:12 -06:00 
			
		
		
		
	Merge remote-tracking branch 'origin/backspace_to_delete_on_osx'
This commit is contained in:
		
						commit
						987fc4c6df
					
				
					 9 changed files with 3877 additions and 2186 deletions
				
			
		|  | @ -313,6 +313,9 @@ sub new { | ||||||
|         my ($list, $event) = @_; |         my ($list, $event) = @_; | ||||||
|         if ($event->GetKeyCode == WXK_TAB) { |         if ($event->GetKeyCode == WXK_TAB) { | ||||||
|             $list->Navigate($event->ShiftDown ? &Wx::wxNavigateBackward : &Wx::wxNavigateForward); |             $list->Navigate($event->ShiftDown ? &Wx::wxNavigateBackward : &Wx::wxNavigateForward); | ||||||
|  |         } elsif ($event->GetKeyCode == WXK_DELETE || | ||||||
|  |                 ($event->GetKeyCode == WXK_BACK && &Wx::wxMAC) ) { | ||||||
|  |             $self->remove; | ||||||
|         } else { |         } else { | ||||||
|             $event->Skip; |             $event->Skip; | ||||||
|         } |         } | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							|  | @ -3061,7 +3061,13 @@ void GLCanvas3D::on_key_down(wxKeyEvent& evt) | ||||||
|         if (key == WXK_DELETE) |         if (key == WXK_DELETE) | ||||||
|             m_on_remove_object_callback.call(); |             m_on_remove_object_callback.call(); | ||||||
|         else |         else | ||||||
|             evt.Skip(); | 		{ | ||||||
|  | #ifdef __WXOSX__ | ||||||
|  | 			if (key == WXK_BACK) | ||||||
|  | 				m_on_remove_object_callback.call(); | ||||||
|  | #endif | ||||||
|  | 			evt.Skip(); | ||||||
|  | 		} | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -250,6 +250,7 @@ bool select_language(wxArrayString & names, | ||||||
| 		g_wxLocale->AddCatalogLookupPathPrefix(wxPathOnly(localization_dir())); | 		g_wxLocale->AddCatalogLookupPathPrefix(wxPathOnly(localization_dir())); | ||||||
| 		g_wxLocale->AddCatalog(g_wxApp->GetAppName()); | 		g_wxLocale->AddCatalog(g_wxApp->GetAppName()); | ||||||
| 		wxSetlocale(LC_NUMERIC, "C"); | 		wxSetlocale(LC_NUMERIC, "C"); | ||||||
|  | 		Preset::update_suffix_modified(); | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| 	return false; | 	return false; | ||||||
|  | @ -275,6 +276,7 @@ bool load_language() | ||||||
| 			g_wxLocale->AddCatalogLookupPathPrefix(wxPathOnly(localization_dir())); | 			g_wxLocale->AddCatalogLookupPathPrefix(wxPathOnly(localization_dir())); | ||||||
| 			g_wxLocale->AddCatalog(g_wxApp->GetAppName()); | 			g_wxLocale->AddCatalog(g_wxApp->GetAppName()); | ||||||
| 			wxSetlocale(LC_NUMERIC, "C"); | 			wxSetlocale(LC_NUMERIC, "C"); | ||||||
|  | 			Preset::update_suffix_modified(); | ||||||
| 			return true; | 			return true; | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -146,6 +146,11 @@ const std::string& Preset::suffix_modified() | ||||||
| { | { | ||||||
|     return g_suffix_modified; |     return g_suffix_modified; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | void Preset::update_suffix_modified() | ||||||
|  | { | ||||||
|  | 	g_suffix_modified = (" (" + _(L("modified")) + ")").ToUTF8().data(); | ||||||
|  | } | ||||||
| // Remove an optional "(modified)" suffix from a name.
 | // Remove an optional "(modified)" suffix from a name.
 | ||||||
| // This converts a UI name to a unique preset identifier.
 | // This converts a UI name to a unique preset identifier.
 | ||||||
| std::string Preset::remove_suffix_modified(const std::string &name) | std::string Preset::remove_suffix_modified(const std::string &name) | ||||||
|  |  | ||||||
|  | @ -167,6 +167,7 @@ public: | ||||||
|     static const std::vector<std::string>&  printer_options(); |     static const std::vector<std::string>&  printer_options(); | ||||||
|     // Nozzle options of the printer options.
 |     // Nozzle options of the printer options.
 | ||||||
|     static const std::vector<std::string>&  nozzle_options(); |     static const std::vector<std::string>&  nozzle_options(); | ||||||
|  | 	static void update_suffix_modified(); | ||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|     friend class        PresetCollection; |     friend class        PresetCollection; | ||||||
|  | @ -260,7 +261,7 @@ public: | ||||||
| 	// used to update preset_choice from Tab
 | 	// used to update preset_choice from Tab
 | ||||||
| 	const std::deque<Preset>&	get_presets()	{ return m_presets; } | 	const std::deque<Preset>&	get_presets()	{ return m_presets; } | ||||||
| 	int						get_idx_selected()	{ return m_idx_selected; } | 	int						get_idx_selected()	{ return m_idx_selected; } | ||||||
| 	const std::string&		get_suffix_modified(); | 	static const std::string&	get_suffix_modified(); | ||||||
| 
 | 
 | ||||||
|     // Return a preset possibly with modifications.
 |     // Return a preset possibly with modifications.
 | ||||||
| 	Preset&			default_preset()			{ return m_presets.front(); } | 	Preset&			default_preset()			{ return m_presets.front(); } | ||||||
|  |  | ||||||
|  | @ -2728,7 +2728,7 @@ void SavePresetWindow::accept() | ||||||
| 		const char* unusable_symbols = "<>:/\\|?*\""; | 		const char* unusable_symbols = "<>:/\\|?*\""; | ||||||
| 		bool is_unusable_symbol = false; | 		bool is_unusable_symbol = false; | ||||||
| 		bool is_unusable_postfix = false; | 		bool is_unusable_postfix = false; | ||||||
| 		const std::string unusable_postfix = "(modified)"; | 		const std::string unusable_postfix = PresetCollection::get_suffix_modified();//"(modified)";
 | ||||||
| 		for (size_t i = 0; i < std::strlen(unusable_symbols); i++){ | 		for (size_t i = 0; i < std::strlen(unusable_symbols); i++){ | ||||||
| 			if (m_chosen_name.find_first_of(unusable_symbols[i]) != std::string::npos){ | 			if (m_chosen_name.find_first_of(unusable_symbols[i]) != std::string::npos){ | ||||||
| 				is_unusable_symbol = true; | 				is_unusable_symbol = true; | ||||||
|  | @ -2743,8 +2743,9 @@ void SavePresetWindow::accept() | ||||||
| 							_(L("the following characters are not allowed:")) + " <>:/\\|?*\""); | 							_(L("the following characters are not allowed:")) + " <>:/\\|?*\""); | ||||||
| 		} | 		} | ||||||
| 		else if (is_unusable_postfix){ | 		else if (is_unusable_postfix){ | ||||||
| 			show_error(this,	_(L("The supplied name is not valid;")) + "\n" +  | 			show_error(this,_(L("The supplied name is not valid;")) + "\n" + | ||||||
| 								_(L("the following postfix are not allowed:")) + "\n\t" + unusable_postfix); | 							_(L("the following postfix are not allowed:")) + "\n\t" + //unusable_postfix);
 | ||||||
|  | 							wxString::FromUTF8(unusable_postfix.c_str())); | ||||||
| 		} | 		} | ||||||
| 		else if (m_chosen_name.compare("- default -") == 0) { | 		else if (m_chosen_name.compare("- default -") == 0) { | ||||||
| 			show_error(this, _(L("The supplied name is not available."))); | 			show_error(this, _(L("The supplied name is not available."))); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv