mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Tech ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN set as default
This commit is contained in:
		
							parent
							
								
									19cfeb1a78
								
							
						
					
					
						commit
						8cb8a24ded
					
				
					 7 changed files with 10 additions and 56 deletions
				
			
		|  | @ -1186,7 +1186,6 @@ PageReloadFromDisk::PageReloadFromDisk(ConfigWizard* parent) | |||
|     box_pathnames->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent& event) { this->full_pathnames = event.IsChecked(); }); | ||||
| } | ||||
| 
 | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
| PageFilesAssociation::PageFilesAssociation(ConfigWizard* parent) | ||||
|     : ConfigWizardPage(parent, _L("Files association"), _L("Files association")) | ||||
|  | @ -1200,7 +1199,6 @@ PageFilesAssociation::PageFilesAssociation(ConfigWizard* parent) | |||
| //    append(cb_gcode);
 | ||||
| } | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
| PageMode::PageMode(ConfigWizard *parent) | ||||
|     : ConfigWizardPage(parent, _L("View mode"), _L("View mode")) | ||||
|  | @ -1813,11 +1811,9 @@ void ConfigWizard::priv::load_pages() | |||
| 
 | ||||
|     index->add_page(page_update); | ||||
|     index->add_page(page_reload_from_disk); | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
|     index->add_page(page_files_association); | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
|     index->add_page(page_mode); | ||||
| 
 | ||||
|     index->go_to(former_active);   // Will restore the active item/page if possible
 | ||||
|  | @ -2411,7 +2407,6 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese | |||
|     app_config->set("preset_update", page_update->preset_update ? "1" : "0"); | ||||
|     app_config->set("export_sources_full_pathnames", page_reload_from_disk->full_pathnames ? "1" : "0"); | ||||
| 
 | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
|     app_config->set("associate_3mf", page_files_association->associate_3mf() ? "1" : "0"); | ||||
|     app_config->set("associate_stl", page_files_association->associate_stl() ? "1" : "0"); | ||||
|  | @ -2429,7 +2424,6 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese | |||
| //    }
 | ||||
| 
 | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
|     page_mode->serialize_mode(app_config); | ||||
| 
 | ||||
|  | @ -2594,11 +2588,9 @@ ConfigWizard::ConfigWizard(wxWindow *parent) | |||
|      | ||||
|     p->add_page(p->page_update   = new PageUpdate(this)); | ||||
|     p->add_page(p->page_reload_from_disk = new PageReloadFromDisk(this)); | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
|     p->add_page(p->page_files_association = new PageFilesAssociation(this)); | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
|     p->add_page(p->page_mode     = new PageMode(this)); | ||||
|     p->add_page(p->page_firmware = new PageFirmware(this)); | ||||
|     p->add_page(p->page_bed      = new PageBedShape(this)); | ||||
|  |  | |||
|  | @ -393,7 +393,6 @@ struct PageReloadFromDisk : ConfigWizardPage | |||
|     PageReloadFromDisk(ConfigWizard* parent); | ||||
| }; | ||||
| 
 | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
