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