27 #include "hugin_config.h"
29 #include "wx/listbook.h"
30 #include <wx/stdpaths.h>
49 #define MY_STR_VAL(id, val) { XRCCTRL(*this, id, wxTextCtrl)->SetValue(val); };
50 #define MY_SPIN_VAL(id, val) { XRCCTRL(*this, id, wxSpinCtrl)->SetValue(val); };
51 #define MY_BOOL_VAL(id, val) { XRCCTRL(*this, id, wxCheckBox)->SetValue(val); };
52 #define MY_CHOICE_VAL(id, val) { XRCCTRL(*this, id, wxChoice)->SetSelection(val); };
53 #define MY_STATIC_VAL(id, val) { XRCCTRL(*this, id, wxStaticText)->SetLabel(val); };
55 #define MY_G_STR_VAL(id) XRCCTRL(*this, id, wxTextCtrl)->GetValue()
56 #define MY_G_SPIN_VAL(id) XRCCTRL(*this, id, wxSpinCtrl)->GetValue()
57 #define MY_G_BOOL_VAL(id) XRCCTRL(*this, id, wxCheckBox)->GetValue()
58 #define MY_G_CHOICE_VAL(id) XRCCTRL(*this, id, wxChoice)->GetSelection()
66 wxXmlResource::Get()->LoadDialog(
this, parent,
"pref_dialog");
69 XRCCTRL(*
this,
"prefs_ft_RotationStartAngle", wxSpinCtrl)->SetRange(-180,0);
70 XRCCTRL(*
this,
"prefs_ft_RotationStopAngle", wxSpinCtrl)->SetRange(0,180);
71 XRCCTRL(*
this,
"prefs_ass_nControlPoints", wxSpinCtrl)->SetRange(3,3000);
73 wxChoice* lang_choice = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
76 *lp = wxLANGUAGE_DEFAULT;
77 lang_choice->Append(_(
"System default"), lp);
79 *lp = wxLANGUAGE_BASQUE;
80 lang_choice->Append(_(
"Basque"), lp);
87 *lp = wxLANGUAGE_CATALAN;
88 lang_choice->Append(_(
"Catalan"), lp);
90 *lp = wxLANGUAGE_CHINESE_SIMPLIFIED;
91 lang_choice->Append(_(
"Chinese (Simplified)"), lp);
93 *lp = wxLANGUAGE_CHINESE_TRADITIONAL;
94 lang_choice->Append(_(
"Chinese (Traditional)"), lp);
96 *lp = wxLANGUAGE_CZECH;
97 lang_choice->Append(_(
"Czech"), lp);
99 *lp = wxLANGUAGE_DANISH;
100 lang_choice->Append(_(
"Danish"), lp);
102 *lp = wxLANGUAGE_DUTCH;
103 lang_choice->Append(_(
"Dutch"), lp);
105 *lp = wxLANGUAGE_ENGLISH;
106 lang_choice->Append(_(
"English"), lp);
108 *lp = wxLANGUAGE_FRENCH;
109 lang_choice->Append(_(
"French"), lp);
111 *lp = wxLANGUAGE_GERMAN;
112 lang_choice->Append(_(
"German"), lp);
114 *lp = wxLANGUAGE_HUNGARIAN;
115 lang_choice->Append(_(
"Hungarian"), lp);
117 *lp = wxLANGUAGE_ITALIAN;
118 lang_choice->Append(_(
"Italian"), lp);
120 *lp = wxLANGUAGE_JAPANESE;
121 lang_choice->Append(_(
"Japanese"), lp);
128 *lp = wxLANGUAGE_POLISH;
129 lang_choice->Append(_(
"Polish"), lp);
131 *lp = wxLANGUAGE_PORTUGUESE_BRAZILIAN;
132 lang_choice->Append(_(
"Portuguese (Brazilian)"), lp);
134 *lp = wxLANGUAGE_RUSSIAN;
135 lang_choice->Append(_(
"Russian"), lp);
137 *lp = wxLANGUAGE_SLOVAK;
138 lang_choice->Append(_(
"Slovak"), lp);
145 *lp = wxLANGUAGE_SPANISH;
146 lang_choice->Append(_(
"Spanish"), lp);
148 *lp = wxLANGUAGE_SWEDISH;
149 lang_choice->Append(_(
"Swedish"), lp);
156 *lp = wxLANGUAGE_FINNISH;
157 lang_choice->Append(_(
"Finnish"), lp);
159 *lp = wxLANGUAGE_VALENCIAN;
160 lang_choice->Append(_(
"Valencian (Southern Catalan)"), lp);
161 lang_choice->SetSelection(0);
164 XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl)->AutoCompleteFileNames();
165 XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl)->AutoCompleteFileNames();
166 XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl)->AutoCompleteFileNames();
171 wxStaticText* preview=XRCCTRL(*
this,
"prefs_project_filename_preview", wxStaticText);
172 preview->SetWindowStyle(preview->GetWindowStyle() | wxST_ELLIPSIZE_START);
173 preview=XRCCTRL(*
this,
"prefs_output_filename_preview", wxStaticText);
174 preview->SetWindowStyle(preview->GetWindowStyle() | wxST_ELLIPSIZE_START);
176 XRCCTRL(*
this,
"prefs_misc_tempdir", wxTextCtrl)->AutoCompleteDirectories();
177 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->AutoCompleteFileNames();
178 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->AutoCompleteFileNames();
179 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->AutoCompleteFileNames();
180 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->AutoCompleteFileNames();
182 wxConfigBase* cfg = wxConfigBase::Get();
188 #if defined __APPLE__ && defined __aarch64__
191 wxCheckBox* gpuCheckBox = XRCCTRL(*
this,
"prefs_nona_useGpu", wxCheckBox);
192 gpuCheckBox->Disable();
193 gpuCheckBox->SetValue(
false);
194 cfg->Write(
"/Nona/UseGPU",
false);
203 GetSizer()->SetSizeHints(
this);
235 #if defined __WXMSW__ || defined MAC_SELF_CONTAINED_BUNDLE
239 XRCCTRL(*
this,
"prefs_enblend_Custom", wxCheckBox)->Hide();
243 XRCCTRL(*
this,
"prefs_enblend_enfuseCustom", wxCheckBox)->Hide();
262 wxChoice* lang_choice = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
263 for (
int i = 0; i < (int) lang_choice->GetCount(); i++)
265 delete static_cast<long*
>(lang_choice->GetClientData(i));
274 this->EndModal(wxOK);
289 wxFileDialog dlg(
this,_(
"Select Enblend"),
292 _(
"Executables (*.exe)|*.exe"),
296 wxFD_OPEN, wxDefaultPosition);
297 if (dlg.ShowModal() == wxID_OK)
299 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->SetValue(
306 wxFileDialog dlg(
this,_(
"Select Enfuse"),
309 _(
"Executables (*.exe)|*.exe"),
313 wxFD_OPEN, wxDefaultPosition);
314 if (dlg.ShowModal() == wxID_OK)
316 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->SetValue(
323 wxTextCtrl* ctrl = XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl);
324 wxFileDialog dlg(
this, _(
"Select dcraw"),
"", ctrl->GetValue(),
326 _(
"Executables (*.exe)|*.exe"),
330 wxFD_OPEN, wxDefaultPosition);
331 if (dlg.ShowModal() == wxID_OK)
333 ctrl->SetValue(dlg.GetPath());
339 wxTextCtrl* ctrl = XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl);
340 wxFileDialog dlg(
this, _(
"Select RawTherapee-cli"),
"", ctrl->GetValue(),
342 _(
"Executables (*.exe)|*.exe"),
346 wxFD_OPEN, wxDefaultPosition);
347 if (dlg.ShowModal() == wxID_OK)
349 ctrl->SetValue(dlg.GetPath());
355 wxTextCtrl* ctrl = XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl);
356 wxFileDialog dlg(
this, _(
"Select Darktable-cli"),
"", ctrl->GetValue(),
358 _(
"Executables (*.exe)|*.exe"),
362 wxFD_OPEN, wxDefaultPosition);
363 if (dlg.ShowModal() == wxID_OK)
365 ctrl->SetValue(dlg.GetPath());
372 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(e.IsChecked());
373 XRCCTRL(*
this,
"prefs_enblend_select", wxButton)->Enable(e.IsChecked());
378 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(e.IsChecked());
379 XRCCTRL(*
this,
"prefs_enblend_enfuse_select", wxButton)->Enable(e.IsChecked());
384 wxFileDialog dlg(
this,_(
"Select ExifTool argfile"),
385 wxEmptyString, XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->GetValue(),
386 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
387 wxFD_OPEN, wxDefaultPosition);
388 if (dlg.ShowModal() == wxID_OK)
390 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(
397 wxTextFile defaultFile(sourceFile);
399 wxTextFile newFile(newFilename);
401 if (defaultFile.IsOpened())
403 for (
size_t i = 0; i < defaultFile.GetLineCount(); ++i)
405 newFile.AddLine(defaultFile[i]);
415 wxString filename=XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->GetValue();
416 if(!filename.empty())
418 wxFileName file(filename);
419 file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
422 if( wxMessageBox(wxString::Format(_(
"File %s does not exist.\nShould the argfile be created with default tags?"),filename.c_str()),
423 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this)!=wxYES)
427 filename = file.GetFullPath();
432 filename = file.GetFullPath();
437 if( wxMessageBox(_(
"No file selected.\nShould an argfile be created with default tags?"),
438 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this)!=wxYES)
442 wxFileDialog dlg(
this,_(
"Select new ExifTool argfile"),
443 wxStandardPaths::Get().GetUserConfigDir(), wxEmptyString,
444 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
445 wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
446 if (dlg.ShowModal() != wxID_OK)
450 filename=dlg.GetPath();
453 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(filename);
455 wxXmlResource::Get()->LoadDialog(&edit_dlg,
this,
"pref_edit_argfile");
457 wxTextCtrl* argfileControl=XRCCTRL(edit_dlg,
"pref_edit_textcontrol", wxTextCtrl);
458 argfileControl->LoadFile(filename);
459 if(edit_dlg.ShowModal() == wxID_OK)
461 if(!argfileControl->SaveFile(filename))
463 wxMessageBox(wxString::Format(_(
"Could not save file \"%s\"."), filename.c_str()),
464 _(
"Error"), wxOK | wxICON_ERROR);
472 wxFileDialog dlg(
this, _(
"Select ExifTool argfile"),
473 wxEmptyString, XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->GetValue(),
474 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
475 wxFD_OPEN, wxDefaultPosition);
476 if (dlg.ShowModal() == wxID_OK)
478 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(
485 wxString filename = XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->GetValue();
486 if (!filename.empty())
488 wxFileName file(filename);
489 file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
492 if (wxMessageBox(wxString::Format(_(
"File %s does not exist.\nShould an example argfile be created?"), filename.c_str()),
493 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this) != wxYES)
497 filename = file.GetFullPath();
502 filename = file.GetFullPath();
507 if (wxMessageBox(_(
"No file selected.\nShould an example argfile be created?"),
508 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this) != wxYES)
512 wxFileDialog dlg(
this, _(
"Select new ExifTool argfile"),
513 wxStandardPaths::Get().GetUserConfigDir(), wxEmptyString,
514 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
515 wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
516 if (dlg.ShowModal() != wxID_OK)
520 filename = dlg.GetPath();
523 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(filename);
525 wxXmlResource::Get()->LoadDialog(&edit_dlg,
this,
"pref_edit_argfile_placeholders");
527 wxTextCtrl* argfileControl = XRCCTRL(edit_dlg,
"pref_edit_textcontrol", wxTextCtrl);
528 argfileControl->LoadFile(filename);
529 if (edit_dlg.ShowModal() == wxID_OK)
531 if (!argfileControl->SaveFile(filename))
533 wxMessageBox(wxString::Format(_(
"Could not save file \"%s\"."), filename.c_str()),
534 _(
"Error"), wxOK | wxICON_ERROR);
542 bool copyMetadata=XRCCTRL(*
this,
"pref_exiftool_metadata", wxCheckBox)->GetValue();
543 XRCCTRL(*
this,
"pref_exiftool_argfile_general_label", wxStaticText)->Enable(copyMetadata);
544 XRCCTRL(*
this,
"pref_exiftool_argfile_intermediate_label", wxStaticText)->Enable(copyMetadata);
545 XRCCTRL(*
this,
"pref_exiftool_argfile_label", wxStaticText)->Enable(copyMetadata);
546 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->Enable(copyMetadata);
547 XRCCTRL(*
this,
"pref_exiftool_argfile_choose", wxButton)->Enable(copyMetadata);
548 XRCCTRL(*
this,
"pref_exiftool_argfile_edit", wxButton)->Enable(copyMetadata);
549 XRCCTRL(*
this,
"pref_exiftool_argfile_final_label", wxStaticText)->Enable(copyMetadata);
550 XRCCTRL(*
this,
"pref_exiftool_argfile2_label", wxStaticText)->Enable(copyMetadata);
551 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->Enable(copyMetadata);
552 XRCCTRL(*
this,
"pref_exiftool_argfile2_choose", wxButton)->Enable(copyMetadata);
553 XRCCTRL(*
this,
"pref_exiftool_argfile2_edit", wxButton)->Enable(copyMetadata);
554 XRCCTRL(*
this,
"pref_exiftool_gpano", wxCheckBox)->Enable(copyMetadata);
559 XRCCTRL(*
this,
"prefs_ft_rot_panel", wxPanel)->Enable(enable);
569 wxConfigBase* cfg = wxConfigBase::Get();
571 if (panel==0 || panel == 1)
577 unsigned long mem_high = cfg->Read(
"/ImageCache/UpperBoundHigh", (
long) 0);
580 mem = ((
unsigned long long) mem_high << 32) + mem_low;
591 wxChoice* lang_choice = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
595 for (
int i = 0; i < (int)lang_choice->GetCount(); i++)
597 long lang = *
static_cast<long*
>(lang_choice->GetClientData(i));
606 DEBUG_DEBUG(
"wxChoice language updated:" << curlang);
608 lang_choice->SetSelection(idx);
621 t = cfg->Read(
"CopyLogToClipboard", 0l) == 1;
627 t = cfg->Read(
"/CPEditorPanel/AutoRot", 1l) == 1;
631 MY_STR_VAL(
"pref_raw_dcraw_exe", cfg->Read(
"/RawImportDialog/dcrawExe",
""));
632 MY_STR_VAL(
"pref_raw_rt_exe", cfg->Read(
"/RawImportDialog/RTExe",
""));
633 MY_STR_VAL(
"pref_raw_darktable_exe", cfg->Read(
"/RawImportDialog/DarktableExe",
""));
637 if(panel==0 || panel==2)
640 MY_STR_VAL(
"prefs_misc_tempdir", cfg->Read(
"tempDir",wxEmptyString));
644 filename.Replace(
"/",
"\\",
true);
646 MY_STR_VAL(
"prefs_project_filename", filename);
649 filename.Replace(
"/",
"\\",
true);
651 MY_STR_VAL(
"prefs_output_filename", filename);
654 if (panel==0 || panel == 3)
659 t = cfg->Read(
"/General/IgnoreFovRectilinearOnAdd", 1l) == 1l;
664 cfg->Read(
"/Assistant/panoDownsizeFactor", &factor);
665 MY_SPIN_VAL(
"prefs_ass_panoDownsizeFactor",(
int)(factor*100.0));
672 t = cfg->Read(
"/Assistant/UserDefinedOutputOption", 0l) == 1;
674 wxCommandEvent dummy;
679 if (panel==0 || panel == 4)
685 int val = wxConfigBase::Get()->Read(
"/CPEditorPanel/MagnifierWidth", 61l);
688 XRCCTRL(*
this,
"prefs_misc_magnifier_width", wxChoice)->SetSelection(val);
693 MY_SPIN_VAL(
"prefs_ft_SearchAreaPercent",cfg->Read(
"/Finetune/SearchAreaPercent",
695 MY_SPIN_VAL(
"prefs_ft_LocalSearchWidth", cfg->Read(
"/Finetune/LocalSearchWidth",
719 MY_SPIN_VAL(
"prefs_ft_RotationSteps", cfg->Read(
"/Finetune/RotationSteps",
729 if (panel==0 || panel == 5)
734 if (panel == 0 || panel == 6)
748 const wxString defaultVerdandiArgs = cfg->Read(
"/VerdandiDefaultArgs", wxEmptyString);
749 if (defaultVerdandiArgs.Find(
"--seam=blend") != wxNOT_FOUND)
751 XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->SetSelection(1);
755 XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->SetSelection(0);
771 if (panel == 0 || panel == 7)
776 MY_STR_VAL(
"pref_exiftool_argfile", cfg->Read(
"/output/CopyArgfile", wxEmptyString));
777 MY_STR_VAL(
"pref_exiftool_argfile2", cfg->Read(
"/output/FinalArgfile", wxEmptyString));
780 wxCommandEvent dummy;
783 int nThreads = cfg->Read(
"/output/NumberOfThreads", 0l);
784 MY_SPIN_VAL(
"prefs_output_NumberOfThreads", nThreads);
787 if (panel==0 || panel == 8)
800 MY_STR_VAL(
"prefs_enblend_EnblendExe", cfg->Read(
"/Enblend/Exe",
803 cfg->Read(
"/Enblend/Custom", &customEnblendExe);
804 MY_BOOL_VAL(
"prefs_enblend_Custom", customEnblendExe);
805 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(customEnblendExe);
806 XRCCTRL(*
this,
"prefs_enblend_select", wxButton)->Enable(customEnblendExe);
807 MY_STR_VAL(
"prefs_enblend_EnblendArgs", cfg->Read(
"/Enblend/Args",
811 MY_STR_VAL(
"prefs_enblend_EnfuseExe", cfg->Read(
"/Enfuse/Exe",
814 cfg->Read(
"/Enfuse/Custom", &customEnfuseExe);
815 MY_BOOL_VAL(
"prefs_enblend_enfuseCustom", customEnfuseExe);
816 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(customEnfuseExe);
817 XRCCTRL(*
this,
"prefs_enblend_enfuse_select", wxButton)->Enable(customEnfuseExe);
818 MY_STR_VAL(
"prefs_enblend_EnfuseArgs", cfg->Read(
"/Enfuse/Args",
822 if (panel==0 || panel == 9)
833 t = cfg->Read(
"/ShowSaveMessage", 1l) == 1;
835 t = cfg->Read(
"/ShowExposureWarning", 1l) == 1;
837 t = cfg->Read(
"/ShowFisheyeCropHint", 1l) == 1;
839 MY_CHOICE_VAL(
"pref_editcp_action", cfg->Read(
"/EditCPAfterAction", 0l));
846 wxConfigBase* cfg = wxConfigBase::Get();
848 wxNotebook* noteb = XRCCTRL(*
this,
"prefs_tab", wxNotebook);
849 int really = wxMessageBox(_(
"Really reset displayed preferences to default values?"), _(
"Load Defaults"),
851 if ( really == wxYES)
853 if (noteb->GetSelection() == 0)
870 cfg->Write(
"CopyLogToClipboard", 0l);
873 cfg->Write(
"/CPEditorPanel/AutoRot", 1l);
875 cfg->Write(
"/RawImportDialog/dcrawExe",
"");
876 cfg->Write(
"/RawImportDialog/RTExe",
"");
877 cfg->Write(
"/RawImportDialog/DarktableExe",
"");
879 if(noteb->GetSelection() == 1)
881 cfg->Write(
"tempDir", wxEmptyString);
885 if (noteb->GetSelection() == 2)
888 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", 1l);
894 cfg->Write(
"/Assistant/UserDefinedOutputOption", 0l);
896 if (noteb->GetSelection() == 3)
901 cfg->Write(
"/CPEditorPanel/MagnifierWidth", 61l);
915 if (noteb->GetSelection() == 4)
922 if (noteb->GetSelection() == 5)
932 cfg->Write(
"/VerdandiDefaultArgs", wxEmptyString);
939 if (noteb->GetSelection() == 6)
942 cfg->Write(
"/output/CopyArgfile", wxEmptyString);
943 cfg->Write(
"/output/FinalArgfile", wxEmptyString);
945 cfg->Write(
"/output/NumberOfThreads", 0l);
947 if (noteb->GetSelection() == 7)
959 if (noteb->GetSelection() == 8)
965 cfg->Write(
"/ShowSaveMessage", 1l);
966 cfg->Write(
"/ShowExposureWarning", 1l);
967 cfg->Write(
"/ShowFisheyeCropHint", 1l);
968 cfg->Write(
"/EditCPAfterAction", 0l);
985 wxConfigBase* cfg = wxConfigBase::Get();
987 cfg->Write(
"/Assistant/autoAlign",
MY_G_BOOL_VAL(
"prefs_ass_autoAlign"));
988 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", !
MY_G_BOOL_VAL(
"prefs_ass_loadFovRectilinear"));
989 cfg->Write(
"/Assistant/nControlPoints",
MY_G_SPIN_VAL(
"prefs_ass_nControlPoints"));
990 cfg->Write(
"/Assistant/panoDownsizeFactor",
MY_G_SPIN_VAL(
"prefs_ass_panoDownsizeFactor") / 100.0);
991 cfg->Write(
"/Assistant/Linefind",
MY_G_BOOL_VAL(
"prefs_ass_linefind"));
992 cfg->Write(
"/Celeste/Auto",
MY_G_BOOL_VAL(
"prefs_celeste_auto"));
993 cfg->Write(
"/Assistant/AutoCPClean",
MY_G_BOOL_VAL(
"prefs_auto_cpclean"));
994 cfg->Write(
"/Assistant/UserDefinedOutputOption",
MY_G_BOOL_VAL(
"pref_ass_output"));
997 cfg->Write(
"/ImageCache/Mapping",
MY_G_CHOICE_VAL(
"prefs_misc_hdr_mapping"));
999 cfg->Write(
"/CPEditorPanel/MagnifierWidth",
MY_G_CHOICE_VAL(
"prefs_misc_magnifier_width") * 20 + 61l);
1002 cfg->Write(
"/Finetune/SearchAreaPercent",
MY_G_SPIN_VAL(
"prefs_ft_SearchAreaPercent"));
1003 cfg->Write(
"/Finetune/TemplateSize",
MY_G_SPIN_VAL(
"prefs_ft_TemplateSize"));
1004 cfg->Write(
"/Finetune/LocalSearchWidth",
MY_G_SPIN_VAL(
"prefs_ft_LocalSearchWidth"));
1008 cfg->Write(
"/Finetune/CorrThreshold", td);
1013 cfg->Write(
"/Finetune/CurvThreshold", td);
1015 cfg->Write(
"/Finetune/RotationSearch",
MY_G_BOOL_VAL(
"prefs_ft_RotationSearch"));
1016 cfg->Write(
"/Finetune/RotationStartAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStartAngle"));
1017 cfg->Write(
"/Finetune/RotationStopAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStopAngle"));
1018 cfg->Write(
"/Finetune/RotationSteps",
MY_G_SPIN_VAL(
"prefs_ft_RotationSteps"));
1025 cfg->Write(
"/ImageCache/UpperBoundHigh", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") >> 12);
1027 cfg->Write(
"/ImageCache/UpperBound", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") << 20);
1030 wxChoice* lang = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
1035 void* tmplp = lang->GetClientData(lang->GetSelection());
1036 long templ = *
static_cast<long*
>(tmplp);
1037 cfg->Write(
"language", templ);
1038 DEBUG_INFO(
"Language Selection ID: " << templ);
1041 cfg->Write(
"CopyLogToClipboard",
MY_G_BOOL_VAL(
"prefs_copy_log"));
1043 cfg->Write(
"/GLPreviewFrame/ShowProjectionHints",
MY_G_BOOL_VAL(
"pref_show_projection_hints"));
1045 cfg->Write(
"/CPEditorPanel/AutoRot",
MY_G_BOOL_VAL(
"pref_autorotate"));
1047 cfg->Write(
"/RawImportDialog/dcrawExe",
MY_G_STR_VAL(
"pref_raw_dcraw_exe"));
1048 cfg->Write(
"/RawImportDialog/RTExe",
MY_G_STR_VAL(
"pref_raw_rt_exe"));
1049 cfg->Write(
"/RawImportDialog/DarktableExe",
MY_G_STR_VAL(
"pref_raw_darktable_exe"));;
1051 cfg->Write(
"tempDir",
MY_G_STR_VAL(
"prefs_misc_tempdir"));
1053 wxString filename=XRCCTRL(*
this,
"prefs_project_filename", wxTextCtrl)->GetValue();
1055 filename.Replace(
"\\",
"/",
true);
1057 cfg->Write(
"ProjectFilename", filename);
1058 filename=XRCCTRL(*
this,
"prefs_output_filename", wxTextCtrl)->GetValue();
1060 filename.Replace(
"\\",
"/",
true);
1062 cfg->Write(
"OutputFilename", filename);
1069 cfg->Write(
"/output/ldr_format",
MY_G_CHOICE_VAL(
"pref_ldr_output_file_format"));
1072 cfg->Write(
"/output/tiff_compression",
MY_G_CHOICE_VAL(
"pref_tiff_compression"));
1073 cfg->Write(
"/output/jpeg_quality",
MY_G_SPIN_VAL(
"pref_jpeg_quality"));
1075 cfg->Write(
"/default_blender", static_cast<long>(
GetSelectedValue(XRCCTRL(*
this,
"pref_default_blender", wxChoice))));
1076 if (XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->GetSelection() == 1)
1078 cfg->Write(
"/VerdandiDefaultArgs",
"--seam=blend");
1082 cfg->Write(
"/VerdandiDefaultArgs", wxEmptyString);
1088 cfg->Write(
"/Processor/start",
MY_G_BOOL_VAL(
"pref_processor_start"));
1089 cfg->Write(
"/Processor/overwrite",
MY_G_BOOL_VAL(
"pref_processor_overwrite"));
1090 cfg->Write(
"/Processor/verbose",
MY_G_BOOL_VAL(
"pref_processor_verbose"));
1092 cfg->Write(
"/output/useExiftool",
MY_G_BOOL_VAL(
"pref_exiftool_metadata"));
1093 cfg->Write(
"/output/CopyArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile"));
1094 cfg->Write(
"/output/FinalArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile2"));
1095 cfg->Write(
"/output/writeGPano",
MY_G_BOOL_VAL(
"pref_exiftool_gpano"));
1096 cfg->Write(
"/output/NumberOfThreads",
MY_G_SPIN_VAL(
"prefs_output_NumberOfThreads"));
1099 cfg->Write(
"/Nona/Interpolator",
MY_G_CHOICE_VAL(
"prefs_nona_interpolator"));
1100 cfg->Write(
"/Nona/CroppedImages",
MY_G_BOOL_VAL(
"prefs_nona_createCroppedImages"));
1101 cfg->Write(
"/Nona/UseGPU",
MY_G_BOOL_VAL(
"prefs_nona_useGpu"));
1105 cfg->Write(
"/Enblend/Custom",
MY_G_BOOL_VAL(
"prefs_enblend_Custom"));
1106 cfg->Write(
"/Enblend/Exe",
MY_G_STR_VAL(
"prefs_enblend_EnblendExe"));
1107 cfg->Write(
"/Enblend/Args",
MY_G_STR_VAL(
"prefs_enblend_EnblendArgs"));
1109 cfg->Write(
"/Enfuse/Custom",
MY_G_BOOL_VAL(
"prefs_enblend_enfuseCustom"));
1110 cfg->Write(
"/Enfuse/Exe",
MY_G_STR_VAL(
"prefs_enblend_EnfuseExe"));
1111 cfg->Write(
"/Enfuse/Args",
MY_G_STR_VAL(
"prefs_enblend_EnfuseArgs"));
1117 cfg->Write(
"/Celeste/Threshold", td);
1118 cfg->Write(
"/Celeste/Filter",
MY_G_CHOICE_VAL(
"prefs_celeste_filter"));
1120 cfg->Write(
"/OptimizePhotometric/nRandomPointsPerImage",
MY_G_SPIN_VAL(
"prefs_photo_optimizer_nr_points"));
1121 cfg->Write(
"/ShowSaveMessage",
MY_G_BOOL_VAL(
"prefs_warning_save"));
1122 cfg->Write(
"/ShowExposureWarning",
MY_G_BOOL_VAL(
"prefs_warning_exposure"));
1123 cfg->Write(
"/ShowFisheyeCropHint",
MY_G_BOOL_VAL(
"prefs_warning_fisheye_crop"));
1124 cfg->Write(
"/EditCPAfterAction",
MY_G_CHOICE_VAL(
"pref_editcp_action"));
1133 if(cpdetector_dlg.ShowModal()==wxOK)
1146 if (selection == wxNOT_FOUND)
1148 wxMessageBox(_(
"Please select an entry first"),_(
"Select Entry"),wxOK |
1149 wxICON_EXCLAMATION,
this);
1154 if(autopano_dlg.ShowModal()==wxOK)
1168 wxMessageBox(_(
"You can't delete the last setting.\nAt least one setting is required."),_(
"Warning"),wxOK | wxICON_EXCLAMATION,
this);
1172 if(wxMessageBox(wxString::Format(_(
"Do you really want to remove control point detector setting \"%s\"?"),
cpdetector_config_edit.
settings[selection].GetCPDetectorDesc().c_str())
1173 ,_(
"Delete control point detector setting"),wxYES_NO | wxICON_QUESTION,
this)==wxYES)
1204 if(selection<m_CPDetectorList->GetCount()-1)
1225 wxFileDialog dlg(
this,_(
"Load control point detector settings"),
1226 wxConfigBase::Get()->Read(
"/actualPath",wxEmptyString), wxEmptyString,
1227 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1228 if (dlg.ShowModal() == wxID_OK)
1230 wxConfig::Get()->Write(
"/actualPath", dlg.GetDirectory());
1231 wxString fn = dlg.GetPath();
1240 wxFileDialog dlg(
this,_(
"Save control point detector settings"),
1241 wxConfigBase::Get()->Read(
"/actualPath",wxEmptyString), wxEmptyString,
1242 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1243 if (dlg.ShowModal() == wxID_OK)
1245 wxConfig::Get()->Write(
"/actualPath", dlg.GetDirectory());
1246 wxString fn = dlg.GetPath();
1250 if(fn.Right(8)!=
".setting")
1252 fn.Append(
".setting");
1267 XRCCTRL(*
this,
"pref_tiff_compression_label",wxStaticText)->Show(i==0);
1268 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->Show(i==0);
1269 XRCCTRL(*
this,
"pref_jpeg_quality_label",wxStaticText)->Show(i==1);
1270 XRCCTRL(*
this,
"pref_jpeg_quality",wxSpinCtrl)->Show(i==1);
1271 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->GetParent()->Layout();
1282 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->Enable(i==0);
1283 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->Enable(i==0);
1289 wxConfigBase* config=wxConfigBase::Get();
1290 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(config->Read(
"/Processor/start",
HUGIN_PROCESSOR_START) == 1);
1291 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(config->Read(
"/Processor/verbose",
HUGIN_PROCESSOR_VERBOSE) == 1);
1296 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(
true);
1297 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(
true);
1310 XRCCTRL(*
this,
"pref_internal_blender_seam_label", wxStaticText)->Show(blender == 1);
1311 wxChoice* seamChoice = XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice);
1312 seamChoice->Show(blender == 1);
1313 seamChoice->Enable(blender == 1);
1318 XRCCTRL(*
this,
"prefs_project_filename_preview", wxStaticText)->SetLabel(
1325 XRCCTRL(*
this,
"prefs_output_filename_preview", wxStaticText)->SetLabel(
1333 XRCCTRL(*
this,
"pref_ass_change_output", wxButton)->Enable(XRCCTRL(*
this,
"pref_ass_output", wxCheckBox)->IsChecked());
void DisplayHelp(wxString section=wxEmptyString)
call help browser with given file
void UpdateFields(CPDetectorConfig *cpdet_config, int index)
updates edit fields with values from settings
#define HUGIN_SHOW_PROJECTION_HINTS
Definition of dialog for editing user-defined output ini file.
wxString GetDataPath()
return path to data directory, it depends on operating system
void OnExifArgfileChoose(wxCommandEvent &e)
virtual ~PreferencesDialog()
dtor.
void OnHelp(wxCommandEvent &e)
#define HUGIN_NONA_CROPPEDIMAGES
#define HUGIN_DEFAULT_OUTPUT_NAME
void Read(wxConfigBase *config=wxConfigBase::Get(), wxString loadFromFile=wxEmptyString)
read the settings of different cp generators from config
void Swap(int index)
swaps setting which index and index+1
#define HUGIN_FT_LOCAL_SEARCH_WIDTH
#define HUGIN_FT_SEARCH_AREA_PERCENT
#define MY_G_BOOL_VAL(id)
void OnEnfuseExe(wxCommandEvent &e)
#define MY_BOOL_VAL(id, val)
#define HUGIN_JPEG_QUALITY
#define HUGIN_FT_CURV_THRESHOLD
#define HUGIN_FT_ROTATION_STEPS
#define HUGIN_EXIFTOOL_CREATE_GPANO
unsigned int GetCount()
return counts of cp detector settings
void OnUpdateProjectFilename(wxCommandEvent &e)
event handler to update preview for project filename
void OnCPDetectorDelete(wxCommandEvent &e)
wxString doubleTowxString(double d, int digits)
#define HUGIN_USE_EXIFTOOL
void OnExifArgfile2Edit(wxCommandEvent &e)
void OnCustomEnblend(wxCommandEvent &e)
include file for the hugin project
#define HUGIN_ENBLEND_EXE_CUSTOM
void OnEnblendExe(wxCommandEvent &e)
void UpdateBlenderControls()
static huginApp * Get()
hack.. kind of a pseudo singleton...
dialog for input settings of one autopano generator
PreferencesDialog(wxWindow *parent)
ctor.
void UpdateDisplayData(int panel)
Config to Window.
ArraySettings settings
array which stores the different autopano settings
void FillControl(wxControlWithItems *control, bool select_default=false, bool show_default=false)
fills a wxControlWithItems with the available generators
void OnCPDetectorMoveDown(wxCommandEvent &e)
#define HUGIN_IMGCACHE_UPPERBOUND
void OnExifTool(wxCommandEvent &e)
#define HUGIN_FT_TEMPLATE_SIZE
class, which stores all settings of one cp detector
void OnCPDetectorDefault(wxCommandEvent &e)
void CreateNewArgFile(const wxString &newFilename, const wxString &sourceFile)
CPDetectorConfig cpdetector_config_edit
static MainFrame * Get()
hack.. kind of a pseudo singleton...
void OnCPDetectorEdit(wxCommandEvent &e)
#define HUGIN_CELESTE_FILTER
#define HUGIN_CELESTE_THRESHOLD
#define HUGIN_NONA_INTERPOLATOR
#define HUGIN_TIFF_COMPRESSION
void OnRestoreDefaults(wxCommandEvent &e)
void UpdateFileFormatControls()
void OnChangeUserDefinedOutputOptions(wxCommandEvent &e)
#define HUGIN_NONA_USEGPU
Dialog for editing user defined output settings (ini file)
#define HUGIN_PROCESSOR_START
void WriteToFile(wxString filename)
exporth the cp detector settings to external file
#define MY_STR_VAL(id, val)
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
#define HUGIN_DEFAULT_PROJECT_NAME
void UpdateProcessorControls()
#define HUGIN_ENFUSE_EXE_CUSTOM
#define HUGIN_LDR_OUTPUT_FORMAT
#define HUGIN_ASS_AUTO_ALIGN
void ReadFromFile(wxString filename)
import the cp detector settings from external file
void UpdateConfigData()
Window to Config.
void OnUpdateOutputFilename(wxCommandEvent &e)
event handler to update preview for project filename
#define MY_CHOICE_VAL(id, val)
#define HUGIN_PROCESSOR_OVERWRITE
void OnCPDetectorMoveUp(wxCommandEvent &e)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
#define HUGIN_ASS_LINEFIND
#define HUGIN_FT_ROTATION_START_ANGLE
void OnExifArgfile2Choose(wxCommandEvent &e)
void OnDarktableExe(wxCommandEvent &e)
include file for the hugin project
void EnableRotationCtrls(bool enable)
#define MY_G_CHOICE_VAL(id)
void OnRawTherapeeExe(wxCommandEvent &e)
#define HUGIN_FT_CORR_THRESHOLD
void OnCustomEnfuse(wxCommandEvent &e)
void OnExifArgfileEdit(wxCommandEvent &e)
void OnUserDefinedOutputOptionsCheckBox(wxCommandEvent &e)
#define HUGIN_ENFUSE_ARGS
unsigned int GetDefaultGenerator()
return index of default generator (this one is used for assistent)
#define HUGIN_ASS_PANO_DOWNSIZE_FACTOR
void OnBlenderChanged(wxCommandEvent &e)
event handler if blender was changed
functions for interaction with the hugin configuration file
void OnFileFormatChanged(wxCommandEvent &e)
event handler if default file format was changed
#define HUGIN_ASS_AUTO_CPCLEAN
#define HUGIN_IMGCACHE_MAPPING_FLOAT
#define HUGIN_PROCESSOR_GUI
void OnCPDetectorLoad(wxCommandEvent &e)
event handler for loading cp detector settings
#define HUGIN_PROCESSOR_VERBOSE
void Write(wxConfigBase *config=wxConfigBase::Get())
writes the settings of different cp generators to config
#define HUGIN_ASS_NCONTROLPOINTS
void OnOk(wxCommandEvent &e)
wxListBox * m_CPDetectorList
wxString getDefaultOutputName(const wxString projectname, const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default output prefix, based on filename and images in project the setting is read from the ...
void UpdateSettings(CPDetectorConfig *cpdet_config, int index)
return inputed settings
#define MY_SPIN_VAL(id, val)
#define MY_G_SPIN_VAL(id)
void OnRotationCheckBox(wxCommandEvent &e)
#define HUGIN_ENBLEND_ARGS
#define HUGIN_PHOTOMETRIC_OPTIMIZER_NRPOINTS
#define HUGIN_FT_ROTATION_STOP_ANGLE
#define HUGIN_ENBLEND_EXE
#define HUGIN_DEFAULT_BLENDER
void OnDcrawExe(wxCommandEvent &e)
void SetDefaultGenerator(unsigned int new_default_generator)
sets new default generator, which is used by assistent
wxString getDefaultProjectName(const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default project name, as defined in the preferences
declaration of CPDetectorDialog class, which are for storing and changing settings of different autop...
#define HUGIN_FT_ROTATION_SEARCH
void OnCPDetectorAdd(wxCommandEvent &e)
#define HUGIN_CELESTE_AUTO
void OnProcessorChanged(wxCommandEvent &e)
event handler if processor was changed
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
void OnCPDetectorSave(wxCommandEvent &e)
event handler for saving cp detector settings