mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 12:11:15 -06:00 
			
		
		
		
	ConfigWizard: Basic structure / WIP
This commit is contained in:
		
							parent
							
								
									e37cbdfcfc
								
							
						
					
					
						commit
						3fcf194e39
					
				
					 23 changed files with 881 additions and 24 deletions
				
			
		|  | @ -101,6 +101,8 @@ sub OnInit { | |||
|     $self->{app_config}->set('version', $Slic3r::VERSION); | ||||
|     $self->{app_config}->save; | ||||
| 
 | ||||
|     my $slic3r_update_avail = $self->{app_config}->get("version_check") && $self->{app_config}->get("version_online") != $Slic3r::VERSION; | ||||
| 
 | ||||
|     Slic3r::GUI::set_app_config($self->{app_config}); | ||||
|     Slic3r::GUI::load_language(); | ||||
| 
 | ||||
|  | @ -111,6 +113,7 @@ sub OnInit { | |||
|         warn $@ . "\n"; | ||||
|         show_error(undef, $@); | ||||
|     } | ||||
|     # TODO: check previously downloaded updates | ||||
|     $run_wizard = 1 if $self->{preset_bundle}->has_defauls_only; | ||||
| 
 | ||||
|     Slic3r::GUI::set_preset_bundle($self->{preset_bundle}); | ||||
|  | @ -134,14 +137,19 @@ sub OnInit { | |||
|         $self->{app_config}->save if $self->{app_config}->dirty; | ||||
|     }); | ||||
| 
 | ||||
|     if ($run_wizard) { | ||||
|         # On OSX the UI was not initialized correctly if the wizard was called | ||||
|         # before the UI was up and running. | ||||
|         $self->CallAfter(sub { | ||||
|     # On OSX the UI was not initialized correctly if the wizard was called | ||||
|     # before the UI was up and running. | ||||
|     $self->CallAfter(sub { | ||||
|         if ($slic3r_update_avail) { | ||||
|             # TODO | ||||
|         } elsif ($run_wizard) { | ||||
|             # Run the config wizard, don't offer the "reset user profile" checkbox. | ||||
|             $self->{mainframe}->config_wizard(1); | ||||
|         }); | ||||
|     } | ||||
|         } | ||||
| 
 | ||||
|         # XXX: recreate_GUI ??? | ||||
|         Slic3r::PresetUpdater::download($self->{app_config}, $self->{preset_bundle}); | ||||
|     }); | ||||
| 
 | ||||
|     # The following event is emited by the C++ menu implementation of application language change. | ||||
|     EVT_COMMAND($self, -1, $LANGUAGE_CHANGE_EVENT, sub{ | ||||
|  |  | |||
|  | @ -95,7 +95,7 @@ sub new { | |||
|     }); | ||||
| 
 | ||||
|     $self->update_ui_from_settings; | ||||
|      | ||||
| 
 | ||||
|     return $self; | ||||
| } | ||||
| 
 | ||||
|  | @ -643,6 +643,12 @@ sub config_wizard { | |||
|     my ($self, $fresh_start) = @_; | ||||
|     # Exit wizard if there are unsaved changes and the user cancels the action. | ||||
|     return unless $self->check_unsaved_changes; | ||||
| 
 | ||||
| 
 | ||||
|     # TODO: Offer "reset user profile" | ||||
|     Slic3r::GUI::open_config_wizard(); | ||||
|     return; | ||||
| 
 | ||||
|     # Enumerate the profiles bundled with the Slic3r installation under resources/profiles. | ||||
|     my $directory = Slic3r::resources_dir() . "/profiles"; | ||||
|     my @profiles = (); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vojtech Kral
						Vojtech Kral