| struct PageFilesAssociation : ConfigWizardPage | ||||
| { | ||||
|  | @ -410,7 +409,6 @@ public: | |||
| //    bool associate_gcode() const { return cb_gcode->IsChecked(); }
 | ||||
| }; | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
| struct PageMode: ConfigWizardPage | ||||
| { | ||||
|  | @ -572,11 +570,9 @@ struct ConfigWizard::priv | |||
|     PageCustom       *page_custom = nullptr; | ||||
|     PageUpdate       *page_update = nullptr; | ||||
|     PageReloadFromDisk *page_reload_from_disk = nullptr; | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
|     PageFilesAssociation* page_files_association = nullptr; | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
|     PageMode         *page_mode = nullptr; | ||||
|     PageVendors      *page_vendors = nullptr; | ||||
|     Pages3rdparty     pages_3rdparty; | ||||
|  |  | |||
|  | @ -835,14 +835,10 @@ bool GUI_App::on_init_inner() | |||
| 
 | ||||
|     if (is_editor()) { | ||||
| #ifdef __WXMSW__  | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
|         if (app_config->get("associate_3mf") == "1") | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
|             associate_3mf_files(); | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
|         if (app_config->get("associate_stl") == "1") | ||||
|             associate_stl_files(); | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| #endif // __WXMSW__
 | ||||
| 
 | ||||
|         preset_updater = new PresetUpdater(); | ||||
|  | @ -858,9 +854,7 @@ bool GUI_App::on_init_inner() | |||
|     } | ||||
|     else { | ||||
| #ifdef __WXMSW__  | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
|         if (app_config->get("associate_gcode") == "1") | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
|             associate_gcode_files(); | ||||
| #endif // __WXMSW__
 | ||||
|     } | ||||
|  | @ -1722,7 +1716,6 @@ void GUI_App::add_config_menu(wxMenuBar *menu) | |||
|                 if (dlg.seq_top_layer_only_changed()) | ||||
| #endif // ENABLE_GCODE_LINES_ID_IN_H_SLIDER
 | ||||
|                     this->plater_->refresh_print(); | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
|                 if (is_editor()) { | ||||
|                     if (app_config->get("associate_3mf") == "1") | ||||
|  | @ -1735,7 +1728,6 @@ void GUI_App::add_config_menu(wxMenuBar *menu) | |||
|                         associate_gcode_files(); | ||||
|                 } | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
|             } | ||||
|             if (app_layout_changed) { | ||||
|                 // hide full main_sizer for mainFrame
 | ||||
|  | @ -2303,7 +2295,6 @@ void GUI_App::associate_3mf_files() | |||
|         ::SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); | ||||
| } | ||||
| 
 | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| void GUI_App::associate_stl_files() | ||||
| { | ||||
|     wchar_t app_path[MAX_PATH]; | ||||
|  | @ -2327,7 +2318,6 @@ void GUI_App::associate_stl_files() | |||
|         // notify Windows only when any of the values gets changed
 | ||||
|         ::SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); | ||||
| } | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
| void GUI_App::associate_gcode_files() | ||||
| { | ||||
|  |  | |||
|  | @ -279,13 +279,11 @@ public: | |||
|     bool is_gl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_version_greater_or_equal_to(major, minor); } | ||||
|     bool is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_glsl_version_greater_or_equal_to(major, minor); } | ||||
| 
 | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef __WXMSW__ | ||||
|     void            associate_3mf_files(); | ||||
|     void            associate_stl_files(); | ||||
|     void            associate_gcode_files(); | ||||
| #endif // __WXMSW__
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
| private: | ||||
|     bool            on_init_inner(); | ||||
|  | @ -297,13 +295,6 @@ private: | |||
| 
 | ||||
|     bool            config_wizard_startup(); | ||||
| 	void            check_updates(const bool verbose); | ||||
| 
 | ||||
| #if !ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef __WXMSW__ | ||||
|     void            associate_3mf_files(); | ||||
|     void            associate_gcode_files(); | ||||
| #endif // __WXMSW__
 | ||||
| #endif // !ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| }; | ||||
| 
 | ||||
| DECLARE_APP(GUI_App) | ||||
|  |  | |||
|  | @ -106,7 +106,6 @@ void PreferencesDialog::build() | |||
| 		option = Option(def, "export_sources_full_pathnames"); | ||||
| 		m_optgroup_general->append_single_option_line(option); | ||||
| 
 | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
| 		// Please keep in sync with ConfigWizard
 | ||||
| 		def.label = L("Associate .3mf files to PrusaSlicer"); | ||||
|  | @ -123,7 +122,6 @@ void PreferencesDialog::build() | |||
| 		option = Option(def, "associate_stl"); | ||||
| 		m_optgroup_general->append_single_option_line(option); | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
| 		// Please keep in sync with ConfigWizard
 | ||||
| 		def.label = L("Update built-in Presets automatically"); | ||||
|  | @ -184,7 +182,6 @@ void PreferencesDialog::build() | |||
| 		option = Option(def, "default_action_on_select_preset"); | ||||
| 		m_optgroup_general->append_single_option_line(option); | ||||
| 	} | ||||
| #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN | ||||
| #ifdef _WIN32 | ||||
| 	else { | ||||
| 		def.label = L("Associate .gcode files to PrusaSlicer G-code Viewer"); | ||||
|  | @ -195,7 +192,6 @@ void PreferencesDialog::build() | |||
| 		m_optgroup_general->append_single_option_line(option); | ||||
| 	} | ||||
| #endif // _WIN32
 | ||||
| #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 | ||||
| 
 | ||||
| #if __APPLE__ | ||||
| 	def.label = L("Use Retina resolution for the 3D scene"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 enricoturri1966
						enricoturri1966