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 (
hugin_utils::HuginMessageBox(wxString::Format(_(
"Argfile %s does not exist.\nShould the argfile be created with default tags?"), filename),
423 _(
"Hugin"), wxYES_NO | wxICON_EXCLAMATION,
this) != wxYES)
427 filename = file.GetFullPath();
432 filename = file.GetFullPath();
438 _(
"Hugin"), 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))
464 _(
"Hugin"), wxOK | wxICON_ERROR,
this);
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);
493 _(
"Hugin"), wxYES_NO | wxICON_EXCLAMATION,
this) != wxYES)
497 filename = file.GetFullPath();
502 filename = file.GetFullPath();
508 _(
"Hugin"), 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))
534 _(
"Hugin"), wxOK | wxICON_ERROR,
this);
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 if (
hugin_utils::HuginMessageBox(_(
"Really reset displayed preferences to default values?"), _(
"Hugin"), wxYES_NO | wxICON_QUESTION,
this) == wxYES)
851 if (noteb->GetSelection() == 0)
868 cfg->Write(
"CopyLogToClipboard", 0l);
871 cfg->Write(
"/CPEditorPanel/AutoRot", 1l);
873 cfg->Write(
"/RawImportDialog/dcrawExe",
"");
874 cfg->Write(
"/RawImportDialog/RTExe",
"");
875 cfg->Write(
"/RawImportDialog/DarktableExe",
"");
877 if(noteb->GetSelection() == 1)
879 cfg->Write(
"tempDir", wxEmptyString);
883 if (noteb->GetSelection() == 2)
886 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", 1l);
892 cfg->Write(
"/Assistant/UserDefinedOutputOption", 0l);
894 if (noteb->GetSelection() == 3)
899 cfg->Write(
"/CPEditorPanel/MagnifierWidth", 61l);
913 if (noteb->GetSelection() == 4)
920 if (noteb->GetSelection() == 5)
930 cfg->Write(
"/VerdandiDefaultArgs", wxEmptyString);
937 if (noteb->GetSelection() == 6)
940 cfg->Write(
"/output/CopyArgfile", wxEmptyString);
941 cfg->Write(
"/output/FinalArgfile", wxEmptyString);
943 cfg->Write(
"/output/NumberOfThreads", 0l);
945 if (noteb->GetSelection() == 7)
957 if (noteb->GetSelection() == 8)
963 cfg->Write(
"/ShowSaveMessage", 1l);
964 cfg->Write(
"/ShowExposureWarning", 1l);
965 cfg->Write(
"/ShowFisheyeCropHint", 1l);
966 cfg->Write(
"/EditCPAfterAction", 0l);
983 wxConfigBase* cfg = wxConfigBase::Get();
985 cfg->Write(
"/Assistant/autoAlign",
MY_G_BOOL_VAL(
"prefs_ass_autoAlign"));
986 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", !
MY_G_BOOL_VAL(
"prefs_ass_loadFovRectilinear"));
987 cfg->Write(
"/Assistant/nControlPoints",
MY_G_SPIN_VAL(
"prefs_ass_nControlPoints"));
988 cfg->Write(
"/Assistant/panoDownsizeFactor",
MY_G_SPIN_VAL(
"prefs_ass_panoDownsizeFactor") / 100.0);
989 cfg->Write(
"/Assistant/Linefind",
MY_G_BOOL_VAL(
"prefs_ass_linefind"));
990 cfg->Write(
"/Celeste/Auto",
MY_G_BOOL_VAL(
"prefs_celeste_auto"));
991 cfg->Write(
"/Assistant/AutoCPClean",
MY_G_BOOL_VAL(
"prefs_auto_cpclean"));
992 cfg->Write(
"/Assistant/UserDefinedOutputOption",
MY_G_BOOL_VAL(
"pref_ass_output"));
995 cfg->Write(
"/ImageCache/Mapping",
MY_G_CHOICE_VAL(
"prefs_misc_hdr_mapping"));
997 cfg->Write(
"/CPEditorPanel/MagnifierWidth",
MY_G_CHOICE_VAL(
"prefs_misc_magnifier_width") * 20 + 61l);
1000 cfg->Write(
"/Finetune/SearchAreaPercent",
MY_G_SPIN_VAL(
"prefs_ft_SearchAreaPercent"));
1001 cfg->Write(
"/Finetune/TemplateSize",
MY_G_SPIN_VAL(
"prefs_ft_TemplateSize"));
1002 cfg->Write(
"/Finetune/LocalSearchWidth",
MY_G_SPIN_VAL(
"prefs_ft_LocalSearchWidth"));
1006 cfg->Write(
"/Finetune/CorrThreshold", td);
1011 cfg->Write(
"/Finetune/CurvThreshold", td);
1013 cfg->Write(
"/Finetune/RotationSearch",
MY_G_BOOL_VAL(
"prefs_ft_RotationSearch"));
1014 cfg->Write(
"/Finetune/RotationStartAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStartAngle"));
1015 cfg->Write(
"/Finetune/RotationStopAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStopAngle"));
1016 cfg->Write(
"/Finetune/RotationSteps",
MY_G_SPIN_VAL(
"prefs_ft_RotationSteps"));
1023 cfg->Write(
"/ImageCache/UpperBoundHigh", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") >> 12);
1025 cfg->Write(
"/ImageCache/UpperBound", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") << 20);
1028 wxChoice* lang = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
1033 void* tmplp = lang->GetClientData(lang->GetSelection());
1034 long templ = *
static_cast<long*
>(tmplp);
1035 cfg->Write(
"language", templ);
1036 DEBUG_INFO(
"Language Selection ID: " << templ);
1039 cfg->Write(
"CopyLogToClipboard",
MY_G_BOOL_VAL(
"prefs_copy_log"));
1041 cfg->Write(
"/GLPreviewFrame/ShowProjectionHints",
MY_G_BOOL_VAL(
"pref_show_projection_hints"));
1043 cfg->Write(
"/CPEditorPanel/AutoRot",
MY_G_BOOL_VAL(
"pref_autorotate"));
1045 cfg->Write(
"/RawImportDialog/dcrawExe",
MY_G_STR_VAL(
"pref_raw_dcraw_exe"));
1046 cfg->Write(
"/RawImportDialog/RTExe",
MY_G_STR_VAL(
"pref_raw_rt_exe"));
1047 cfg->Write(
"/RawImportDialog/DarktableExe",
MY_G_STR_VAL(
"pref_raw_darktable_exe"));;
1049 cfg->Write(
"tempDir",
MY_G_STR_VAL(
"prefs_misc_tempdir"));
1051 wxString filename=XRCCTRL(*
this,
"prefs_project_filename", wxTextCtrl)->GetValue();
1053 filename.Replace(
"\\",
"/",
true);
1055 cfg->Write(
"ProjectFilename", filename);
1056 filename=XRCCTRL(*
this,
"prefs_output_filename", wxTextCtrl)->GetValue();
1058 filename.Replace(
"\\",
"/",
true);
1060 cfg->Write(
"OutputFilename", filename);
1067 cfg->Write(
"/output/ldr_format",
MY_G_CHOICE_VAL(
"pref_ldr_output_file_format"));
1070 cfg->Write(
"/output/tiff_compression",
MY_G_CHOICE_VAL(
"pref_tiff_compression"));
1071 cfg->Write(
"/output/jpeg_quality",
MY_G_SPIN_VAL(
"pref_jpeg_quality"));
1073 cfg->Write(
"/default_blender", static_cast<long>(
GetSelectedValue(XRCCTRL(*
this,
"pref_default_blender", wxChoice))));
1074 if (XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->GetSelection() == 1)
1076 cfg->Write(
"/VerdandiDefaultArgs",
"--seam=blend");
1080 cfg->Write(
"/VerdandiDefaultArgs", wxEmptyString);
1086 cfg->Write(
"/Processor/start",
MY_G_BOOL_VAL(
"pref_processor_start"));
1087 cfg->Write(
"/Processor/overwrite",
MY_G_BOOL_VAL(
"pref_processor_overwrite"));
1088 cfg->Write(
"/Processor/verbose",
MY_G_BOOL_VAL(
"pref_processor_verbose"));
1090 cfg->Write(
"/output/useExiftool",
MY_G_BOOL_VAL(
"pref_exiftool_metadata"));
1091 cfg->Write(
"/output/CopyArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile"));
1092 cfg->Write(
"/output/FinalArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile2"));
1093 cfg->Write(
"/output/writeGPano",
MY_G_BOOL_VAL(
"pref_exiftool_gpano"));
1094 cfg->Write(
"/output/NumberOfThreads",
MY_G_SPIN_VAL(
"prefs_output_NumberOfThreads"));
1097 cfg->Write(
"/Nona/Interpolator",
MY_G_CHOICE_VAL(
"prefs_nona_interpolator"));
1098 cfg->Write(
"/Nona/CroppedImages",
MY_G_BOOL_VAL(
"prefs_nona_createCroppedImages"));
1099 cfg->Write(
"/Nona/UseGPU",
MY_G_BOOL_VAL(
"prefs_nona_useGpu"));
1103 cfg->Write(
"/Enblend/Custom",
MY_G_BOOL_VAL(
"prefs_enblend_Custom"));
1104 cfg->Write(
"/Enblend/Exe",
MY_G_STR_VAL(
"prefs_enblend_EnblendExe"));
1105 cfg->Write(
"/Enblend/Args",
MY_G_STR_VAL(
"prefs_enblend_EnblendArgs"));
1107 cfg->Write(
"/Enfuse/Custom",
MY_G_BOOL_VAL(
"prefs_enblend_enfuseCustom"));
1108 cfg->Write(
"/Enfuse/Exe",
MY_G_STR_VAL(
"prefs_enblend_EnfuseExe"));
1109 cfg->Write(
"/Enfuse/Args",
MY_G_STR_VAL(
"prefs_enblend_EnfuseArgs"));
1115 cfg->Write(
"/Celeste/Threshold", td);
1116 cfg->Write(
"/Celeste/Filter",
MY_G_CHOICE_VAL(
"prefs_celeste_filter"));
1118 cfg->Write(
"/OptimizePhotometric/nRandomPointsPerImage",
MY_G_SPIN_VAL(
"prefs_photo_optimizer_nr_points"));
1119 cfg->Write(
"/ShowSaveMessage",
MY_G_BOOL_VAL(
"prefs_warning_save"));
1120 cfg->Write(
"/ShowExposureWarning",
MY_G_BOOL_VAL(
"prefs_warning_exposure"));
1121 cfg->Write(
"/ShowFisheyeCropHint",
MY_G_BOOL_VAL(
"prefs_warning_fisheye_crop"));
1122 cfg->Write(
"/EditCPAfterAction",
MY_G_CHOICE_VAL(
"pref_editcp_action"));
1131 if(cpdetector_dlg.ShowModal()==wxOK)
1144 if (selection == wxNOT_FOUND)
1151 if(autopano_dlg.ShowModal()==wxOK)
1165 hugin_utils::HuginMessageBox(_(
"You can't delete the last setting.\nAt least one setting is required."), _(
"Hugin"), wxOK | wxICON_EXCLAMATION,
this);
1170 _(
"Hugin"), wxYES_NO | wxICON_QUESTION,
this) == wxYES)
1201 if(selection<m_CPDetectorList->GetCount()-1)
1222 wxFileDialog dlg(
this,_(
"Load control point detector settings"),
1223 wxConfigBase::Get()->Read(
"/actualPath",wxEmptyString), wxEmptyString,
1224 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1225 if (dlg.ShowModal() == wxID_OK)
1227 wxConfig::Get()->Write(
"/actualPath", dlg.GetDirectory());
1228 wxString fn = dlg.GetPath();
1237 wxFileDialog dlg(
this,_(
"Save control point detector settings"),
1238 wxConfigBase::Get()->Read(
"/actualPath",wxEmptyString), wxEmptyString,
1239 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1240 if (dlg.ShowModal() == wxID_OK)
1242 wxConfig::Get()->Write(
"/actualPath", dlg.GetDirectory());
1243 wxString fn = dlg.GetPath();
1247 if(fn.Right(8)!=
".setting")
1249 fn.Append(
".setting");
1264 XRCCTRL(*
this,
"pref_tiff_compression_label",wxStaticText)->Show(i==0);
1265 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->Show(i==0);
1266 XRCCTRL(*
this,
"pref_jpeg_quality_label",wxStaticText)->Show(i==1);
1267 XRCCTRL(*
this,
"pref_jpeg_quality",wxSpinCtrl)->Show(i==1);
1268 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->GetParent()->Layout();
1279 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->Enable(i==0);
1280 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->Enable(i==0);
1286 wxConfigBase* config=wxConfigBase::Get();
1287 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(config->Read(
"/Processor/start",
HUGIN_PROCESSOR_START) == 1);
1288 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(config->Read(
"/Processor/verbose",
HUGIN_PROCESSOR_VERBOSE) == 1);
1293 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(
true);
1294 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(
true);
1307 XRCCTRL(*
this,
"pref_internal_blender_seam_label", wxStaticText)->Show(blender == 1);
1308 wxChoice* seamChoice = XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice);
1309 seamChoice->Show(blender == 1);
1310 seamChoice->Enable(blender == 1);
1315 XRCCTRL(*
this,
"prefs_project_filename_preview", wxStaticText)->SetLabel(
1322 XRCCTRL(*
this,
"prefs_output_filename_preview", wxStaticText)->SetLabel(
1330 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 RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void Swap(int index)
swaps setting which index and index+1
#define HUGIN_FT_LOCAL_SEARCH_WIDTH
#define HUGIN_FT_SEARCH_AREA_PERCENT
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
#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)
#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)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
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 OnCPDetectorSave(wxCommandEvent &e)
event handler for saving cp detector settings