Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PreferencesDialog.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
27 #include "hugin_config.h"
28 #include "panoinc_WX.h"
29 #include "wx/listbook.h"
30 #include <wx/stdpaths.h>
31 #include "panoinc.h"
32 
33 #include "base_wx/wxPlatform.h"
34 #include "base_wx/LensTools.h"
35 
36 #include "hugin/huginApp.h"
37 #include "hugin/config_defaults.h"
39 #include "hugin/CPDetectorDialog.h"
40 #include "hugin/MainFrame.h"
42 #include "base_wx/huginConfig.h"
43 
44 // validators are working different somehow...
45 //#define MY_STR_VAL(id, filter) { XRCCTRL(*this, "prefs_" #id, wxTextCtrl)->SetValidator(wxTextValidator(filter, &id)); }
46 //#define MY_SPIN_VAL(id) { XRCCTRL(*this, "prefs_" #id, wxSpinCtrl)->SetValidator(wxGenericValidator(&id)); }
47 
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); };
53 
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()
58 
60 //: wxDialog(parent, -1, _("Preferences - hugin"))
61 {
62  DEBUG_TRACE("");
63  // load our children. some children might need special
64  // initialization. this will be done later.
65  wxXmlResource::Get()->LoadDialog(this, parent, wxT("pref_dialog"));
66 
67  // Custom setup ( stuff that can not be done in XRC )
68  XRCCTRL(*this, "prefs_ft_RotationStartAngle", wxSpinCtrl)->SetRange(-180,0);
69  XRCCTRL(*this, "prefs_ft_RotationStopAngle", wxSpinCtrl)->SetRange(0,180);
70  XRCCTRL(*this, "prefs_ass_nControlPoints", wxSpinCtrl)->SetRange(3,3000);
71 
72  wxChoice* lang_choice = XRCCTRL(*this, "prefs_gui_language", wxChoice);
73  // add languages to choice
74  long* lp = new long;
75  *lp = wxLANGUAGE_DEFAULT;
76  lang_choice->Append(_("System default"), lp);
77  lp = new long;
78  *lp = wxLANGUAGE_BASQUE;
79  lang_choice->Append(_("Basque"), lp);
85  lp = new long;
86  *lp = wxLANGUAGE_CATALAN;
87  lang_choice->Append(_("Catalan"), lp);
88  lp = new long;
89  *lp = wxLANGUAGE_CHINESE_SIMPLIFIED;
90  lang_choice->Append(_("Chinese (Simplified)"), lp);
91  lp = new long;
92  *lp = wxLANGUAGE_CHINESE_TRADITIONAL;
93  lang_choice->Append(_("Chinese (Traditional)"), lp);
94  lp = new long;
95  *lp = wxLANGUAGE_CZECH;
96  lang_choice->Append(_("Czech"), lp);
97  lp = new long;
98  *lp = wxLANGUAGE_DANISH;
99  lang_choice->Append(_("Danish"), lp);
100  lp = new long;
101  *lp = wxLANGUAGE_DUTCH;
102  lang_choice->Append(_("Dutch"), lp);
103  lp = new long;
104  *lp = wxLANGUAGE_ENGLISH;
105  lang_choice->Append(_("English"), lp);
106  lp = new long;
107  *lp = wxLANGUAGE_FRENCH;
108  lang_choice->Append(_("French"), lp);
109  lp = new long;
110  *lp = wxLANGUAGE_GERMAN;
111  lang_choice->Append(_("German"), lp);
112  lp = new long;
113  *lp = wxLANGUAGE_HUNGARIAN;
114  lang_choice->Append(_("Hungarian"), lp);
115  lp = new long;
116  *lp = wxLANGUAGE_ITALIAN;
117  lang_choice->Append(_("Italian"), lp);
118  lp = new long;
119  *lp = wxLANGUAGE_JAPANESE;
120  lang_choice->Append(_("Japanese"), lp);
126  lp = new long;
127  *lp = wxLANGUAGE_POLISH;
128  lang_choice->Append(_("Polish"), lp);
129  lp = new long;
130  *lp = wxLANGUAGE_PORTUGUESE_BRAZILIAN;
131  lang_choice->Append(_("Portuguese (Brazilian)"), lp);
132  lp = new long;
133  *lp = wxLANGUAGE_RUSSIAN;
134  lang_choice->Append(_("Russian"), lp);
135  lp = new long;
136  *lp = wxLANGUAGE_SLOVAK;
137  lang_choice->Append(_("Slovak"), lp);
143  lp = new long;
144  *lp = wxLANGUAGE_SPANISH;
145  lang_choice->Append(_("Spanish"), lp);
146  lp = new long;
147  *lp = wxLANGUAGE_SWEDISH;
148  lang_choice->Append(_("Swedish"), lp);
154  lp = new long;
155  *lp = wxLANGUAGE_FINNISH;
156  lang_choice->Append(_("Finnish"), lp);
157  lp = new long;
158  *lp = wxLANGUAGE_VALENCIAN;
159  lang_choice->Append(_("Valencian (Southern Catalan)"), lp);
160  lang_choice->SetSelection(0);
161 
162  // enable auto completion on raw converter executables
163  XRCCTRL(*this, "pref_raw_dcraw_exe", wxTextCtrl)->AutoCompleteFileNames();
164  XRCCTRL(*this, "pref_raw_rt_exe", wxTextCtrl)->AutoCompleteFileNames();
165  XRCCTRL(*this, "pref_raw_darktable_exe", wxTextCtrl)->AutoCompleteFileNames();
166 
167  // default blender settings
168  FillBlenderList(XRCCTRL(*this, "pref_default_blender", wxChoice));
169 
170  wxStaticText* preview=XRCCTRL(*this, "prefs_project_filename_preview", wxStaticText);
171  preview->SetWindowStyle(preview->GetWindowStyle() | wxST_ELLIPSIZE_START);
172  preview=XRCCTRL(*this, "prefs_output_filename_preview", wxStaticText);
173  preview->SetWindowStyle(preview->GetWindowStyle() | wxST_ELLIPSIZE_START);
174  // enable auto-completion
175  XRCCTRL(*this, "prefs_misc_tempdir", wxTextCtrl)->AutoCompleteDirectories();
176  XRCCTRL(*this, "pref_exiftool_argfile", wxTextCtrl)->AutoCompleteFileNames();
177  XRCCTRL(*this, "pref_exiftool_argfile2", wxTextCtrl)->AutoCompleteFileNames();
178  XRCCTRL(*this, "prefs_enblend_EnblendExe", wxTextCtrl)->AutoCompleteFileNames();
179  XRCCTRL(*this, "prefs_enblend_EnfuseExe", wxTextCtrl)->AutoCompleteFileNames();
180  // load autopano settings
181  wxConfigBase* cfg = wxConfigBase::Get();
182  m_CPDetectorList = XRCCTRL(*this, "pref_cpdetector_list", wxListBox);
183  m_CPDetectorList->Bind(wxEVT_LEFT_DCLICK, [this](wxMouseEvent& e) {
184  wxCommandEvent evt; this->OnCPDetectorEdit(evt); });
186 
187 #if defined __APPLE__ && defined __aarch64__
188  {
189  // disable GPU remapping checkbox on ARM Macs, GPU code is not working on these systems
190  wxCheckBox* gpuCheckBox = XRCCTRL(*this, "prefs_nona_useGpu", wxCheckBox);
191  gpuCheckBox->Disable();
192  gpuCheckBox->SetValue(false);
193  cfg->Write("/Nona/UseGPU", false);
194  gpuCheckBox->Hide();
195  }
196 #endif
197 
198  // Load configuration values from wxConfig
200 
201  Update();
202  GetSizer()->SetSizeHints(this);
203  // bind all event handler for buttons and boxes
204  Bind(wxEVT_BUTTON, &PreferencesDialog::OnEnblendExe, this, XRCID("prefs_enblend_select"));
205  Bind(wxEVT_BUTTON, &PreferencesDialog::OnEnfuseExe, this, XRCID("prefs_enblend_enfuse_select"));
206  Bind(wxEVT_BUTTON, &PreferencesDialog::OnDcrawExe, this, XRCID("pref_raw_dcraw_exe_select"));
207  Bind(wxEVT_BUTTON, &PreferencesDialog::OnRawTherapeeExe, this, XRCID("pref_raw_rt_exe_select"));
208  Bind(wxEVT_BUTTON, &PreferencesDialog::OnDarktableExe, this, XRCID("pref_raw_darktable_exe_select"));
209  Bind(wxEVT_BUTTON, &PreferencesDialog::OnExifArgfileChoose, this, XRCID("pref_exiftool_argfile_choose"));
210  Bind(wxEVT_BUTTON, &PreferencesDialog::OnExifArgfileEdit, this, XRCID("pref_exiftool_argfile_edit"));
211  Bind(wxEVT_BUTTON, &PreferencesDialog::OnExifArgfile2Choose, this, XRCID("pref_exiftool_argfile2_choose"));
212  Bind(wxEVT_BUTTON, &PreferencesDialog::OnExifArgfile2Edit, this, XRCID("pref_exiftool_argfile2_edit"));
213  Bind(wxEVT_CHECKBOX, &PreferencesDialog::OnExifTool, this, XRCID("pref_exiftool_metadata"));
214  Bind(wxEVT_CHECKBOX, &PreferencesDialog::OnRotationCheckBox, this, XRCID("prefs_ft_RotationSearch"));
215  Bind(wxEVT_CHECKBOX, &PreferencesDialog::OnCustomEnblend, this, XRCID("prefs_enblend_Custom"));
216  Bind(wxEVT_CHECKBOX, &PreferencesDialog::OnCustomEnfuse, this, XRCID("prefs_enblend_enfuseCustom"));
217  Bind(wxEVT_CHECKBOX, &PreferencesDialog::OnUserDefinedOutputOptionsCheckBox, this, XRCID("pref_ass_output"));
218  Bind(wxEVT_BUTTON, &PreferencesDialog::OnChangeUserDefinedOutputOptions, this, XRCID("pref_ass_change_output"));
219  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorAdd, this, XRCID("pref_cpdetector_new"));
220  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorEdit, this, XRCID("pref_cpdetector_edit"));
221  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorDelete, this, XRCID("pref_cpdetector_del"));
222  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorMoveUp, this, XRCID("pref_cpdetector_moveup"));
223  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorMoveDown, this, XRCID("pref_cpdetector_movedown"));
224  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorDefault, this, XRCID("pref_cpdetector_default"));
225  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorLoad, this, XRCID("pref_cpdetector_load"));
226  Bind(wxEVT_BUTTON, &PreferencesDialog::OnCPDetectorSave, this, XRCID("pref_cpdetector_save"));
227  Bind(wxEVT_CHOICE, &PreferencesDialog::OnFileFormatChanged, this, XRCID("pref_ldr_output_file_format"));
228  Bind(wxEVT_CHOICE, &PreferencesDialog::OnProcessorChanged, this, XRCID("pref_processor_gui"));
229  Bind(wxEVT_CHOICE, &PreferencesDialog::OnBlenderChanged, this, XRCID("pref_default_blender"));
230  Bind(wxEVT_TEXT, &PreferencesDialog::OnUpdateProjectFilename, this, XRCID("prefs_project_filename"));
231  Bind(wxEVT_TEXT, &PreferencesDialog::OnUpdateOutputFilename, this, XRCID("prefs_output_filename"));
232 
233  // only enable bundled if the build is actually bundled.
234 #if defined __WXMSW__ || defined MAC_SELF_CONTAINED_BUNDLE
235 
236 #else
237  MY_BOOL_VAL("prefs_enblend_Custom", HUGIN_ENBLEND_EXE_CUSTOM);
238  XRCCTRL(*this, "prefs_enblend_Custom", wxCheckBox)->Hide();
239  cfg->Write(wxT("/Enblend/Custom"), HUGIN_ENBLEND_EXE_CUSTOM);
240 
241  MY_BOOL_VAL("prefs_enblend_enfuseCustom", HUGIN_ENFUSE_EXE_CUSTOM);
242  XRCCTRL(*this, "prefs_enblend_enfuseCustom", wxCheckBox)->Hide();
243  cfg->Write(wxT("/Enfuse/Custom"), HUGIN_ENFUSE_EXE_CUSTOM);
244 #endif
245 
246  RestoreFramePosition(this, wxT("PreferencesDialog"));
247  // event handler for default buttons
248  Bind(wxEVT_BUTTON, &PreferencesDialog::OnOk, this, wxID_OK);
249  Bind(wxEVT_BUTTON, &PreferencesDialog::OnHelp, this, wxID_HELP);
250  Bind(wxEVT_BUTTON, &PreferencesDialog::OnRestoreDefaults, this, XRCID("prefs_defaults"));
251 }
252 
253 
255 {
256  DEBUG_TRACE("begin dtor");
257 
258  StoreFramePosition(this, wxT("PreferencesDialog"));
259 
260  // delete custom list data
261  wxChoice* lang_choice = XRCCTRL(*this, "prefs_gui_language", wxChoice);
262  for (int i = 0; i < (int) lang_choice->GetCount(); i++)
263  {
264  delete static_cast<long*>(lang_choice->GetClientData(i));
265  }
266 
267  DEBUG_TRACE("end dtor");
268 }
269 
270 void PreferencesDialog::OnOk(wxCommandEvent& e)
271 {
273  this->EndModal(wxOK);
274 }
275 
276 void PreferencesDialog::OnHelp(wxCommandEvent& e)
277 {
278  MainFrame::Get()->DisplayHelp(wxT("Hugin_Preferences.html"));
279 };
280 
282 {
283  EnableRotationCtrls(e.IsChecked());
284 }
285 
286 void PreferencesDialog::OnEnblendExe(wxCommandEvent& e)
287 {
288  wxFileDialog dlg(this,_("Select Enblend"),
289  wxT(""), wxT(HUGIN_ENBLEND_EXE),
290 #ifdef __WXMSW__
291  _("Executables (*.exe)|*.exe"),
292 #else
293  wxT("*"),
294 #endif
295  wxFD_OPEN, wxDefaultPosition);
296  if (dlg.ShowModal() == wxID_OK)
297  {
298  XRCCTRL(*this, "prefs_enblend_EnblendExe", wxTextCtrl)->SetValue(
299  dlg.GetPath());
300  }
301 }
302 
303 void PreferencesDialog::OnEnfuseExe(wxCommandEvent& e)
304 {
305  wxFileDialog dlg(this,_("Select Enfuse"),
306  wxT(""), wxT(HUGIN_ENFUSE_EXE),
307 #ifdef __WXMSW__
308  _("Executables (*.exe)|*.exe"),
309 #else
310  wxT("*"),
311 #endif
312  wxFD_OPEN, wxDefaultPosition);
313  if (dlg.ShowModal() == wxID_OK)
314  {
315  XRCCTRL(*this, "prefs_enblend_EnfuseExe", wxTextCtrl)->SetValue(
316  dlg.GetPath());
317  }
318 }
319 
320 void PreferencesDialog::OnDcrawExe(wxCommandEvent & e)
321 {
322  wxTextCtrl* ctrl = XRCCTRL(*this, "pref_raw_dcraw_exe", wxTextCtrl);
323  wxFileDialog dlg(this, _("Select dcraw"), "", ctrl->GetValue(),
324 #ifdef __WXMSW__
325  _("Executables (*.exe)|*.exe"),
326 #else
327  wxT("*"),
328 #endif
329  wxFD_OPEN, wxDefaultPosition);
330  if (dlg.ShowModal() == wxID_OK)
331  {
332  ctrl->SetValue(dlg.GetPath());
333  };
334 };
335 
336 void PreferencesDialog::OnRawTherapeeExe(wxCommandEvent & e)
337 {
338  wxTextCtrl* ctrl = XRCCTRL(*this, "pref_raw_rt_exe", wxTextCtrl);
339  wxFileDialog dlg(this, _("Select RawTherapee-cli"), "", ctrl->GetValue(),
340 #ifdef __WXMSW__
341  _("Executables (*.exe)|*.exe"),
342 #else
343  wxT("*"),
344 #endif
345  wxFD_OPEN, wxDefaultPosition);
346  if (dlg.ShowModal() == wxID_OK)
347  {
348  ctrl->SetValue(dlg.GetPath());
349  };
350 };
351 
352 void PreferencesDialog::OnDarktableExe(wxCommandEvent & e)
353 {
354  wxTextCtrl* ctrl = XRCCTRL(*this, "pref_raw_darktable_exe", wxTextCtrl);
355  wxFileDialog dlg(this, _("Select Darktable-cli"), "", ctrl->GetValue(),
356 #ifdef __WXMSW__
357  _("Executables (*.exe)|*.exe"),
358 #else
359  wxT("*"),
360 #endif
361  wxFD_OPEN, wxDefaultPosition);
362  if (dlg.ShowModal() == wxID_OK)
363  {
364  ctrl->SetValue(dlg.GetPath());
365  };
366 };
367 
368 
369 void PreferencesDialog::OnCustomEnblend(wxCommandEvent& e)
370 {
371  XRCCTRL(*this, "prefs_enblend_EnblendExe", wxTextCtrl)->Enable(e.IsChecked());
372  XRCCTRL(*this, "prefs_enblend_select", wxButton)->Enable(e.IsChecked());
373 }
374 
375 void PreferencesDialog::OnCustomEnfuse(wxCommandEvent& e)
376 {
377  XRCCTRL(*this, "prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(e.IsChecked());
378  XRCCTRL(*this, "prefs_enblend_enfuse_select", wxButton)->Enable(e.IsChecked());
379 }
380 
382 {
383  wxFileDialog dlg(this,_("Select ExifTool argfile"),
384  wxT(""), XRCCTRL(*this, "pref_exiftool_argfile", wxTextCtrl)->GetValue(),
385  _("ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
386  wxFD_OPEN, wxDefaultPosition);
387  if (dlg.ShowModal() == wxID_OK)
388  {
389  XRCCTRL(*this, "pref_exiftool_argfile", wxTextCtrl)->SetValue(
390  dlg.GetPath());
391  }
392 }
393 
394 void CreateNewArgFile(const wxString& newFilename, const wxString& sourceFile)
395 {
396  wxTextFile defaultFile(sourceFile);
397  defaultFile.Open();
398  wxTextFile newFile(newFilename);
399  newFile.Create();
400  if (defaultFile.IsOpened())
401  {
402  for (size_t i = 0; i < defaultFile.GetLineCount(); ++i)
403  {
404  newFile.AddLine(defaultFile[i]);
405  };
406  };
407  newFile.Write();
408  defaultFile.Close();
409  newFile.Close();
410 };
411 
412 void PreferencesDialog::OnExifArgfileEdit(wxCommandEvent & e)
413 {
414  wxString filename=XRCCTRL(*this, "pref_exiftool_argfile", wxTextCtrl)->GetValue();
415  if(!filename.empty())
416  {
417  wxFileName file(filename);
418  file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
419  if(!file.Exists())
420  {
421  if( wxMessageBox(wxString::Format(_("File %s does not exist.\nShould the argfile be created with default tags?"),filename.c_str()),
422  _("Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,this)!=wxYES)
423  {
424  return;
425  };
426  filename = file.GetFullPath();
427  CreateNewArgFile(filename, MainFrame::Get()->GetDataPath() + wxT("hugin_exiftool_copy.arg"));
428  }
429  else
430  {
431  filename = file.GetFullPath();
432  };
433  }
434  else
435  {
436  if( wxMessageBox(_("No file selected.\nShould an argfile be created with default tags?"),
437  _("Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION,this)!=wxYES)
438  {
439  return;
440  };
441  wxFileDialog dlg(this,_("Select new ExifTool argfile"),
442  wxStandardPaths::Get().GetUserConfigDir(), wxT(""),
443  _("ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
444  wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
445  if (dlg.ShowModal() != wxID_OK)
446  {
447  return;
448  };
449  filename=dlg.GetPath();
450  CreateNewArgFile(filename, MainFrame::Get()->GetDataPath() + wxT("hugin_exiftool_copy.arg"));
451  };
452  XRCCTRL(*this, "pref_exiftool_argfile", wxTextCtrl)->SetValue(filename);
453  wxDialog edit_dlg;
454  wxXmlResource::Get()->LoadDialog(&edit_dlg, this, wxT("pref_edit_argfile"));
455  RestoreFramePosition(&edit_dlg, wxT("EditArgfile"));
456  wxTextCtrl* argfileControl=XRCCTRL(edit_dlg, "pref_edit_textcontrol", wxTextCtrl);
457  argfileControl->LoadFile(filename);
458  if(edit_dlg.ShowModal() == wxID_OK)
459  {
460  if(!argfileControl->SaveFile(filename))
461  {
462  wxMessageBox(wxString::Format(_("Could not save file \"%s\"."), filename.c_str()),
463  _("Error"), wxOK | wxICON_ERROR);
464  };
465  StoreFramePosition(&edit_dlg, wxT("EditArgfile"));
466  };
467 };
468 
470 {
471  wxFileDialog dlg(this, _("Select ExifTool argfile"),
472  wxT(""), XRCCTRL(*this, "pref_exiftool_argfile2", wxTextCtrl)->GetValue(),
473  _("ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
474  wxFD_OPEN, wxDefaultPosition);
475  if (dlg.ShowModal() == wxID_OK)
476  {
477  XRCCTRL(*this, "pref_exiftool_argfile2", wxTextCtrl)->SetValue(
478  dlg.GetPath());
479  }
480 }
481 
483 {
484  wxString filename = XRCCTRL(*this, "pref_exiftool_argfile2", wxTextCtrl)->GetValue();
485  if (!filename.empty())
486  {
487  wxFileName file(filename);
488  file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_SHORTCUT);
489  if (!file.Exists())
490  {
491  if (wxMessageBox(wxString::Format(_("File %s does not exist.\nShould an example argfile be created?"), filename.c_str()),
492  _("Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION, this) != wxYES)
493  {
494  return;
495  };
496  filename = file.GetFullPath();
497  CreateNewArgFile(filename, MainFrame::Get()->GetDataPath() + wxT("hugin_exiftool_final_example.arg"));
498  }
499  else
500  {
501  filename = file.GetFullPath();
502  };
503  }
504  else
505  {
506  if (wxMessageBox(_("No file selected.\nShould an example argfile be created?"),
507  _("Exiftool argfile"), wxYES_NO | wxICON_EXCLAMATION, this) != wxYES)
508  {
509  return;
510  };
511  wxFileDialog dlg(this, _("Select new ExifTool argfile"),
512  wxStandardPaths::Get().GetUserConfigDir(), wxT(""),
513  _("ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
514  wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
515  if (dlg.ShowModal() != wxID_OK)
516  {
517  return;
518  };
519  filename = dlg.GetPath();
520  CreateNewArgFile(filename, MainFrame::Get()->GetDataPath() + wxT("hugin_exiftool_final_example.arg"));
521  };
522  XRCCTRL(*this, "pref_exiftool_argfile2", wxTextCtrl)->SetValue(filename);
523  wxDialog edit_dlg;
524  wxXmlResource::Get()->LoadDialog(&edit_dlg, this, wxT("pref_edit_argfile_placeholders"));
525  RestoreFramePosition(&edit_dlg, wxT("EditArgfilePlaceholders"));
526  wxTextCtrl* argfileControl = XRCCTRL(edit_dlg, "pref_edit_textcontrol", wxTextCtrl);
527  argfileControl->LoadFile(filename);
528  if (edit_dlg.ShowModal() == wxID_OK)
529  {
530  if (!argfileControl->SaveFile(filename))
531  {
532  wxMessageBox(wxString::Format(_("Could not save file \"%s\"."), filename.c_str()),
533  _("Error"), wxOK | wxICON_ERROR);
534  };
535  StoreFramePosition(&edit_dlg, wxT("EditArgfilePlaceholders"));
536  };
537 };
538 
539 void PreferencesDialog::OnExifTool(wxCommandEvent & e)
540 {
541  bool copyMetadata=XRCCTRL(*this, "pref_exiftool_metadata", wxCheckBox)->GetValue();
542  XRCCTRL(*this, "pref_exiftool_argfile_general_label", wxStaticText)->Enable(copyMetadata);
543  XRCCTRL(*this, "pref_exiftool_argfile_intermediate_label", wxStaticText)->Enable(copyMetadata);
544  XRCCTRL(*this, "pref_exiftool_argfile_label", wxStaticText)->Enable(copyMetadata);
545  XRCCTRL(*this, "pref_exiftool_argfile", wxTextCtrl)->Enable(copyMetadata);
546  XRCCTRL(*this, "pref_exiftool_argfile_choose", wxButton)->Enable(copyMetadata);
547  XRCCTRL(*this, "pref_exiftool_argfile_edit", wxButton)->Enable(copyMetadata);
548  XRCCTRL(*this, "pref_exiftool_argfile_final_label", wxStaticText)->Enable(copyMetadata);
549  XRCCTRL(*this, "pref_exiftool_argfile2_label", wxStaticText)->Enable(copyMetadata);
550  XRCCTRL(*this, "pref_exiftool_argfile2", wxTextCtrl)->Enable(copyMetadata);
551  XRCCTRL(*this, "pref_exiftool_argfile2_choose", wxButton)->Enable(copyMetadata);
552  XRCCTRL(*this, "pref_exiftool_argfile2_edit", wxButton)->Enable(copyMetadata);
553  XRCCTRL(*this, "pref_exiftool_gpano", wxCheckBox)->Enable(copyMetadata);
554 };
555 
557 {
558  XRCCTRL(*this, "prefs_ft_rot_panel", wxPanel)->Enable(enable);
559 }
560 
562 {
563  DEBUG_DEBUG("Updating display data");
564 
565  double d;
566  bool t;
567  wxString tstr;
568  wxConfigBase* cfg = wxConfigBase::Get();
569 
570  if (panel==0 || panel == 1)
571  {
572  // memory setting
573  unsigned long long mem = cfg->Read(wxT("/ImageCache/UpperBound"), HUGIN_IMGCACHE_UPPERBOUND);
574 #ifdef __WXMSW__
575  unsigned long mem_low = cfg->Read(wxT("/ImageCache/UpperBound"), HUGIN_IMGCACHE_UPPERBOUND);
576  unsigned long mem_high = cfg->Read(wxT("/ImageCache/UpperBoundHigh"), (long) 0);
577  if (mem_high > 0)
578  {
579  mem = ((unsigned long long) mem_high << 32) + mem_low;
580  }
581  else
582  {
583  mem = mem_low;
584  }
585 #endif
586  MY_SPIN_VAL("prefs_cache_UpperBound", mem >> 20);
587 
588  // language
589  // check if current language is in list and activate it then.
590  wxChoice* lang_choice = XRCCTRL(*this, "prefs_gui_language", wxChoice);
591  int curlang = cfg->Read(wxT("language"), HUGIN_LANGUAGE);
592  bool found = false;
593  int idx = 0;
594  for (int i = 0; i < (int)lang_choice->GetCount(); i++)
595  {
596  long lang = * static_cast<long*>(lang_choice->GetClientData(i));
597  if (curlang == lang)
598  {
599  found = true;
600  idx = i;
601  }
602  }
603  if (found)
604  {
605  DEBUG_DEBUG("wxChoice language updated:" << curlang);
606  // update language
607  lang_choice->SetSelection(idx);
608  }
609  else
610  {
611  // unknown language selected..
612  DEBUG_WARN("Unknown language configured");
613  }
614 
615  // smart undo
616  t = cfg->Read(wxT("smartUndo"), HUGIN_SMART_UNDO) == 1;
617  MY_BOOL_VAL("prefs_smart_undo", t);
618 
619  // copy log to clipboard
620  t = cfg->Read(wxT("CopyLogToClipboard"), 0l) == 1;
621  MY_BOOL_VAL("prefs_copy_log", t);
622 
623  t = cfg->Read(wxT("/GLPreviewFrame/ShowProjectionHints"), HUGIN_SHOW_PROJECTION_HINTS) == 1;
624  MY_BOOL_VAL("pref_show_projection_hints", t);
625  // auto-rotate
626  t = cfg->Read("/CPEditorPanel/AutoRot", 1l) == 1;
627  MY_BOOL_VAL("pref_autorotate", t);
628 
629  // raw converter programs paths
630  MY_STR_VAL("pref_raw_dcraw_exe", cfg->Read("/RawImportDialog/dcrawExe", ""));
631  MY_STR_VAL("pref_raw_rt_exe", cfg->Read("/RawImportDialog/RTExe", ""));
632  MY_STR_VAL("pref_raw_darktable_exe", cfg->Read("/RawImportDialog/DarktableExe", ""));
633  };
634 
635  // filename panel
636  if(panel==0 || panel==2)
637  {
638  // tempdir
639  MY_STR_VAL("prefs_misc_tempdir", cfg->Read(wxT("tempDir"),wxT("")));
640  // default filenames
641  wxString filename=cfg->Read(wxT("ProjectFilename"), wxT(HUGIN_DEFAULT_PROJECT_NAME));
642 #ifdef __WXMSW__
643  filename.Replace(wxT("/"),wxT("\\"),true);
644 #endif
645  MY_STR_VAL("prefs_project_filename", filename);
646  filename=cfg->Read(wxT("OutputFilename"), wxT(HUGIN_DEFAULT_OUTPUT_NAME));
647 #ifdef __WXMSW__
648  filename.Replace(wxT("/"),wxT("\\"),true);
649 #endif
650  MY_STR_VAL("prefs_output_filename", filename);
651  }
652 
653  if (panel==0 || panel == 3)
654  {
655  // Assistant settings
656  t = cfg->Read(wxT("/Assistant/autoAlign"), HUGIN_ASS_AUTO_ALIGN) == 1;
657  MY_BOOL_VAL("prefs_ass_autoAlign", t);
658  t = cfg->Read(wxT("/General/IgnoreFovRectilinearOnAdd"), 1l) == 1l;
659  MY_BOOL_VAL("prefs_ass_loadFovRectilinear", !t);
660  MY_SPIN_VAL("prefs_ass_nControlPoints",
661  cfg->Read(wxT("/Assistant/nControlPoints"), HUGIN_ASS_NCONTROLPOINTS));
662  double factor = HUGIN_ASS_PANO_DOWNSIZE_FACTOR;
663  cfg->Read(wxT("/Assistant/panoDownsizeFactor"), &factor);
664  MY_SPIN_VAL("prefs_ass_panoDownsizeFactor",(int)(factor*100.0));
665  t = cfg->Read(wxT("/Assistant/Linefind"), HUGIN_ASS_LINEFIND) == 1;
666  MY_BOOL_VAL("prefs_ass_linefind", t);
667  t = cfg->Read(wxT("/Celeste/Auto"), HUGIN_CELESTE_AUTO) == 1;
668  MY_BOOL_VAL("prefs_celeste_auto", t);
669  t = cfg->Read(wxT("/Assistant/AutoCPClean"), HUGIN_ASS_AUTO_CPCLEAN) == 1;
670  MY_BOOL_VAL("prefs_auto_cpclean", t);
671  t = cfg->Read(wxT("/Assistant/UserDefinedOutputOption"), 0l) == 1;
672  MY_BOOL_VAL("pref_ass_output", t);
673  wxCommandEvent dummy;
675  }
676  // Fine tune settings
677 
678  if (panel==0 || panel == 4)
679  {
680  // hdr display settings
681  MY_CHOICE_VAL("prefs_misc_hdr_mapping", cfg->Read(wxT("/ImageCache/Mapping"), HUGIN_IMGCACHE_MAPPING_FLOAT));
682  //MY_CHOICE_VAL("prefs_misc_hdr_range", cfg->Read(wxT("/ImageCache/Range"), HUGIN_IMGCACHE_RANGE));
683 
684  int val = wxConfigBase::Get()->Read(wxT("/CPEditorPanel/MagnifierWidth"), 61l);
685  val = hugin_utils::floori((val - 61) / 20);
686  val = std::min(val, 3);
687  XRCCTRL(*this, "prefs_misc_magnifier_width", wxChoice)->SetSelection(val);
688 
689 
690  MY_SPIN_VAL("prefs_ft_TemplateSize",
691  cfg->Read(wxT("/Finetune/TemplateSize"),HUGIN_FT_TEMPLATE_SIZE));
692  MY_SPIN_VAL("prefs_ft_SearchAreaPercent",cfg->Read(wxT("/Finetune/SearchAreaPercent"),
694  MY_SPIN_VAL("prefs_ft_LocalSearchWidth", cfg->Read(wxT("/Finetune/LocalSearchWidth"),
696 
698  cfg->Read(wxT("/Finetune/CorrThreshold"), &d, HUGIN_FT_CORR_THRESHOLD);
700  MY_STR_VAL("prefs_ft_CorrThreshold", tstr);
701 
702  cfg->Read(wxT("/Finetune/CurvThreshold"), &d, HUGIN_FT_CURV_THRESHOLD);
704  MY_STR_VAL("prefs_ft_CurvThreshold", tstr);
705 
706  t = cfg->Read(wxT("/Finetune/RotationSearch"), HUGIN_FT_ROTATION_SEARCH) == 1;
707  MY_BOOL_VAL("prefs_ft_RotationSearch", t);
709 
711  cfg->Read(wxT("/Finetune/RotationStartAngle"),&d,HUGIN_FT_ROTATION_START_ANGLE);
712  MY_SPIN_VAL("prefs_ft_RotationStartAngle", hugin_utils::roundi(d))
713 
715  cfg->Read(wxT("/Finetune/RotationStopAngle"), &d, HUGIN_FT_ROTATION_STOP_ANGLE);
716  MY_SPIN_VAL("prefs_ft_RotationStopAngle", hugin_utils::roundi(d));
717 
718  MY_SPIN_VAL("prefs_ft_RotationSteps", cfg->Read(wxT("/Finetune/RotationSteps"),
720  }
721 
724 
727 
728  if (panel==0 || panel == 5)
729  {
731  }
732 
733  if (panel == 0 || panel == 6)
734  {
737  MY_CHOICE_VAL("pref_ldr_output_file_format", cfg->Read(wxT("/output/ldr_format"), HUGIN_LDR_OUTPUT_FORMAT));
739  // MY_CHOICE_VAL("pref_hdr_output_file_format", cfg->Read(wxT("/output/hdr_format"), HUGIN_HDR_OUTPUT_FORMAT));
740  MY_CHOICE_VAL("pref_tiff_compression", cfg->Read(wxT("/output/tiff_compression"), HUGIN_TIFF_COMPRESSION));
741  MY_SPIN_VAL("pref_jpeg_quality", cfg->Read(wxT("/output/jpeg_quality"), HUGIN_JPEG_QUALITY));
743 
744  // default blender
745  SelectListValue(XRCCTRL(*this, "pref_default_blender", wxChoice), cfg->Read(wxT("/default_blender"), HUGIN_DEFAULT_BLENDER));
746  // default verdandi parameters
747  const wxString defaultVerdandiArgs = cfg->Read(wxT("/VerdandiDefaultArgs"), wxEmptyString);
748  if (defaultVerdandiArgs.Find(wxT("--seam=blend")) != wxNOT_FOUND)
749  {
750  XRCCTRL(*this, "pref_internal_blender_seam", wxChoice)->SetSelection(1);
751  }
752  else
753  {
754  XRCCTRL(*this, "pref_internal_blender_seam", wxChoice)->SetSelection(0);
755  };
757 
760  MY_CHOICE_VAL("pref_processor_gui", cfg->Read(wxT("/Processor/gui"), HUGIN_PROCESSOR_GUI));
761  t = cfg->Read(wxT("/Processor/start"), HUGIN_PROCESSOR_START) == 1;
762  MY_BOOL_VAL("pref_processor_start", t);
763  t = cfg->Read(wxT("/Processor/overwrite"), HUGIN_PROCESSOR_OVERWRITE) == 1;
764  MY_BOOL_VAL("pref_processor_overwrite", t);
765  t = cfg->Read(wxT("/Processor/verbose"), HUGIN_PROCESSOR_VERBOSE) == 1;
766  MY_BOOL_VAL("pref_processor_verbose", t);
768  }
769 
770  if (panel == 0 || panel == 7)
771  {
772  // stitching (2) panel
773  t = cfg->Read(wxT("/output/useExiftool"), HUGIN_USE_EXIFTOOL) == 1;
774  MY_BOOL_VAL("pref_exiftool_metadata", t);
775  MY_STR_VAL("pref_exiftool_argfile", cfg->Read(wxT("/output/CopyArgfile"), wxT("")));
776  MY_STR_VAL("pref_exiftool_argfile2", cfg->Read(wxT("/output/FinalArgfile"), wxT("")));
777  t = cfg->Read(wxT("/output/writeGPano"), HUGIN_EXIFTOOL_CREATE_GPANO) == 1;
778  MY_BOOL_VAL("pref_exiftool_gpano", t);
779  wxCommandEvent dummy;
780  OnExifTool(dummy);
781  // number of threads
782  int nThreads = cfg->Read(wxT("/output/NumberOfThreads"), 0l);
783  MY_SPIN_VAL("prefs_output_NumberOfThreads", nThreads);
784  }
785 
786  if (panel==0 || panel == 8)
787  {
788 
791  MY_CHOICE_VAL("prefs_nona_interpolator", cfg->Read(wxT("/Nona/Interpolator"), HUGIN_NONA_INTERPOLATOR));
792  t = cfg->Read(wxT("/Nona/CroppedImages"), HUGIN_NONA_CROPPEDIMAGES) == 1;
793  MY_BOOL_VAL("prefs_nona_createCroppedImages", t);
794  t = cfg->Read(wxT("/Nona/UseGPU"), HUGIN_NONA_USEGPU) == 1;
795  MY_BOOL_VAL("prefs_nona_useGpu", t);
796 
799  MY_STR_VAL("prefs_enblend_EnblendExe", cfg->Read(wxT("/Enblend/Exe"),
800  wxT(HUGIN_ENBLEND_EXE)));
801  bool customEnblendExe = HUGIN_ENBLEND_EXE_CUSTOM;
802  cfg->Read(wxT("/Enblend/Custom"), &customEnblendExe);
803  MY_BOOL_VAL("prefs_enblend_Custom", customEnblendExe);
804  XRCCTRL(*this, "prefs_enblend_EnblendExe", wxTextCtrl)->Enable(customEnblendExe);
805  XRCCTRL(*this, "prefs_enblend_select", wxButton)->Enable(customEnblendExe);
806  MY_STR_VAL("prefs_enblend_EnblendArgs", cfg->Read(wxT("/Enblend/Args"),
807  wxT(HUGIN_ENBLEND_ARGS)));
810  MY_STR_VAL("prefs_enblend_EnfuseExe", cfg->Read(wxT("/Enfuse/Exe"),
811  wxT(HUGIN_ENFUSE_EXE)));
812  bool customEnfuseExe = HUGIN_ENFUSE_EXE_CUSTOM;
813  cfg->Read(wxT("/Enfuse/Custom"), &customEnfuseExe);
814  MY_BOOL_VAL("prefs_enblend_enfuseCustom", customEnfuseExe);
815  XRCCTRL(*this, "prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(customEnfuseExe);
816  XRCCTRL(*this, "prefs_enblend_enfuse_select", wxButton)->Enable(customEnfuseExe);
817  MY_STR_VAL("prefs_enblend_EnfuseArgs", cfg->Read(wxT("/Enfuse/Args"),
818  wxT(HUGIN_ENFUSE_ARGS)));
819  }
820 
821  if (panel==0 || panel == 9)
822  {
823  // Celeste settings
825  cfg->Read(wxT("/Celeste/Threshold"), &d, HUGIN_CELESTE_THRESHOLD);
827  MY_STR_VAL("prefs_celeste_threshold", tstr);
828  MY_CHOICE_VAL("prefs_celeste_filter", cfg->Read(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER));
829  // photometric optimizer settings
830  MY_SPIN_VAL("prefs_photo_optimizer_nr_points", cfg->Read(wxT("/OptimizePhotometric/nRandomPointsPerImage"), HUGIN_PHOTOMETRIC_OPTIMIZER_NRPOINTS));
831  // warnings
832  t = cfg->Read(wxT("/ShowSaveMessage"), 1l) == 1;
833  MY_BOOL_VAL("prefs_warning_save", t);
834  t = cfg->Read(wxT("/ShowExposureWarning"), 1l) == 1;
835  MY_BOOL_VAL("prefs_warning_exposure", t);
836  t = cfg->Read(wxT("/ShowFisheyeCropHint"), 1l) == 1;
837  MY_BOOL_VAL("prefs_warning_fisheye_crop", t);
838  MY_CHOICE_VAL("pref_editcp_action", cfg->Read(wxT("/EditCPAfterAction"), 0l));
839  }
840 }
841 
843 {
844  DEBUG_TRACE("");
845  wxConfigBase* cfg = wxConfigBase::Get();
846  // check which tab is enabled
847  wxNotebook* noteb = XRCCTRL(*this, "prefs_tab", wxNotebook);
848  int really = wxMessageBox(_("Really reset displayed preferences to default values?"), _("Load Defaults"),
849  wxYES_NO, this);
850  if ( really == wxYES)
851  {
852  if (noteb->GetSelection() == 0)
853  {
854  // MISC
855  // cache
856  /*
857  * special treatment for windows not necessary here since we know the value of
858  * HUGIN_IMGCACHE_UPPERBOUND must fit into 32bit to be compatible with 32bit systems.
859  * However, just as a reminder:
860  #ifdef __WXMSW__
861  cfg->Write(wxT("/ImageCache/UpperBoundHigh"), HUGIN_IMGCACHE_UPPERBOUND >> 32);
862  #endif
863  */
864  cfg->Write(wxT("/ImageCache/UpperBound"), HUGIN_IMGCACHE_UPPERBOUND);
865  // locale
866  cfg->Write(wxT("language"), int(HUGIN_LANGUAGE));
867  // smart undo
868  cfg->Write(wxT("smartUndo"), HUGIN_SMART_UNDO);
869  cfg->Write(wxT("CopyLogToClipboard"), 0l);
870  // projection hints
871  cfg->Write(wxT("/GLPreviewFrame/ShowProjectionHints"), HUGIN_SHOW_PROJECTION_HINTS);
872  cfg->Write("/CPEditorPanel/AutoRot", 1l);
873  // raw converter
874  cfg->Write("/RawImportDialog/dcrawExe", "");
875  cfg->Write("/RawImportDialog/RTExe", "");
876  cfg->Write("/RawImportDialog/DarktableExe", "");
877  }
878  if(noteb->GetSelection() == 1)
879  {
880  cfg->Write(wxT("tempDir"), wxT(""));
881  cfg->Write(wxT("ProjectFilename"), wxT(HUGIN_DEFAULT_PROJECT_NAME));
882  cfg->Write(wxT("OutputFilename"), wxT(HUGIN_DEFAULT_OUTPUT_NAME));
883  };
884  if (noteb->GetSelection() == 2)
885  {
886  cfg->Write(wxT("/Assistant/autoAlign"), HUGIN_ASS_AUTO_ALIGN);
887  cfg->Write(wxT("/General/IgnoreFovRectilinearOnAdd"), 1l);
888  cfg->Write(wxT("/Assistant/nControlPoints"), HUGIN_ASS_NCONTROLPOINTS);
889  cfg->Write(wxT("/Assistant/panoDownsizeFactor"),HUGIN_ASS_PANO_DOWNSIZE_FACTOR);
890  cfg->Write(wxT("/Assistant/Linefind"), HUGIN_ASS_LINEFIND);
891  cfg->Write(wxT("/Celeste/Auto"), HUGIN_CELESTE_AUTO);
892  cfg->Write(wxT("/Assistant/AutoCPClean"), HUGIN_ASS_AUTO_CPCLEAN);
893  cfg->Write(wxT("/Assistant/UserDefinedOutputOption"), 0l);
894  }
895  if (noteb->GetSelection() == 3)
896  {
897  // hdr
898  cfg->Write(wxT("/ImageCache/Mapping"), HUGIN_IMGCACHE_MAPPING_FLOAT);
899  //cfg->Write(wxT("/ImageCache/Range"), HUGIN_IMGCACHE_RANGE);
900  cfg->Write(wxT("/CPEditorPanel/MagnifierWidth"), 61l);
901  // Fine tune settings
902  cfg->Write(wxT("/Finetune/SearchAreaPercent"), HUGIN_FT_SEARCH_AREA_PERCENT);
903  cfg->Write(wxT("/Finetune/TemplateSize"), HUGIN_FT_TEMPLATE_SIZE);
904  cfg->Write(wxT("/Finetune/LocalSearchWidth"), HUGIN_FT_LOCAL_SEARCH_WIDTH);
905 
906  cfg->Write(wxT("/Finetune/CorrThreshold"), HUGIN_FT_CORR_THRESHOLD);
907  cfg->Write(wxT("/Finetune/CurvThreshold"), HUGIN_FT_CURV_THRESHOLD);
908 
909  cfg->Write(wxT("/Finetune/RotationSearch"), HUGIN_FT_ROTATION_SEARCH);
910  cfg->Write(wxT("/Finetune/RotationStartAngle"), HUGIN_FT_ROTATION_START_ANGLE);
911  cfg->Write(wxT("/Finetune/RotationStopAngle"), HUGIN_FT_ROTATION_STOP_ANGLE);
912  cfg->Write(wxT("/Finetune/RotationSteps"), HUGIN_FT_ROTATION_STEPS);
913  }
914  if (noteb->GetSelection() == 4)
915  {
918  cpdetector_config_edit.ReadFromFile(huginApp::Get()->GetDataPath()+wxT("default.setting"));
920  }
921  if (noteb->GetSelection() == 5)
922  {
924  cfg->Write(wxT("/output/ldr_format"), HUGIN_LDR_OUTPUT_FORMAT);
926  // cfg->Write(wxT("/output/hdr_format"), HUGIN_HDR_OUTPUT_FORMAT);
927  cfg->Write(wxT("/output/tiff_compression"), HUGIN_TIFF_COMPRESSION);
928  cfg->Write(wxT("/output/jpeg_quality"), HUGIN_JPEG_QUALITY);
929  // default blender
930  cfg->Write(wxT("/default_blender"), static_cast<long>(HUGIN_DEFAULT_BLENDER));
931  cfg->Write(wxT("/VerdandiDefaultArgs"), wxEmptyString);
932  // stitching engine
933  cfg->Write(wxT("/Processor/gui"), HUGIN_PROCESSOR_GUI);
934  cfg->Write(wxT("/Processor/start"), HUGIN_PROCESSOR_START);
935  cfg->Write(wxT("/Processor/overwrite"), HUGIN_PROCESSOR_OVERWRITE);
936  cfg->Write(wxT("/Processor/verbose"), HUGIN_PROCESSOR_VERBOSE);
937  }
938  if (noteb->GetSelection() == 6)
939  {
940  cfg->Write(wxT("/output/useExiftool"), HUGIN_USE_EXIFTOOL);
941  cfg->Write(wxT("/output/CopyArgfile"), wxT(""));
942  cfg->Write(wxT("/output/FinalArgfile"), wxT(""));
943  cfg->Write(wxT("/output/writeGPano"), HUGIN_EXIFTOOL_CREATE_GPANO);
944  cfg->Write(wxT("/output/NumberOfThreads"), 0l);
945  }
946  if (noteb->GetSelection() == 7)
947  {
949  cfg->Write(wxT("/Enblend/Exe"), wxT(HUGIN_ENBLEND_EXE));
950  cfg->Write(wxT("/Enblend/Custom"), HUGIN_ENBLEND_EXE_CUSTOM);
951  cfg->Write(wxT("/Enblend/Args"), wxT(HUGIN_ENBLEND_ARGS));
952 
953  cfg->Write(wxT("/Enfuse/Exe"), wxT(HUGIN_ENFUSE_EXE));
954  cfg->Write(wxT("/Enfuse/Custom"), HUGIN_ENFUSE_EXE_CUSTOM);
955  cfg->Write(wxT("/Enfuse/Args"), wxT(HUGIN_ENFUSE_ARGS));
956  }
957 
958  if (noteb->GetSelection() == 8)
959  {
961  cfg->Write(wxT("/Celeste/Threshold"), HUGIN_CELESTE_THRESHOLD);
962  cfg->Write(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER);
963  cfg->Write(wxT("/OptimizePhotometric/nRandomPointsPerImage"), HUGIN_PHOTOMETRIC_OPTIMIZER_NRPOINTS);
964  cfg->Write(wxT("/ShowSaveMessage"), 1l);
965  cfg->Write(wxT("/ShowExposureWarning"), 1l);
966  cfg->Write(wxT("/ShowFisheyeCropHint"), 1l);
967  cfg->Write(wxT("/EditCPAfterAction"), 0l);
968  }
969 
970  /*
971  if (noteb->GetSelection() == 5) {
972  cfg->Write(wxT("/PTmender/Exe"), wxT(HUGIN_PT_MENDER_EXE) );
973  cfg->Write(wxT("/PTmender/Custom"),HUGIN_PT_MENDER_EXE_CUSTOM);
974  cfg->Write(wxT("/PanoTools/ScriptFile"), wxT("PT_script.txt"));
975  }
976  */
977  UpdateDisplayData(noteb->GetSelection() + 1);
978  }
979 }
980 
982 {
983  DEBUG_TRACE("");
984  wxConfigBase* cfg = wxConfigBase::Get();
985  // Assistant
986  cfg->Write(wxT("/Assistant/autoAlign"),MY_G_BOOL_VAL("prefs_ass_autoAlign"));
987  cfg->Write(wxT("/General/IgnoreFovRectilinearOnAdd"), !MY_G_BOOL_VAL("prefs_ass_loadFovRectilinear"));
988  cfg->Write(wxT("/Assistant/nControlPoints"), MY_G_SPIN_VAL("prefs_ass_nControlPoints"));
989  cfg->Write(wxT("/Assistant/panoDownsizeFactor"), MY_G_SPIN_VAL("prefs_ass_panoDownsizeFactor") / 100.0);
990  cfg->Write(wxT("/Assistant/Linefind"), MY_G_BOOL_VAL("prefs_ass_linefind"));
991  cfg->Write(wxT("/Celeste/Auto"), MY_G_BOOL_VAL("prefs_celeste_auto"));
992  cfg->Write(wxT("/Assistant/AutoCPClean"), MY_G_BOOL_VAL("prefs_auto_cpclean"));
993  cfg->Write(wxT("/Assistant/UserDefinedOutputOption"), MY_G_BOOL_VAL("pref_ass_output"));
994 
995  // hdr display
996  cfg->Write(wxT("/ImageCache/Mapping"),MY_G_CHOICE_VAL("prefs_misc_hdr_mapping"));
997  //cfg->Write(wxT("/ImageCache/Range"),MY_G_CHOICE_VAL("prefs_misc_hdr_range"));
998  cfg->Write(wxT("/CPEditorPanel/MagnifierWidth"), MY_G_CHOICE_VAL("prefs_misc_magnifier_width") * 20 + 61l);
999 
1000  // Fine tune settings
1001  cfg->Write(wxT("/Finetune/SearchAreaPercent"), MY_G_SPIN_VAL("prefs_ft_SearchAreaPercent"));
1002  cfg->Write(wxT("/Finetune/TemplateSize"), MY_G_SPIN_VAL("prefs_ft_TemplateSize"));
1003  cfg->Write(wxT("/Finetune/LocalSearchWidth"), MY_G_SPIN_VAL("prefs_ft_LocalSearchWidth"));
1004  wxString t = MY_G_STR_VAL("prefs_ft_CorrThreshold");
1005  double td= HUGIN_FT_CORR_THRESHOLD;
1006  hugin_utils::stringToDouble(std::string(t.mb_str(wxConvLocal)), td);
1007  cfg->Write(wxT("/Finetune/CorrThreshold"), td);
1008 
1009  t = MY_G_STR_VAL("prefs_ft_CurvThreshold");
1011  hugin_utils::stringToDouble(std::string(t.mb_str(wxConvLocal)), td);
1012  cfg->Write(wxT("/Finetune/CurvThreshold"), td);
1013 
1014  cfg->Write(wxT("/Finetune/RotationSearch"), MY_G_BOOL_VAL("prefs_ft_RotationSearch"));
1015  cfg->Write(wxT("/Finetune/RotationStartAngle"), (double) MY_G_SPIN_VAL("prefs_ft_RotationStartAngle"));
1016  cfg->Write(wxT("/Finetune/RotationStopAngle"), (double) MY_G_SPIN_VAL("prefs_ft_RotationStopAngle"));
1017  cfg->Write(wxT("/Finetune/RotationSteps"), MY_G_SPIN_VAL("prefs_ft_RotationSteps"));
1018 
1021  // cache
1022 #ifdef __WXMSW__
1023  // shifting only 12 bits rights: 32-20=12 and the prefs_cache_UpperBound is in GB
1024  cfg->Write(wxT("/ImageCache/UpperBoundHigh"), (long) MY_G_SPIN_VAL("prefs_cache_UpperBound") >> 12);
1025 #endif
1026  cfg->Write(wxT("/ImageCache/UpperBound"), (long) MY_G_SPIN_VAL("prefs_cache_UpperBound") << 20);
1027  // locale
1028  // language
1029  wxChoice* lang = XRCCTRL(*this, "prefs_gui_language", wxChoice);
1030  // DEBUG_TRACE("Language Selection Name: " << huginApp::Get()->GetLocale().GetLanguageName((int) lang->GetClientData(lang->GetSelection())).mb_str(wxConvLocal));
1031  //DEBUG_INFO("Language Selection locale: " << ((huginApp::Get()->GetLocale().GetLanguageInfo((int) lang->GetClientData(lang->GetSelection())))->CanonicalName).mb_str(wxConvLocal));
1032  //DEBUG_INFO("Current System Language ID: " << huginApp::Get()->GetLocale().GetSystemLanguage());
1033 
1034  void* tmplp = lang->GetClientData(lang->GetSelection());
1035  long templ = * static_cast<long*>(tmplp);
1036  cfg->Write(wxT("language"), templ);
1037  DEBUG_INFO("Language Selection ID: " << templ);
1038  // smart undo
1039  cfg->Write(wxT("smartUndo"), MY_G_BOOL_VAL("prefs_smart_undo"));
1040  cfg->Write(wxT("CopyLogToClipboard"), MY_G_BOOL_VAL("prefs_copy_log"));
1041  // show projections hints
1042  cfg->Write(wxT("/GLPreviewFrame/ShowProjectionHints"), MY_G_BOOL_VAL("pref_show_projection_hints"));
1043  //auto-rotate
1044  cfg->Write("/CPEditorPanel/AutoRot", MY_G_BOOL_VAL("pref_autorotate"));
1045  // raw converter
1046  cfg->Write("/RawImportDialog/dcrawExe", MY_G_STR_VAL("pref_raw_dcraw_exe"));
1047  cfg->Write("/RawImportDialog/RTExe", MY_G_STR_VAL("pref_raw_rt_exe"));
1048  cfg->Write("/RawImportDialog/DarktableExe", MY_G_STR_VAL("pref_raw_darktable_exe"));;
1049  // tempdir
1050  cfg->Write(wxT("tempDir"),MY_G_STR_VAL("prefs_misc_tempdir"));
1051  // filename templates
1052  wxString filename=XRCCTRL(*this, "prefs_project_filename", wxTextCtrl)->GetValue();
1053 #ifdef __WXMSW__
1054  filename.Replace(wxT("\\"), wxT("/"), true);
1055 #endif
1056  cfg->Write(wxT("ProjectFilename"), filename);
1057  filename=XRCCTRL(*this, "prefs_output_filename", wxTextCtrl)->GetValue();
1058 #ifdef __WXMSW__
1059  filename.Replace(wxT("\\"), wxT("/"), true);
1060 #endif
1061  cfg->Write(wxT("OutputFilename"), filename);
1065 
1068  cfg->Write(wxT("/output/ldr_format"), MY_G_CHOICE_VAL("pref_ldr_output_file_format"));
1070  // cfg->Write(wxT("/output/hdr_format"), MY_G_CHOICE_VAL("pref_hdr_output_file_format"));
1071  cfg->Write(wxT("/output/tiff_compression"), MY_G_CHOICE_VAL("pref_tiff_compression"));
1072  cfg->Write(wxT("/output/jpeg_quality"), MY_G_SPIN_VAL("pref_jpeg_quality"));
1073 
1074  cfg->Write(wxT("/default_blender"), static_cast<long>(GetSelectedValue(XRCCTRL(*this, "pref_default_blender", wxChoice))));
1075  if (XRCCTRL(*this, "pref_internal_blender_seam", wxChoice)->GetSelection() == 1)
1076  {
1077  cfg->Write(wxT("/VerdandiDefaultArgs"), wxT("--seam=blend"));
1078  }
1079  else
1080  {
1081  cfg->Write(wxT("/VerdandiDefaultArgs"), wxEmptyString);
1082  };
1083 
1086  cfg->Write(wxT("/Processor/gui"), MY_G_CHOICE_VAL("pref_processor_gui"));
1087  cfg->Write(wxT("/Processor/start"), MY_G_BOOL_VAL("pref_processor_start"));
1088  cfg->Write(wxT("/Processor/overwrite"), MY_G_BOOL_VAL("pref_processor_overwrite"));
1089  cfg->Write(wxT("/Processor/verbose"), MY_G_BOOL_VAL("pref_processor_verbose"));
1090 
1091  cfg->Write(wxT("/output/useExiftool"), MY_G_BOOL_VAL("pref_exiftool_metadata"));
1092  cfg->Write(wxT("/output/CopyArgfile"), MY_G_STR_VAL("pref_exiftool_argfile"));
1093  cfg->Write(wxT("/output/FinalArgfile"), MY_G_STR_VAL("pref_exiftool_argfile2"));
1094  cfg->Write(wxT("/output/writeGPano"), MY_G_BOOL_VAL("pref_exiftool_gpano"));
1095  cfg->Write(wxT("/output/NumberOfThreads"), MY_G_SPIN_VAL("prefs_output_NumberOfThreads"));
1098  cfg->Write(wxT("/Nona/Interpolator"), MY_G_CHOICE_VAL("prefs_nona_interpolator"));
1099  cfg->Write(wxT("/Nona/CroppedImages"), MY_G_BOOL_VAL("prefs_nona_createCroppedImages"));
1100  cfg->Write(wxT("/Nona/UseGPU"), MY_G_BOOL_VAL("prefs_nona_useGpu"));
1101 
1104  cfg->Write(wxT("/Enblend/Custom"), MY_G_BOOL_VAL("prefs_enblend_Custom"));
1105  cfg->Write(wxT("/Enblend/Exe"), MY_G_STR_VAL("prefs_enblend_EnblendExe"));
1106  cfg->Write(wxT("/Enblend/Args"), MY_G_STR_VAL("prefs_enblend_EnblendArgs"));
1107 
1108  cfg->Write(wxT("/Enfuse/Custom"), MY_G_BOOL_VAL("prefs_enblend_enfuseCustom"));
1109  cfg->Write(wxT("/Enfuse/Exe"), MY_G_STR_VAL("prefs_enblend_EnfuseExe"));
1110  cfg->Write(wxT("/Enfuse/Args"), MY_G_STR_VAL("prefs_enblend_EnfuseArgs"));
1111 
1112  // Celeste
1113  t = MY_G_STR_VAL("prefs_celeste_threshold");
1115  hugin_utils::stringToDouble(std::string(t.mb_str(wxConvLocal)), td);
1116  cfg->Write(wxT("/Celeste/Threshold"), td);
1117  cfg->Write(wxT("/Celeste/Filter"), MY_G_CHOICE_VAL("prefs_celeste_filter"));
1118  //photometric optimizer
1119  cfg->Write(wxT("/OptimizePhotometric/nRandomPointsPerImage"), MY_G_SPIN_VAL("prefs_photo_optimizer_nr_points"));
1120  cfg->Write(wxT("/ShowSaveMessage"), MY_G_BOOL_VAL("prefs_warning_save"));
1121  cfg->Write(wxT("/ShowExposureWarning"), MY_G_BOOL_VAL("prefs_warning_exposure"));
1122  cfg->Write(wxT("/ShowFisheyeCropHint"), MY_G_BOOL_VAL("prefs_warning_fisheye_crop"));
1123  cfg->Write(wxT("/EditCPAfterAction"), MY_G_CHOICE_VAL("pref_editcp_action"));
1124 
1125  cfg->Flush();
1126  UpdateDisplayData(0);
1127 }
1128 
1129 void PreferencesDialog::OnCPDetectorAdd(wxCommandEvent& e)
1130 {
1131  CPDetectorDialog cpdetector_dlg(this);
1132  if(cpdetector_dlg.ShowModal()==wxOK)
1133  {
1138  };
1139 };
1140 
1142 {
1143  CPDetectorDialog autopano_dlg(this);
1144  int selection=m_CPDetectorList->GetSelection();
1145  if (selection == wxNOT_FOUND)
1146  {
1147  wxMessageBox(_("Please select an entry first"),_("Select Entry"),wxOK |
1148  wxICON_EXCLAMATION,this);
1149  }
1150  else
1151  {
1152  autopano_dlg.UpdateFields(&cpdetector_config_edit, selection);
1153  if(autopano_dlg.ShowModal()==wxOK)
1154  {
1155  autopano_dlg.UpdateSettings(&cpdetector_config_edit, selection);
1157  m_CPDetectorList->SetSelection(selection);
1158  };
1159  }
1160 };
1161 
1163 {
1164  unsigned int selection=m_CPDetectorList->GetSelection();
1165  if(m_CPDetectorList->GetCount()==1)
1166  {
1167  wxMessageBox(_("You can't delete the last setting.\nAt least one setting is required."),_("Warning"),wxOK | wxICON_EXCLAMATION,this);
1168  }
1169  else
1170  {
1171  if(wxMessageBox(wxString::Format(_("Do you really want to remove control point detector setting \"%s\"?"),cpdetector_config_edit.settings[selection].GetCPDetectorDesc().c_str())
1172  ,_("Delete control point detector setting"),wxYES_NO | wxICON_QUESTION,this)==wxYES)
1173  {
1175  {
1177  }
1178  cpdetector_config_edit.settings.RemoveAt(selection);
1180  if(selection>=m_CPDetectorList->GetCount())
1181  {
1182  selection=m_CPDetectorList->GetCount()-1;
1183  }
1184  m_CPDetectorList->SetSelection(selection);
1185  };
1186  };
1187 };
1188 
1190 {
1191  unsigned int selection=m_CPDetectorList->GetSelection();
1192  if(selection>0)
1193  {
1194  cpdetector_config_edit.Swap(selection-1);
1196  m_CPDetectorList->SetSelection(selection-1);
1197  };
1198 };
1199 
1201 {
1202  unsigned int selection=m_CPDetectorList->GetSelection();
1203  if(selection<m_CPDetectorList->GetCount()-1)
1204  {
1205  cpdetector_config_edit.Swap(selection);
1207  m_CPDetectorList->SetSelection(selection+1);
1208  };
1209 };
1210 
1212 {
1213  unsigned int selection=m_CPDetectorList->GetSelection();
1215  {
1218  m_CPDetectorList->SetSelection(selection);
1219  };
1220 };
1221 
1223 {
1224  wxFileDialog dlg(this,_("Load control point detector settings"),
1225  wxConfigBase::Get()->Read(wxT("/actualPath"),wxT("")), wxEmptyString,
1226  _("Control point detector settings (*.setting)|*.setting"),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1227  if (dlg.ShowModal() == wxID_OK)
1228  {
1229  wxConfig::Get()->Write(wxT("/actualPath"), dlg.GetDirectory()); // remember for later
1230  wxString fn = dlg.GetPath();
1233  UpdateDisplayData(5);
1234  };
1235 };
1236 
1238 {
1239  wxFileDialog dlg(this,_("Save control point detector settings"),
1240  wxConfigBase::Get()->Read(wxT("/actualPath"),wxT("")), wxEmptyString,
1241  _("Control point detector settings (*.setting)|*.setting"),wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1242  if (dlg.ShowModal() == wxID_OK)
1243  {
1244  wxConfig::Get()->Write(wxT("/actualPath"), dlg.GetDirectory()); // remember for later
1245  wxString fn = dlg.GetPath();
1246 #ifndef __WXMSW__
1247  //append extension if not given
1248  //not necessary on Windows, the wxFileDialog appends it automatic
1249  if(fn.Right(8)!=wxT(".setting"))
1250  {
1251  fn.Append(wxT(".setting"));
1252  };
1253 #endif
1255  };
1256 };
1257 
1259 {
1261 };
1262 
1264 {
1265  int i=MY_G_CHOICE_VAL("pref_ldr_output_file_format");
1266  XRCCTRL(*this,"pref_tiff_compression_label",wxStaticText)->Show(i==0);
1267  XRCCTRL(*this,"pref_tiff_compression",wxChoice)->Show(i==0);
1268  XRCCTRL(*this,"pref_jpeg_quality_label",wxStaticText)->Show(i==1);
1269  XRCCTRL(*this,"pref_jpeg_quality",wxSpinCtrl)->Show(i==1);
1270  XRCCTRL(*this,"pref_tiff_compression",wxChoice)->GetParent()->Layout();
1271 };
1272 
1274 {
1276 };
1277 
1279 {
1280  int i=MY_G_CHOICE_VAL("pref_processor_gui");
1281  XRCCTRL(*this,"pref_processor_start",wxCheckBox)->Enable(i==0);
1282  XRCCTRL(*this,"pref_processor_verbose",wxCheckBox)->Enable(i==0);
1283  switch(i)
1284  {
1285  case 0:
1286  //PTBatcherGUI
1287  {
1288  wxConfigBase* config=wxConfigBase::Get();
1289  XRCCTRL(*this,"pref_processor_start",wxCheckBox)->SetValue(config->Read(wxT("/Processor/start"), HUGIN_PROCESSOR_START) == 1);
1290  XRCCTRL(*this,"pref_processor_verbose",wxCheckBox)->SetValue(config->Read(wxT("/Processor/verbose"), HUGIN_PROCESSOR_VERBOSE) == 1);
1291  }
1292  break;
1293  case 1:
1294  //Hugin_stitch_project
1295  XRCCTRL(*this,"pref_processor_start",wxCheckBox)->SetValue(true);
1296  XRCCTRL(*this,"pref_processor_verbose",wxCheckBox)->SetValue(true);
1297  break;
1298  };
1299 };
1300 
1301 void PreferencesDialog::OnBlenderChanged(wxCommandEvent & e)
1302 {
1304 };
1305 
1307 {
1308  const int blender = MY_G_CHOICE_VAL("pref_default_blender");
1309  XRCCTRL(*this, "pref_internal_blender_seam_label", wxStaticText)->Show(blender == 1);
1310  wxChoice* seamChoice = XRCCTRL(*this, "pref_internal_blender_seam", wxChoice);
1311  seamChoice->Show(blender == 1);
1312  seamChoice->Enable(blender == 1);
1313 };
1314 
1316 {
1317  XRCCTRL(*this, "prefs_project_filename_preview", wxStaticText)->SetLabel(
1318  getDefaultProjectName(MainFrame::Get()->getPanorama(), XRCCTRL(*this, "prefs_project_filename", wxTextCtrl)->GetValue())
1319  );
1320 };
1321 
1323 {
1324  XRCCTRL(*this, "prefs_output_filename_preview", wxStaticText)->SetLabel(
1325  getDefaultOutputName(MainFrame::Get()->getProjectName(), MainFrame::Get()->getPanorama(), XRCCTRL(*this, "prefs_output_filename", wxTextCtrl)->GetValue())
1326  );
1327 };
1328 
1330 {
1331  //enable/disable button related to user defined output options of assistant
1332  XRCCTRL(*this, "pref_ass_change_output", wxButton)->Enable(XRCCTRL(*this, "pref_ass_output", wxCheckBox)->IsChecked());
1333 }
1334 
1336 {
1337  // show dialog to change user defined output options of assistant
1338  EditOutputIniDialog dlg(this);
1339  dlg.ShowModal();
1340 }
void DisplayHelp(wxString section=wxEmptyString)
call help browser with given file
Definition: MainFrame.cpp:1483
#define DEBUG_INFO(msg)
Definition: utils.h:69
int floori(double x)
Definition: hugin_math.h:65
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
int roundi(T x)
Definition: hugin_math.h:73
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 DEBUG_TRACE(msg)
Definition: utils.h:67
#define HUGIN_JPEG_QUALITY
#define HUGIN_FT_CURV_THRESHOLD
#define HUGIN_LANGUAGE
#define HUGIN_FT_ROTATION_STEPS
#define HUGIN_EXIFTOOL_CREATE_GPANO
unsigned int GetCount()
return counts of cp detector settings
some helper classes for graphes
void OnUpdateProjectFilename(wxCommandEvent &e)
event handler to update preview for project filename
void OnCPDetectorDelete(wxCommandEvent &e)
wxString doubleTowxString(double d, int digits)
Definition: wxPlatform.cpp:31
#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)
static huginApp * Get()
hack.. kind of a pseudo singleton...
Definition: huginApp.cpp:645
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 DEBUG_WARN(msg)
Definition: utils.h:74
#define HUGIN_IMGCACHE_UPPERBOUND
void OnExifTool(wxCommandEvent &e)
#define HUGIN_FT_TEMPLATE_SIZE
size_t GetSelectedValue(wxControlWithItems *list)
Returns the client value of the selected item from list.
Definition: LensTools.cpp:102
class, which stores all settings of one cp detector
#define HUGIN_SMART_UNDO
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...
Definition: MainFrame.cpp:2153
void OnCPDetectorEdit(wxCommandEvent &e)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
Definition: LensCalApp.cpp:210
#define HUGIN_CELESTE_FILTER
#define HUGIN_CELESTE_THRESHOLD
#define HUGIN_NONA_INTERPOLATOR
#define HUGIN_TIFF_COMPRESSION
void OnRestoreDefaults(wxCommandEvent &e)
#define MY_G_STR_VAL(id)
void OnChangeUserDefinedOutputOptions(wxCommandEvent &e)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.
Definition: LensCalApp.cpp:156
#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.
Definition: utils.h:114
#define HUGIN_DEFAULT_PROJECT_NAME
#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)
void SelectListValue(wxControlWithItems *list, size_t newValue)
Selects the given value (stored in the client data) in the given list item.
Definition: LensTools.cpp:89
#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 DEBUG_DEBUG(msg)
Definition: utils.h:68
#define HUGIN_ASS_PANO_DOWNSIZE_FACTOR
void OnBlenderChanged(wxCommandEvent &e)
event handler if blender was changed
functions for interaction with the hugin configuration file
platform/compiler specific stuff.
void OnFileFormatChanged(wxCommandEvent &e)
event handler if default file format was changed
#define HUGIN_ASS_AUTO_CPCLEAN
#define HUGIN_ENFUSE_EXE
#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
static T min(T x, T y)
Definition: svm.cpp:62
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)
void FillBlenderList(wxControlWithItems *list)
Fills a wxControlWithItem with all possible blender options, the client data contains the associated ...
Definition: LensTools.cpp:81
#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