27 #include "hugin_config.h"
29 #include "wx/listbook.h"
30 #include <wx/stdpaths.h>
48 #define MY_STR_VAL(id, val) { XRCCTRL(*this, id, wxTextCtrl)->SetValue(val); };
49 #define MY_SPIN_VAL(id, val) { XRCCTRL(*this, id, wxSpinCtrl)->SetValue(val); };
50 #define MY_BOOL_VAL(id, val) { XRCCTRL(*this, id, wxCheckBox)->SetValue(val); };
51 #define MY_CHOICE_VAL(id, val) { XRCCTRL(*this, id, wxChoice)->SetSelection(val); };
52 #define MY_STATIC_VAL(id, val) { XRCCTRL(*this, id, wxStaticText)->SetLabel(val); };
54 #define MY_G_STR_VAL(id) XRCCTRL(*this, id, wxTextCtrl)->GetValue()
55 #define MY_G_SPIN_VAL(id) XRCCTRL(*this, id, wxSpinCtrl)->GetValue()
56 #define MY_G_BOOL_VAL(id) XRCCTRL(*this, id, wxCheckBox)->GetValue()
57 #define MY_G_CHOICE_VAL(id) XRCCTRL(*this, id, wxChoice)->GetSelection()
70 EVT_BUTTON(XRCID("pref_raw_darktable_exe_select"),
PreferencesDialog::OnDarktableExe)
71 EVT_BUTTON(XRCID("pref_exiftool_argfile_choose"),
PreferencesDialog::OnExifArgfileChoose)
72 EVT_BUTTON(XRCID("pref_exiftool_argfile_edit"),
PreferencesDialog::OnExifArgfileEdit)
73 EVT_BUTTON(XRCID("pref_exiftool_argfile2_choose"),
PreferencesDialog::OnExifArgfile2Choose)
74 EVT_BUTTON(XRCID("pref_exiftool_argfile2_edit"),
PreferencesDialog::OnExifArgfile2Edit)
76 EVT_CHECKBOX(XRCID("prefs_ft_RotationSearch"),
PreferencesDialog::OnRotationCheckBox)
78 EVT_CHECKBOX(XRCID("prefs_enblend_enfuseCustom"),
PreferencesDialog::OnCustomEnfuse)
79 EVT_CHECKBOX(XRCID("pref_ass_output"),
PreferencesDialog::OnUserDefinedOutputOptionsCheckBox)
80 EVT_BUTTON(XRCID("pref_ass_change_output"),
PreferencesDialog::OnChangeUserDefinedOutputOptions)
84 EVT_BUTTON(XRCID("pref_cpdetector_moveup"),
PreferencesDialog::OnCPDetectorMoveUp)
85 EVT_BUTTON(XRCID("pref_cpdetector_movedown"),
PreferencesDialog::OnCPDetectorMoveDown)
86 EVT_BUTTON(XRCID("pref_cpdetector_default"),
PreferencesDialog::OnCPDetectorDefault)
87 EVT_LISTBOX_DCLICK(XRCID("pref_cpdetector_list"),
PreferencesDialog::OnCPDetectorListDblClick)
90 EVT_CHOICE(XRCID("pref_ldr_output_file_format"),
PreferencesDialog::OnFileFormatChanged)
93 EVT_TEXT(XRCID("prefs_project_filename"),
PreferencesDialog::OnUpdateProjectFilename)
94 EVT_TEXT(XRCID("prefs_output_filename"),
PreferencesDialog::OnUpdateOutputFilename)
104 wxXmlResource::Get()->LoadDialog(
this, parent, wxT(
"pref_dialog"));
107 wxIconBundle myIcons(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.ico"),wxBITMAP_TYPE_ICO);
110 wxIcon myIcon(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.png"),wxBITMAP_TYPE_PNG);
115 XRCCTRL(*
this,
"prefs_ft_RotationStartAngle", wxSpinCtrl)->SetRange(-180,0);
116 XRCCTRL(*
this,
"prefs_ft_RotationStopAngle", wxSpinCtrl)->SetRange(0,180);
117 XRCCTRL(*
this,
"prefs_ass_nControlPoints", wxSpinCtrl)->SetRange(3,3000);
119 wxChoice* lang_choice = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
122 *lp = wxLANGUAGE_DEFAULT;
123 lang_choice->Append(_(
"System default"), lp);
125 *lp = wxLANGUAGE_BASQUE;
126 lang_choice->Append(_(
"Basque"), lp);
133 *lp = wxLANGUAGE_CATALAN;
134 lang_choice->Append(_(
"Catalan"), lp);
136 *lp = wxLANGUAGE_CHINESE_SIMPLIFIED;
137 lang_choice->Append(_(
"Chinese (Simplified)"), lp);
139 *lp = wxLANGUAGE_CHINESE_TRADITIONAL;
140 lang_choice->Append(_(
"Chinese (Traditional)"), lp);
142 *lp = wxLANGUAGE_CZECH;
143 lang_choice->Append(_(
"Czech"), lp);
145 *lp = wxLANGUAGE_DANISH;
146 lang_choice->Append(_(
"Danish"), lp);
148 *lp = wxLANGUAGE_DUTCH;
149 lang_choice->Append(_(
"Dutch"), lp);
151 *lp = wxLANGUAGE_ENGLISH;
152 lang_choice->Append(_(
"English"), lp);
154 *lp = wxLANGUAGE_FRENCH;
155 lang_choice->Append(_(
"French"), lp);
157 *lp = wxLANGUAGE_GERMAN;
158 lang_choice->Append(_(
"German"), lp);
160 *lp = wxLANGUAGE_HUNGARIAN;
161 lang_choice->Append(_(
"Hungarian"), lp);
163 *lp = wxLANGUAGE_ITALIAN;
164 lang_choice->Append(_(
"Italian"), lp);
166 *lp = wxLANGUAGE_JAPANESE;
167 lang_choice->Append(_(
"Japanese"), lp);
174 *lp = wxLANGUAGE_POLISH;
175 lang_choice->Append(_(
"Polish"), lp);
177 *lp = wxLANGUAGE_PORTUGUESE_BRAZILIAN;
178 lang_choice->Append(_(
"Portuguese (Brazilian)"), lp);
180 *lp = wxLANGUAGE_RUSSIAN;
181 lang_choice->Append(_(
"Russian"), lp);
183 *lp = wxLANGUAGE_SLOVAK;
184 lang_choice->Append(_(
"Slovak"), lp);
191 *lp = wxLANGUAGE_SPANISH;
192 lang_choice->Append(_(
"Spanish"), lp);
194 *lp = wxLANGUAGE_SWEDISH;
195 lang_choice->Append(_(
"Swedish"), lp);
202 *lp = wxLANGUAGE_FINNISH;
203 lang_choice->Append(_(
"Finnish"), lp);
205 *lp = wxLANGUAGE_VALENCIAN;
206 lang_choice->Append(_(
"Valencian (Southern Catalan)"), lp);
207 lang_choice->SetSelection(0);
210 XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl)->AutoCompleteFileNames();
211 XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl)->AutoCompleteFileNames();
212 XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl)->AutoCompleteFileNames();
217 wxStaticText* preview=XRCCTRL(*
this,
"prefs_project_filename_preview", wxStaticText);
218 preview->SetWindowStyle(preview->GetWindowStyle() | wxST_ELLIPSIZE_START);
219 preview=XRCCTRL(*
this,
"prefs_output_filename_preview", wxStaticText);
220 preview->SetWindowStyle(preview->GetWindowStyle() | wxST_ELLIPSIZE_START);
222 XRCCTRL(*
this,
"prefs_misc_tempdir", wxTextCtrl)->AutoCompleteDirectories();
223 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->AutoCompleteFileNames();
224 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->AutoCompleteFileNames();
225 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->AutoCompleteFileNames();
226 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->AutoCompleteFileNames();
228 wxConfigBase* cfg = wxConfigBase::Get();
229 m_CPDetectorList = XRCCTRL(*
this,
"pref_cpdetector_list", wxListBox);
230 cpdetector_config_edit.Read(cfg);
233 UpdateDisplayData(0);
237 this->SetBackgroundColour(XRCCTRL(*
this,
"prefs_tab", wxNotebook)->GetBackgroundColour());
240 wxCheckBox* show_hints=XRCCTRL(*
this,
"pref_show_projection_hints",wxCheckBox);
241 show_hints->Enable(
true);
242 show_hints->Show(
true);
243 show_hints->Update();
246 GetSizer()->SetSizeHints(
this);
251 #if defined __WXMSW__ || defined MAC_SELF_CONTAINED_BUNDLE
255 XRCCTRL(*
this,
"prefs_enblend_Custom", wxCheckBox)->Hide();
259 XRCCTRL(*
this,
"prefs_enblend_enfuseCustom", wxCheckBox)->Hide();
274 wxChoice* lang_choice = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
275 for (
int i = 0; i < (int) lang_choice->GetCount(); i++)
277 delete static_cast<long*
>(lang_choice->GetClientData(i));
286 this->EndModal(wxOK);
291 this->EndModal(wxCANCEL);
306 wxFileDialog dlg(
this,_(
"Select Enblend"),
309 _(
"Executables (*.exe)|*.exe"),
313 wxFD_OPEN, wxDefaultPosition);
314 if (dlg.ShowModal() == wxID_OK)
316 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->SetValue(
323 wxFileDialog dlg(
this,_(
"Select Enfuse"),
326 _(
"Executables (*.exe)|*.exe"),
330 wxFD_OPEN, wxDefaultPosition);
331 if (dlg.ShowModal() == wxID_OK)
333 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->SetValue(
340 wxTextCtrl* ctrl = XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl);
341 wxFileDialog dlg(
this, _(
"Select dcraw"),
"", ctrl->GetValue(),
343 _(
"Executables (*.exe)|*.exe"),
347 wxFD_OPEN, wxDefaultPosition);
348 if (dlg.ShowModal() == wxID_OK)
350 ctrl->SetValue(dlg.GetPath());
356 wxTextCtrl* ctrl = XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl);
357 wxFileDialog dlg(
this, _(
"Select RawTherapee-cli"),
"", ctrl->GetValue(),
359 _(
"Executables (*.exe)|*.exe"),
363 wxFD_OPEN, wxDefaultPosition);
364 if (dlg.ShowModal() == wxID_OK)
366 ctrl->SetValue(dlg.GetPath());
372 wxTextCtrl* ctrl = XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl);
373 wxFileDialog dlg(
this, _(
"Select Darktable-cli"),
"", ctrl->GetValue(),
375 _(
"Executables (*.exe)|*.exe"),
379 wxFD_OPEN, wxDefaultPosition);
380 if (dlg.ShowModal() == wxID_OK)
382 ctrl->SetValue(dlg.GetPath());
389 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(e.IsChecked());
390 XRCCTRL(*
this,
"prefs_enblend_select", wxButton)->Enable(e.IsChecked());
395 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(e.IsChecked());
396 XRCCTRL(*
this,
"prefs_enblend_enfuse_select", wxButton)->Enable(e.IsChecked());
401 wxFileDialog dlg(
this,_(
"Select ExifTool argfile"),
402 wxT(
""), XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->GetValue(),
403 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
404 wxFD_OPEN, wxDefaultPosition);
405 if (dlg.ShowModal() == wxID_OK)
407 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(
414 wxTextFile defaultFile(sourceFile);
416 wxTextFile newFile(newFilename);
418 if (defaultFile.IsOpened())
420 for (
size_t i = 0; i < defaultFile.GetLineCount(); ++i)
422 newFile.AddLine(defaultFile[i]);
432 wxString filename=XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->GetValue();
433 if(!filename.empty())
435 wxFileName file(filename);
436 file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
439 if( wxMessageBox(wxString::Format(_(
"File %s does not exist.\nShould the argfile be created with default tags?"),filename.c_str()),
440 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this)!=wxYES)
444 filename = file.GetFullPath();
449 filename = file.GetFullPath();
454 if( wxMessageBox(_(
"No file selected.\nShould an argfile be created with default tags?"),
455 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this)!=wxYES)
459 wxFileDialog dlg(
this,_(
"Select new ExifTool argfile"),
460 wxStandardPaths::Get().GetUserConfigDir(), wxT(
""),
461 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
462 wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
463 if (dlg.ShowModal() != wxID_OK)
467 filename=dlg.GetPath();
470 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(filename);
472 wxXmlResource::Get()->LoadDialog(&edit_dlg,
this, wxT(
"pref_edit_argfile"));
474 wxTextCtrl* argfileControl=XRCCTRL(edit_dlg,
"pref_edit_textcontrol", wxTextCtrl);
475 argfileControl->LoadFile(filename);
476 if(edit_dlg.ShowModal() == wxID_OK)
478 if(!argfileControl->SaveFile(filename))
480 wxMessageBox(wxString::Format(_(
"Could not save file \"%s\"."), filename.c_str()),
481 _(
"Error"), wxOK | wxICON_ERROR);
489 wxFileDialog dlg(
this, _(
"Select ExifTool argfile"),
490 wxT(
""), XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->GetValue(),
491 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
492 wxFD_OPEN, wxDefaultPosition);
493 if (dlg.ShowModal() == wxID_OK)
495 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(
502 wxString filename = XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->GetValue();
503 if (!filename.empty())
505 wxFileName file(filename);
506 file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
509 if (wxMessageBox(wxString::Format(_(
"File %s does not exist.\nShould an example argfile be created?"), filename.c_str()),
510 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this) != wxYES)
514 filename = file.GetFullPath();
519 filename = file.GetFullPath();
524 if (wxMessageBox(_(
"No file selected.\nShould an example argfile be created?"),
525 _(
"Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,
this) != wxYES)
529 wxFileDialog dlg(
this, _(
"Select new ExifTool argfile"),
530 wxStandardPaths::Get().GetUserConfigDir(), wxT(
""),
531 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
532 wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
533 if (dlg.ShowModal() != wxID_OK)
537 filename = dlg.GetPath();
540 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(filename);
542 wxXmlResource::Get()->LoadDialog(&edit_dlg,
this, wxT(
"pref_edit_argfile_placeholders"));
544 wxTextCtrl* argfileControl = XRCCTRL(edit_dlg,
"pref_edit_textcontrol", wxTextCtrl);
545 argfileControl->LoadFile(filename);
546 if (edit_dlg.ShowModal() == wxID_OK)
548 if (!argfileControl->SaveFile(filename))
550 wxMessageBox(wxString::Format(_(
"Could not save file \"%s\"."), filename.c_str()),
551 _(
"Error"), wxOK | wxICON_ERROR);
559 bool copyMetadata=XRCCTRL(*
this,
"pref_exiftool_metadata", wxCheckBox)->GetValue();
560 XRCCTRL(*
this,
"pref_exiftool_argfile_general_label", wxStaticText)->Enable(copyMetadata);
561 XRCCTRL(*
this,
"pref_exiftool_argfile_intermediate_label", wxStaticText)->Enable(copyMetadata);
562 XRCCTRL(*
this,
"pref_exiftool_argfile_label", wxStaticText)->Enable(copyMetadata);
563 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->Enable(copyMetadata);
564 XRCCTRL(*
this,
"pref_exiftool_argfile_choose", wxButton)->Enable(copyMetadata);
565 XRCCTRL(*
this,
"pref_exiftool_argfile_edit", wxButton)->Enable(copyMetadata);
566 XRCCTRL(*
this,
"pref_exiftool_argfile_final_label", wxStaticText)->Enable(copyMetadata);
567 XRCCTRL(*
this,
"pref_exiftool_argfile2_label", wxStaticText)->Enable(copyMetadata);
568 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->Enable(copyMetadata);
569 XRCCTRL(*
this,
"pref_exiftool_argfile2_choose", wxButton)->Enable(copyMetadata);
570 XRCCTRL(*
this,
"pref_exiftool_argfile2_edit", wxButton)->Enable(copyMetadata);
571 XRCCTRL(*
this,
"pref_exiftool_gpano", wxCheckBox)->Enable(copyMetadata);
576 XRCCTRL(*
this,
"prefs_ft_rot_panel", wxPanel)->Enable(enable);
586 wxConfigBase* cfg = wxConfigBase::Get();
588 if (panel==0 || panel == 1)
594 unsigned long mem_high = cfg->Read(wxT(
"/ImageCache/UpperBoundHigh"), (
long) 0);
597 mem = ((
unsigned long long) mem_high << 32) + mem_low;
608 wxChoice* lang_choice = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
612 for (
int i = 0; i < (int)lang_choice->GetCount(); i++)
614 long lang = *
static_cast<long*
>(lang_choice->GetClientData(i));
623 DEBUG_DEBUG(
"wxChoice language updated:" << curlang);
625 lang_choice->SetSelection(idx);
638 t = cfg->Read(wxT(
"CopyLogToClipboard"), 0l) == 1;
644 t = cfg->Read(
"/CPEditorPanel/AutoRot", 1l) == 1;
648 MY_STR_VAL(
"pref_raw_dcraw_exe", cfg->Read(
"/RawImportDialog/dcrawExe",
""));
649 MY_STR_VAL(
"pref_raw_rt_exe", cfg->Read(
"/RawImportDialog/RTExe",
""));
650 MY_STR_VAL(
"pref_raw_darktable_exe", cfg->Read(
"/RawImportDialog/DarktableExe",
""));
654 if(panel==0 || panel==2)
657 MY_STR_VAL(
"prefs_misc_tempdir", cfg->Read(wxT(
"tempDir"),wxT(
"")));
661 filename.Replace(wxT(
"/"),wxT(
"\\"),
true);
663 MY_STR_VAL(
"prefs_project_filename", filename);
666 filename.Replace(wxT(
"/"),wxT(
"\\"),
true);
668 MY_STR_VAL(
"prefs_output_filename", filename);
671 if (panel==0 || panel == 3)
676 t = cfg->Read(wxT(
"/General/IgnoreFovRectilinearOnAdd"), 1l) == 1l;
681 cfg->Read(wxT(
"/Assistant/panoDownsizeFactor"), &factor);
682 MY_SPIN_VAL(
"prefs_ass_panoDownsizeFactor",(
int)(factor*100.0));
689 t = cfg->Read(wxT(
"/Assistant/UserDefinedOutputOption"), 0l) == 1;
691 wxCommandEvent dummy;
696 if (panel==0 || panel == 4)
702 int val = wxConfigBase::Get()->Read(wxT(
"/CPEditorPanel/MagnifierWidth"), 61l);
705 XRCCTRL(*
this,
"prefs_misc_magnifier_width", wxChoice)->SetSelection(val);
710 MY_SPIN_VAL(
"prefs_ft_SearchAreaPercent",cfg->Read(wxT(
"/Finetune/SearchAreaPercent"),
712 MY_SPIN_VAL(
"prefs_ft_LocalSearchWidth", cfg->Read(wxT(
"/Finetune/LocalSearchWidth"),
736 MY_SPIN_VAL(
"prefs_ft_RotationSteps", cfg->Read(wxT(
"/Finetune/RotationSteps"),
746 if (panel==0 || panel == 5)
751 if (panel == 0 || panel == 6)
765 const wxString defaultVerdandiArgs = cfg->Read(wxT(
"/VerdandiDefaultArgs"), wxEmptyString);
766 if (defaultVerdandiArgs.Find(wxT(
"--seam=blend")) != wxNOT_FOUND)
768 XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->SetSelection(1);
772 XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->SetSelection(0);
788 if (panel == 0 || panel == 7)
793 MY_STR_VAL(
"pref_exiftool_argfile", cfg->Read(wxT(
"/output/CopyArgfile"), wxT(
"")));
794 MY_STR_VAL(
"pref_exiftool_argfile2", cfg->Read(wxT(
"/output/FinalArgfile"), wxT(
"")));
797 wxCommandEvent dummy;
800 int nThreads = cfg->Read(wxT(
"/output/NumberOfThreads"), 0l);
801 MY_SPIN_VAL(
"prefs_output_NumberOfThreads", nThreads);
804 if (panel==0 || panel == 8)
817 MY_STR_VAL(
"prefs_enblend_EnblendExe", cfg->Read(wxT(
"/Enblend/Exe"),
820 cfg->Read(wxT(
"/Enblend/Custom"), &customEnblendExe);
821 MY_BOOL_VAL(
"prefs_enblend_Custom", customEnblendExe);
822 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(customEnblendExe);
823 XRCCTRL(*
this,
"prefs_enblend_select", wxButton)->Enable(customEnblendExe);
824 MY_STR_VAL(
"prefs_enblend_EnblendArgs", cfg->Read(wxT(
"/Enblend/Args"),
828 MY_STR_VAL(
"prefs_enblend_EnfuseExe", cfg->Read(wxT(
"/Enfuse/Exe"),
831 cfg->Read(wxT(
"/Enfuse/Custom"), &customEnfuseExe);
832 MY_BOOL_VAL(
"prefs_enblend_enfuseCustom", customEnfuseExe);
833 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(customEnfuseExe);
834 XRCCTRL(*
this,
"prefs_enblend_enfuse_select", wxButton)->Enable(customEnfuseExe);
835 MY_STR_VAL(
"prefs_enblend_EnfuseArgs", cfg->Read(wxT(
"/Enfuse/Args"),
839 if (panel==0 || panel == 9)
850 t = cfg->Read(wxT(
"/ShowSaveMessage"), 1l) == 1;
852 t = cfg->Read(wxT(
"/ShowExposureWarning"), 1l) == 1;
854 t = cfg->Read(wxT(
"/ShowFisheyeCropHint"), 1l) == 1;
856 MY_CHOICE_VAL(
"pref_editcp_action", cfg->Read(wxT(
"/EditCPAfterAction"), 0l));
863 wxConfigBase* cfg = wxConfigBase::Get();
865 wxNotebook* noteb = XRCCTRL(*
this,
"prefs_tab", wxNotebook);
866 int really = wxMessageBox(_(
"Really reset displayed preferences to default values?"), _(
"Load Defaults"),
868 if ( really == wxYES)
870 if (noteb->GetSelection() == 0)
887 cfg->Write(wxT(
"CopyLogToClipboard"), 0l);
890 cfg->Write(
"/CPEditorPanel/AutoRot", 1l);
892 cfg->Write(
"/RawImportDialog/dcrawExe",
"");
893 cfg->Write(
"/RawImportDialog/RTExe",
"");
894 cfg->Write(
"/RawImportDialog/DarktableExe",
"");
896 if(noteb->GetSelection() == 1)
898 cfg->Write(wxT(
"tempDir"), wxT(
""));
902 if (noteb->GetSelection() == 2)
905 cfg->Write(wxT(
"/General/IgnoreFovRectilinearOnAdd"), 1l);
911 cfg->Write(wxT(
"/Assistant/UserDefinedOutputOption"), 0l);
913 if (noteb->GetSelection() == 3)
918 cfg->Write(wxT(
"/CPEditorPanel/MagnifierWidth"), 61l);
932 if (noteb->GetSelection() == 4)
939 if (noteb->GetSelection() == 5)
949 cfg->Write(wxT(
"/VerdandiDefaultArgs"), wxEmptyString);
956 if (noteb->GetSelection() == 6)
959 cfg->Write(wxT(
"/output/CopyArgfile"), wxT(
""));
960 cfg->Write(wxT(
"/output/FinalArgfile"), wxT(
""));
962 cfg->Write(wxT(
"/output/NumberOfThreads"), 0l);
964 if (noteb->GetSelection() == 7)
976 if (noteb->GetSelection() == 8)
982 cfg->Write(wxT(
"/ShowSaveMessage"), 1l);
983 cfg->Write(wxT(
"/ShowExposureWarning"), 1l);
984 cfg->Write(wxT(
"/ShowFisheyeCropHint"), 1l);
985 cfg->Write(wxT(
"/EditCPAfterAction"), 0l);
1002 wxConfigBase* cfg = wxConfigBase::Get();
1004 cfg->Write(wxT(
"/Assistant/autoAlign"),
MY_G_BOOL_VAL(
"prefs_ass_autoAlign"));
1005 cfg->Write(wxT(
"/General/IgnoreFovRectilinearOnAdd"), !
MY_G_BOOL_VAL(
"prefs_ass_loadFovRectilinear"));
1006 cfg->Write(wxT(
"/Assistant/nControlPoints"),
MY_G_SPIN_VAL(
"prefs_ass_nControlPoints"));
1007 cfg->Write(wxT(
"/Assistant/panoDownsizeFactor"),
MY_G_SPIN_VAL(
"prefs_ass_panoDownsizeFactor") / 100.0);
1008 cfg->Write(wxT(
"/Assistant/Linefind"),
MY_G_BOOL_VAL(
"prefs_ass_linefind"));
1009 cfg->Write(wxT(
"/Celeste/Auto"),
MY_G_BOOL_VAL(
"prefs_celeste_auto"));
1010 cfg->Write(wxT(
"/Assistant/AutoCPClean"),
MY_G_BOOL_VAL(
"prefs_auto_cpclean"));
1011 cfg->Write(wxT(
"/Assistant/UserDefinedOutputOption"),
MY_G_BOOL_VAL(
"pref_ass_output"));
1014 cfg->Write(wxT(
"/ImageCache/Mapping"),
MY_G_CHOICE_VAL(
"prefs_misc_hdr_mapping"));
1016 cfg->Write(wxT(
"/CPEditorPanel/MagnifierWidth"),
MY_G_CHOICE_VAL(
"prefs_misc_magnifier_width") * 20 + 61l);
1019 cfg->Write(wxT(
"/Finetune/SearchAreaPercent"),
MY_G_SPIN_VAL(
"prefs_ft_SearchAreaPercent"));
1020 cfg->Write(wxT(
"/Finetune/TemplateSize"),
MY_G_SPIN_VAL(
"prefs_ft_TemplateSize"));
1021 cfg->Write(wxT(
"/Finetune/LocalSearchWidth"),
MY_G_SPIN_VAL(
"prefs_ft_LocalSearchWidth"));
1025 cfg->Write(wxT(
"/Finetune/CorrThreshold"), td);
1030 cfg->Write(wxT(
"/Finetune/CurvThreshold"), td);
1032 cfg->Write(wxT(
"/Finetune/RotationSearch"),
MY_G_BOOL_VAL(
"prefs_ft_RotationSearch"));
1033 cfg->Write(wxT(
"/Finetune/RotationStartAngle"), (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStartAngle"));
1034 cfg->Write(wxT(
"/Finetune/RotationStopAngle"), (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStopAngle"));
1035 cfg->Write(wxT(
"/Finetune/RotationSteps"),
MY_G_SPIN_VAL(
"prefs_ft_RotationSteps"));
1042 cfg->Write(wxT(
"/ImageCache/UpperBoundHigh"), (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") >> 12);
1044 cfg->Write(wxT(
"/ImageCache/UpperBound"), (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") << 20);
1047 wxChoice* lang = XRCCTRL(*
this,
"prefs_gui_language", wxChoice);
1052 void* tmplp = lang->GetClientData(lang->GetSelection());
1053 long templ = *
static_cast<long*
>(tmplp);
1054 cfg->Write(wxT(
"language"), templ);
1055 DEBUG_INFO(
"Language Selection ID: " << templ);
1057 cfg->Write(wxT(
"smartUndo"),
MY_G_BOOL_VAL(
"prefs_smart_undo"));
1058 cfg->Write(wxT(
"CopyLogToClipboard"),
MY_G_BOOL_VAL(
"prefs_copy_log"));
1060 cfg->Write(wxT(
"/GLPreviewFrame/ShowProjectionHints"),
MY_G_BOOL_VAL(
"pref_show_projection_hints"));
1062 cfg->Write(
"/CPEditorPanel/AutoRot",
MY_G_BOOL_VAL(
"pref_autorotate"));
1064 cfg->Write(
"/RawImportDialog/dcrawExe",
MY_G_STR_VAL(
"pref_raw_dcraw_exe"));
1065 cfg->Write(
"/RawImportDialog/RTExe",
MY_G_STR_VAL(
"pref_raw_rt_exe"));
1066 cfg->Write(
"/RawImportDialog/DarktableExe",
MY_G_STR_VAL(
"pref_raw_darktable_exe"));;
1068 cfg->Write(wxT(
"tempDir"),
MY_G_STR_VAL(
"prefs_misc_tempdir"));
1070 wxString filename=XRCCTRL(*
this,
"prefs_project_filename", wxTextCtrl)->GetValue();
1072 filename.Replace(wxT(
"\\"), wxT(
"/"),
true);
1074 cfg->Write(wxT(
"ProjectFilename"), filename);
1075 filename=XRCCTRL(*
this,
"prefs_output_filename", wxTextCtrl)->GetValue();
1077 filename.Replace(wxT(
"\\"), wxT(
"/"),
true);
1079 cfg->Write(wxT(
"OutputFilename"), filename);
1086 cfg->Write(wxT(
"/output/ldr_format"),
MY_G_CHOICE_VAL(
"pref_ldr_output_file_format"));
1089 cfg->Write(wxT(
"/output/tiff_compression"),
MY_G_CHOICE_VAL(
"pref_tiff_compression"));
1090 cfg->Write(wxT(
"/output/jpeg_quality"),
MY_G_SPIN_VAL(
"pref_jpeg_quality"));
1092 cfg->Write(wxT(
"/default_blender"), static_cast<long>(
GetSelectedValue(XRCCTRL(*
this,
"pref_default_blender", wxChoice))));
1093 if (XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice)->GetSelection() == 1)
1095 cfg->Write(wxT(
"/VerdandiDefaultArgs"), wxT(
"--seam=blend"));
1099 cfg->Write(wxT(
"/VerdandiDefaultArgs"), wxEmptyString);
1104 cfg->Write(wxT(
"/Processor/gui"),
MY_G_CHOICE_VAL(
"pref_processor_gui"));
1105 cfg->Write(wxT(
"/Processor/start"),
MY_G_BOOL_VAL(
"pref_processor_start"));
1106 cfg->Write(wxT(
"/Processor/overwrite"),
MY_G_BOOL_VAL(
"pref_processor_overwrite"));
1107 cfg->Write(wxT(
"/Processor/verbose"),
MY_G_BOOL_VAL(
"pref_processor_verbose"));
1109 cfg->Write(wxT(
"/output/useExiftool"),
MY_G_BOOL_VAL(
"pref_exiftool_metadata"));
1110 cfg->Write(wxT(
"/output/CopyArgfile"),
MY_G_STR_VAL(
"pref_exiftool_argfile"));
1111 cfg->Write(wxT(
"/output/FinalArgfile"),
MY_G_STR_VAL(
"pref_exiftool_argfile2"));
1112 cfg->Write(wxT(
"/output/writeGPano"),
MY_G_BOOL_VAL(
"pref_exiftool_gpano"));
1113 cfg->Write(wxT(
"/output/NumberOfThreads"),
MY_G_SPIN_VAL(
"prefs_output_NumberOfThreads"));
1116 cfg->Write(wxT(
"/Nona/Interpolator"),
MY_G_CHOICE_VAL(
"prefs_nona_interpolator"));
1117 cfg->Write(wxT(
"/Nona/CroppedImages"),
MY_G_BOOL_VAL(
"prefs_nona_createCroppedImages"));
1118 cfg->Write(wxT(
"/Nona/UseGPU"),
MY_G_BOOL_VAL(
"prefs_nona_useGpu"));
1122 cfg->Write(wxT(
"/Enblend/Custom"),
MY_G_BOOL_VAL(
"prefs_enblend_Custom"));
1123 cfg->Write(wxT(
"/Enblend/Exe"),
MY_G_STR_VAL(
"prefs_enblend_EnblendExe"));
1124 cfg->Write(wxT(
"/Enblend/Args"),
MY_G_STR_VAL(
"prefs_enblend_EnblendArgs"));
1126 cfg->Write(wxT(
"/Enfuse/Custom"),
MY_G_BOOL_VAL(
"prefs_enblend_enfuseCustom"));
1127 cfg->Write(wxT(
"/Enfuse/Exe"),
MY_G_STR_VAL(
"prefs_enblend_EnfuseExe"));
1128 cfg->Write(wxT(
"/Enfuse/Args"),
MY_G_STR_VAL(
"prefs_enblend_EnfuseArgs"));
1134 cfg->Write(wxT(
"/Celeste/Threshold"), td);
1135 cfg->Write(wxT(
"/Celeste/Filter"),
MY_G_CHOICE_VAL(
"prefs_celeste_filter"));
1137 cfg->Write(wxT(
"/OptimizePhotometric/nRandomPointsPerImage"),
MY_G_SPIN_VAL(
"prefs_photo_optimizer_nr_points"));
1138 cfg->Write(wxT(
"/ShowSaveMessage"),
MY_G_BOOL_VAL(
"prefs_warning_save"));
1139 cfg->Write(wxT(
"/ShowExposureWarning"),
MY_G_BOOL_VAL(
"prefs_warning_exposure"));
1140 cfg->Write(wxT(
"/ShowFisheyeCropHint"),
MY_G_BOOL_VAL(
"prefs_warning_fisheye_crop"));
1141 cfg->Write(wxT(
"/EditCPAfterAction"),
MY_G_CHOICE_VAL(
"pref_editcp_action"));
1150 if(cpdetector_dlg.ShowModal()==wxOK)
1163 if (selection == wxNOT_FOUND)
1165 wxMessageBox(_(
"Please select an entry first"),_(
"Select Entry"),wxOK |
1166 wxICON_EXCLAMATION,
this);
1171 if(autopano_dlg.ShowModal()==wxOK)
1185 wxMessageBox(_(
"You can't delete the last setting.\nAt least one setting is required."),_(
"Warning"),wxOK | wxICON_EXCLAMATION,
this);
1189 if(wxMessageBox(wxString::Format(_(
"Do you really want to remove control point detector setting \"%s\"?"),
cpdetector_config_edit.
settings[selection].GetCPDetectorDesc().c_str())
1190 ,_(
"Delete control point detector setting"),wxYES_NO | wxICON_QUESTION,
this)==wxYES)
1221 if(selection<m_CPDetectorList->GetCount()-1)
1247 wxFileDialog dlg(
this,_(
"Load control point detector settings"),
1248 wxConfigBase::Get()->Read(wxT(
"/actualPath"),wxT(
"")), wxEmptyString,
1249 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1250 if (dlg.ShowModal() == wxID_OK)
1252 wxConfig::Get()->Write(wxT(
"/actualPath"), dlg.GetDirectory());
1253 wxString fn = dlg.GetPath();
1262 wxFileDialog dlg(
this,_(
"Save control point detector settings"),
1263 wxConfigBase::Get()->Read(wxT(
"/actualPath"),wxT(
"")), wxEmptyString,
1264 _(
"Control point detector settings (*.setting)|*.setting"),wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1265 if (dlg.ShowModal() == wxID_OK)
1267 wxConfig::Get()->Write(wxT(
"/actualPath"), dlg.GetDirectory());
1268 wxString fn = dlg.GetPath();
1272 if(fn.Right(8)!=wxT(
".setting"))
1274 fn.Append(wxT(
".setting"));
1289 XRCCTRL(*
this,
"pref_tiff_compression_label",wxStaticText)->Show(i==0);
1290 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->Show(i==0);
1291 XRCCTRL(*
this,
"pref_jpeg_quality_label",wxStaticText)->Show(i==1);
1292 XRCCTRL(*
this,
"pref_jpeg_quality",wxSpinCtrl)->Show(i==1);
1293 XRCCTRL(*
this,
"pref_tiff_compression",wxChoice)->GetParent()->Layout();
1304 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->Enable(i==0);
1305 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->Enable(i==0);
1311 wxConfigBase* config=wxConfigBase::Get();
1312 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(config->Read(wxT(
"/Processor/start"),
HUGIN_PROCESSOR_START) == 1);
1313 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(config->Read(wxT(
"/Processor/verbose"),
HUGIN_PROCESSOR_VERBOSE) == 1);
1318 XRCCTRL(*
this,
"pref_processor_start",wxCheckBox)->SetValue(
true);
1319 XRCCTRL(*
this,
"pref_processor_verbose",wxCheckBox)->SetValue(
true);
1332 XRCCTRL(*
this,
"pref_internal_blender_seam_label", wxStaticText)->Show(blender == 1);
1333 wxChoice* seamChoice = XRCCTRL(*
this,
"pref_internal_blender_seam", wxChoice);
1334 seamChoice->Show(blender == 1);
1335 seamChoice->Enable(blender == 1);
1340 XRCCTRL(*
this,
"prefs_project_filename_preview", wxStaticText)->SetLabel(
1347 XRCCTRL(*
this,
"prefs_output_filename_preview", wxStaticText)->SetLabel(
1355 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 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
void OnCPDetectorListDblClick(wxCommandEvent &e)
#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
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)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
#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)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.
#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 OnCancel(wxCommandEvent &e)
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 OnCPDetectorSave(wxCommandEvent &e)
event handler for saving cp detector settings