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