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);
596 for (
int i = 0; i < (int)lang_choice->GetCount(); i++)
598 long lang = *
static_cast<long*
>(lang_choice->GetClientData(i));
604 if (lang == wxLANGUAGE_DEFAULT)
611 DEBUG_DEBUG(
"wxChoice language updated:" << curlang);
613 lang_choice->SetSelection(idx);
620 lang_choice->SetSelection(idxDefault);
628 t = cfg->Read(
"CopyLogToClipboard", 0l) == 1;
634 t = cfg->Read(
"/CPEditorPanel/AutoRot", 1l) == 1;
638 MY_STR_VAL(
"pref_raw_dcraw_exe", cfg->Read(
"/RawImportDialog/dcrawExe",
""));
639 MY_STR_VAL(
"pref_raw_rt_exe", cfg->Read(
"/RawImportDialog/RTExe",
""));
640 MY_STR_VAL(
"pref_raw_darktable_exe", cfg->Read(
"/RawImportDialog/DarktableExe",
""));
644 if(panel==0 || panel==2)
647 MY_STR_VAL(
"prefs_misc_tempdir", cfg->Read(
"tempDir",wxEmptyString));
651 filename.Replace(
"/",
"\\",
true);
653 MY_STR_VAL(
"prefs_project_filename", filename);
656 filename.Replace(
"/",
"\\",
true);
658 MY_STR_VAL(
"prefs_output_filename", filename);
661 if (panel==0 || panel == 3)
666 t = cfg->Read(
"/General/IgnoreFovRectilinearOnAdd", 1l) == 1l;
671 cfg->Read(
"/Assistant/panoDownsizeFactor", &factor);
672 MY_SPIN_VAL(
"prefs_ass_panoDownsizeFactor",(
int)(factor*100.0));
679 t = cfg->Read(
"/Assistant/UserDefinedOutputOption", 0l) == 1;
681 wxCommandEvent dummy;
686 if (panel==0 || panel == 4)
692 int val = wxConfigBase::Get()->Read(
"/CPEditorPanel/MagnifierWidth", 61l);
695 XRCCTRL(*
this,
"prefs_misc_magnifier_width", wxChoice)->SetSelection(val);
700 MY_SPIN_VAL(
"prefs_ft_SearchAreaPercent",cfg->Read(
"/Finetune/SearchAreaPercent",
702 MY_SPIN_VAL(
"prefs_ft_LocalSearchWidth", cfg->Read(
"/Finetune/LocalSearchWidth",
726 MY_SPIN_VAL(
"prefs_ft_RotationSteps", cfg->Read(
"/Finetune/RotationSteps",
736 if (panel==0 || panel == 5)
741 if (panel == 0 || panel == 6)
755 const wxString defaultVerdandiArgs = cfg->Read(
"/VerdandiDefaultArgs", wxEmptyString);
756 if (defaultVerdandiArgs.Find(
"--seam=blend") != wxNOT_FOUND)
758 XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->SetSelection(1);
762 XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->SetSelection(0);
778 if (panel == 0 || panel == 7)
783 MY_STR_VAL(
"pref_exiftool_argfile", cfg->Read(
"/output/CopyArgfile", wxEmptyString));
784 MY_STR_VAL(
"pref_exiftool_argfile2", cfg->Read(
"/output/FinalArgfile", wxEmptyString));
787 wxCommandEvent dummy;
790 int nThreads = cfg->Read(
"/output/NumberOfThreads", 0l);
791 MY_SPIN_VAL(
"prefs_output_NumberOfThreads", nThreads);
794 if (panel==0 || panel == 8)
807 MY_STR_VAL(
"prefs_enblend_EnblendExe", cfg->Read(
"/Enblend/Exe",
810 cfg->Read(
"/Enblend/Custom", &customEnblendExe);
811 MY_BOOL_VAL(
"prefs_enblend_Custom", customEnblendExe);
812 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(customEnblendExe);
813 XRCCTRL(*
this,
"prefs_enblend_select", wxButton)->Enable(customEnblendExe);
814 MY_STR_VAL(
"prefs_enblend_EnblendArgs", cfg->Read(
"/Enblend/Args",
818 MY_STR_VAL(
"prefs_enblend_EnfuseExe", cfg->Read(
"/Enfuse/Exe",
821 cfg->Read(
"/Enfuse/Custom", &customEnfuseExe);
822 MY_BOOL_VAL(
"prefs_enblend_enfuseCustom", customEnfuseExe);
823 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(customEnfuseExe);
824 XRCCTRL(*
this,
"prefs_enblend_enfuse_select", wxButton)->Enable(customEnfuseExe);
825 MY_STR_VAL(
"prefs_enblend_EnfuseArgs", cfg->Read(
"/Enfuse/Args",
829 if (panel==0 || panel == 9)
840 t = cfg->Read(
"/ShowSaveMessage", 1l) == 1;
842 t = cfg->Read(
"/ShowExposureWarning", 1l) == 1;
844 t = cfg->Read(
"/ShowFisheyeCropHint", 1l) == 1;
846 MY_CHOICE_VAL(
"pref_editcp_action", cfg->Read(
"/EditCPAfterAction", 0l));
853 wxConfigBase* cfg = wxConfigBase::Get();
855 wxNotebook* noteb = XRCCTRL(*
this,
"prefs_tab", wxNotebook);
856 if (
hugin_utils::HuginMessageBox(_(
"Really reset displayed preferences to default values?"), _(
"Hugin"), wxYES_NO | wxICON_QUESTION,
this) == wxYES)
858 if (noteb->GetSelection() == 0)
875 cfg->Write(
"CopyLogToClipboard", 0l);
878 cfg->Write(
"/CPEditorPanel/AutoRot", 1l);
880 cfg->Write(
"/RawImportDialog/dcrawExe",
"");
881 cfg->Write(
"/RawImportDialog/RTExe",
"");
882 cfg->Write(
"/RawImportDialog/DarktableExe",
"");
884 if(noteb->GetSelection() == 1)
886 cfg->Write(
"tempDir", wxEmptyString);
890 if (noteb->GetSelection() == 2)
893 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", 1l);
899 cfg->Write(
"/Assistant/UserDefinedOutputOption", 0l);
901 if (noteb->GetSelection() == 3)
906 cfg->Write(
"/CPEditorPanel/MagnifierWidth", 61l);
920 if (noteb->GetSelection() == 4)
927 if (noteb->GetSelection() == 5)
937 cfg->Write(
"/VerdandiDefaultArgs", wxEmptyString);
944 if (noteb->GetSelection() == 6)
947 cfg->Write(
"/output/CopyArgfile", wxEmptyString);
948 cfg->Write(
"/output/FinalArgfile", wxEmptyString);
950 cfg->Write(
"/output/NumberOfThreads", 0l);
952 if (noteb->GetSelection() == 7)
964 if (noteb->GetSelection() == 8)
970 cfg->Write(
"/ShowSaveMessage", 1l);
971 cfg->Write(
"/ShowExposureWarning", 1l);
972 cfg->Write(
"/ShowFisheyeCropHint", 1l);
973 cfg->Write(
"/EditCPAfterAction", 0l);
990 wxConfigBase* cfg = wxConfigBase::Get();
992 cfg->Write(
"/Assistant/autoAlign",
MY_G_BOOL_VAL(
"prefs_ass_autoAlign"));
993 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", !
MY_G_BOOL_VAL(
"prefs_ass_loadFovRectilinear"));
994 cfg->Write(
"/Assistant/nControlPoints",
MY_G_SPIN_VAL(
"prefs_ass_nControlPoints"));
995 cfg->Write(
"/Assistant/panoDownsizeFactor",
MY_G_SPIN_VAL(
"prefs_ass_panoDownsizeFactor") / 100.0);
996 cfg->Write(
"/Assistant/Linefind",
MY_G_BOOL_VAL(
"prefs_ass_linefind"));
997 cfg->Write(
"/Celeste/Auto",
MY_G_BOOL_VAL(
"prefs_celeste_auto"));
998 cfg->Write(
"/Assistant/AutoCPClean",
MY_G_BOOL_VAL(
"prefs_auto_cpclean"));
999 cfg->Write(
"/Assistant/UserDefinedOutputOption",
MY_G_BOOL_VAL(
"pref_ass_output"));
1002 cfg->Write(
"/ImageCache/Mapping",
MY_G_CHOICE_VAL(
"prefs_misc_hdr_mapping"));
1004 cfg->Write(
"/CPEditorPanel/MagnifierWidth",
MY_G_CHOICE_VAL(
"prefs_misc_magnifier_width") * 20 + 61l);
1007 cfg->Write(
"/Finetune/SearchAreaPercent",
MY_G_SPIN_VAL(
"prefs_ft_SearchAreaPercent"));
1008 cfg->Write(
"/Finetune/TemplateSize",
MY_G_SPIN_VAL(
"prefs_ft_TemplateSize"));
1009 cfg->Write(
"/Finetune/LocalSearchWidth",
MY_G_SPIN_VAL(
"prefs_ft_LocalSearchWidth"));
1013 cfg->Write(
"/Finetune/CorrThreshold", td);
1018 cfg->Write(
"/Finetune/CurvThreshold", td);
1020 cfg->Write(
"/Finetune/RotationSearch",
MY_G_BOOL_VAL(
"prefs_ft_RotationSearch"));
1021 cfg->Write(
"/Finetune/RotationStartAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStartAngle"));
1022 cfg->Write(
"/Finetune/RotationStopAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStopAngle"));
1023 cfg->Write(
"/Finetune/RotationSteps",
MY_G_SPIN_VAL(
"prefs_ft_RotationSteps"));
1030 cfg->Write(
"/ImageCache/UpperBoundHigh", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") >> 12);
1032 cfg->Write(
"/ImageCache/UpperBound", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") << 20);
1035 wxChoice* lang = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
1040 void* tmplp = lang->GetClientData(lang->GetSelection());
1041 long templ = *
static_cast<long*
>(tmplp);
1042 cfg->Write(
"language", templ);
1043 DEBUG_INFO(
"Language Selection ID: " << templ);
1046 cfg->Write(
"CopyLogToClipboard",
MY_G_BOOL_VAL(
"prefs_copy_log"));
1048 cfg->Write(
"/GLPreviewFrame/ShowProjectionHints",
MY_G_BOOL_VAL(
"pref_show_projection_hints"));
1050 cfg->Write(
"/CPEditorPanel/AutoRot",
MY_G_BOOL_VAL(
"pref_autorotate"));
1052 cfg->Write(
"/RawImportDialog/dcrawExe",
MY_G_STR_VAL(
"pref_raw_dcraw_exe"));
1053 cfg->Write(
"/RawImportDialog/RTExe",
MY_G_STR_VAL(
"pref_raw_rt_exe"));
1054 cfg->Write(
"/RawImportDialog/DarktableExe",
MY_G_STR_VAL(
"pref_raw_darktable_exe"));;
1056 cfg->Write(
"tempDir",
MY_G_STR_VAL(
"prefs_misc_tempdir"));
1058 wxString filename=XRCCTRL(*
this,
"prefs_project_filename", wxTextCtrl)->GetValue();
1060 filename.Replace(
"\\",
"/",
true);
1062 cfg->Write(
"ProjectFilename", filename);
1063 filename=XRCCTRL(*
this,
"prefs_output_filename", wxTextCtrl)->GetValue();
1065 filename.Replace(
"\\",
"/",
true);
1067 cfg->Write(
"OutputFilename", filename);
1074 cfg->Write(
"/output/ldr_format",
MY_G_CHOICE_VAL(
"pref_ldr_output_file_format"));
1077 cfg->Write(
"/output/tiff_compression",
MY_G_CHOICE_VAL(
"pref_tiff_compression"));
1078 cfg->Write(
"/output/jpeg_quality",
MY_G_SPIN_VAL(
"pref_jpeg_quality"));
1080 cfg->Write(
"/default_blender", static_cast<long>(
GetSelectedValue(XRCCTRL(*
this,
"pref_default_blender", wxChoice))));
1081 if (XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->GetSelection() == 1)
1083 cfg->Write(
"/VerdandiDefaultArgs",
"--seam=blend");
1087 cfg->Write(
"/VerdandiDefaultArgs", wxEmptyString);
1093 cfg->Write(
"/Processor/start",
MY_G_BOOL_VAL(
"pref_processor_start"));
1094 cfg->Write(
"/Processor/overwrite",
MY_G_BOOL_VAL(
"pref_processor_overwrite"));
1095 cfg->Write(
"/Processor/verbose",
MY_G_BOOL_VAL(
"pref_processor_verbose"));
1097 cfg->Write(
"/output/useExiftool",
MY_G_BOOL_VAL(
"pref_exiftool_metadata"));
1098 cfg->Write(
"/output/CopyArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile"));
1099 cfg->Write(
"/output/FinalArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile2"));
1100 cfg->Write(
"/output/writeGPano",
MY_G_BOOL_VAL(
"pref_exiftool_gpano"));
1101 cfg->Write(
"/output/NumberOfThreads",
MY_G_SPIN_VAL(
"prefs_output_NumberOfThreads"));
1104 cfg->Write(
"/Nona/Interpolator",
MY_G_CHOICE_VAL(
"prefs_nona_interpolator"));
1105 cfg->Write(
"/Nona/CroppedImages",
MY_G_BOOL_VAL(
"prefs_nona_createCroppedImages"));
1106 cfg->Write(
"/Nona/UseGPU",
MY_G_BOOL_VAL(
"prefs_nona_useGpu"));
1110 cfg->Write(
"/Enblend/Custom",
MY_G_BOOL_VAL(
"prefs_enblend_Custom"));
1111 cfg->Write(
"/Enblend/Exe",
MY_G_STR_VAL(
"prefs_enblend_EnblendExe"));
1112 cfg->Write(
"/Enblend/Args",
MY_G_STR_VAL(
"prefs_enblend_EnblendArgs"));
1114 cfg->Write(
"/Enfuse/Custom",
MY_G_BOOL_VAL(
"prefs_enblend_enfuseCustom"));
1115 cfg->Write(
"/Enfuse/Exe",
MY_G_STR_VAL(
"prefs_enblend_EnfuseExe"));
1116 cfg->Write(
"/Enfuse/Args",
MY_G_STR_VAL(
"prefs_enblend_EnfuseArgs"));
1122 cfg->Write(
"/Celeste/Threshold", td);
1123 cfg->Write(
"/Celeste/Filter",
MY_G_CHOICE_VAL(
"prefs_celeste_filter"));
1125 cfg->Write(
"/OptimizePhotometric/nRandomPointsPerImage",
MY_G_SPIN_VAL(
"prefs_photo_optimizer_nr_points"));
1126 cfg->Write(
"/ShowSaveMessage",
MY_G_BOOL_VAL(
"prefs_warning_save"));
1127 cfg->Write(
"/ShowExposureWarning",
MY_G_BOOL_VAL(
"prefs_warning_exposure"));
1128 cfg->Write(
"/ShowFisheyeCropHint",
MY_G_BOOL_VAL(
"prefs_warning_fisheye_crop"));
1129 cfg->Write(
"/EditCPAfterAction",
MY_G_CHOICE_VAL(
"pref_editcp_action"));
1138 if(cpdetector_dlg.ShowModal()==wxOK)
1151 if (selection == wxNOT_FOUND)
1158 if(autopano_dlg.ShowModal()==wxOK)
1172 hugin_utils::HuginMessageBox(_(
"You can't delete the last setting.\nAt least one setting is required."), _(
"Hugin"), wxOK | wxICON_EXCLAMATION,
this);
1177 _(
"Hugin"), wxYES_NO | wxICON_QUESTION,
this) == wxYES)
1208 if(selection<m_CPDetectorList->GetCount()-1)
1229 wxFileDialog dlg(
this,_(
"Load control point detector settings"),
1230 wxConfigBase::Get()->Read(
"/actualPath",wxEmptyString), wxEmptyString,
1231 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1232 if (dlg.ShowModal() == wxID_OK)
1234 wxConfig::Get()->Write(
"/actualPath", dlg.GetDirectory());
1235 wxString fn = dlg.GetPath();
1244 wxFileDialog dlg(
this,_(
"Save control point detector settings"),
1245 wxConfigBase::Get()->Read(
"/actualPath",wxEmptyString), wxEmptyString,
1246 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1247 if (dlg.ShowModal() == wxID_OK)
1249 wxConfig::Get()->Write(
"/actualPath", dlg.GetDirectory());
1250 wxString fn = dlg.GetPath();
1254 if(fn.Right(8)!=
".setting")
1256 fn.Append(
".setting");
1271 XRCCTRL(*
this,
"pref_tiff_compression_label",wxStaticText)->Show(i==0);
1272 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->Show(i==0);
1273 XRCCTRL(*
this,
"pref_jpeg_quality_label",wxStaticText)->Show(i==1);
1274 XRCCTRL(*
this,
"pref_jpeg_quality",wxSpinCtrl)->Show(i==1);
1275 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->GetParent()->Layout();
1286 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->Enable(i==0);
1287 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->Enable(i==0);
1293 wxConfigBase* config=wxConfigBase::Get();
1294 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(config->Read(
"/Processor/start",
HUGIN_PROCESSOR_START) == 1);
1295 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(config->Read(
"/Processor/verbose",
HUGIN_PROCESSOR_VERBOSE) == 1);
1300 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(
true);
1301 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(
true);
1314 XRCCTRL(*
this,
"pref_internal_blender_seam_label", wxStaticText)->Show(blender == 1);
1315 wxChoice* seamChoice = XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice);
1316 seamChoice->Show(blender == 1);
1317 seamChoice->Enable(blender == 1);
1322 XRCCTRL(*
this,
"prefs_project_filename_preview", wxStaticText)->SetLabel(
1329 XRCCTRL(*
this,
"prefs_output_filename_preview", wxStaticText)->SetLabel(
1337 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