Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/hugin1/hugin/GLPreviewFrame.cpp [9208b7] .. [8c577b] Maximize Restore

  Switch to side-by-side view

--- a/src/hugin1/hugin/GLPreviewFrame.cpp
+++ b/src/hugin1/hugin/GLPreviewFrame.cpp
@@ -42,7 +42,6 @@
 #include <GL/glew.h>
 
 #include "panoinc_WX.h"
-
 #include "panoinc.h"
 
 #include "base_wx/platform.h"
@@ -98,7 +97,8 @@
     ID_SHOW_ALL = wxID_HIGHEST+1711,
     ID_SHOW_NONE = wxID_HIGHEST+1712,
     ID_UNDO = wxID_HIGHEST+1713,
-    ID_REDO = wxID_HIGHEST+1714
+    ID_REDO = wxID_HIGHEST+1714,
+    ID_HIDE_HINTS = wxID_HIGHEST+1715
 };
 
 /** enum, which contains all different toolbar modes */
@@ -131,7 +131,7 @@
     EVT_BUTTON(XRCID("preview_autocrop_tool"), GLPreviewFrame::OnAutocrop)
     EVT_NOTEBOOK_PAGE_CHANGED(XRCID("mode_toolbar_notebook"), GLPreviewFrame::OnSelectMode)
     EVT_NOTEBOOK_PAGE_CHANGING(XRCID("mode_toolbar_notebook"), GLPreviewFrame::OnToolModeChanging)
-   
+    EVT_BUTTON(ID_HIDE_HINTS, GLPreviewFrame::OnHideProjectionHints)
     EVT_BUTTON(XRCID("exposure_default_button"), GLPreviewFrame::OnDefaultExposure)
     EVT_SPIN_DOWN(XRCID("exposure_spin"), GLPreviewFrame::OnDecreaseExposure)
     EVT_SPIN_UP(XRCID("exposure_spin"), GLPreviewFrame::OnIncreaseExposure)
@@ -224,7 +224,7 @@
     button->Refresh();
 };
 
-
+#define PF_STYLE (wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
 GLwxAuiFloatingFrame* GLwxAuiManager::CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p)
 {
     DEBUG_DEBUG("CREATING FLOATING FRAME");
@@ -266,7 +266,6 @@
 }
 
 
-#define PF_STYLE (wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
 #include <iostream>
 GLPreviewFrame::GLPreviewFrame(wxFrame * frame, PT::Panorama &pano)
     : wxFrame(frame,-1, _("Fast Panorama preview"), wxDefaultPosition, wxDefaultSize,
@@ -370,6 +369,8 @@
 
 #if wxCHECK_VERSION(2, 9, 1)
     m_infoBar = new wxInfoBar(this);
+    m_infoBar->AddButton(ID_HIDE_HINTS,_("Hide"));
+    m_infoBar->Connect(ID_HIDE_HINTS,wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(GLPreviewFrame::OnHideProjectionHints),NULL,this);
     m_topsizer->Add(m_infoBar, 0, wxEXPAND);
 #endif
 
@@ -611,9 +612,9 @@
 
     // set the minimize icon
 #ifdef __WXMSW__
-    wxIcon myIcon(huginApp::Get()->GetXRCPath() + wxT("data/icon.ico"),wxBITMAP_TYPE_ICO);
+    wxIcon myIcon(huginApp::Get()->GetXRCPath() + wxT("data/hugin.ico"),wxBITMAP_TYPE_ICO);
 #else
-    wxIcon myIcon(huginApp::Get()->GetXRCPath() + wxT("data/icon.png"),wxBITMAP_TYPE_PNG);
+    wxIcon myIcon(huginApp::Get()->GetXRCPath() + wxT("data/hugin.png"),wxBITMAP_TYPE_PNG);
 #endif
     SetIcon(myIcon);
 
@@ -629,6 +630,7 @@
     if (config->Read(wxT("/GLPreviewFrame/isShown"), 0l) != 0) {
         Show();
     }
+    m_showProjectionHints = config->Read(wxT("/GLPreviewWindow/ShowProjectionHints"), HUGIN_SHOW_PROJECTION_HINTS) == 1;
     wxAcceleratorEntry entries[3];
     entries[0].Set(wxACCEL_NORMAL,WXK_F11,ID_FULL_SCREEN);
     entries[1].Set(wxACCEL_CTRL,(int)'Z',ID_UNDO);
@@ -892,7 +894,10 @@
     m_ROITopTxt->SetValue(wxString::Format(wxT("%d"), opts.getROI().top() ));
     m_ROIBottomTxt->SetValue(wxString::Format(wxT("%d"), opts.getROI().bottom() ));
     
-    ShowProjectionWarnings();
+    if(m_showProjectionHints)
+    {
+        ShowProjectionWarnings();
+    };
 }
 
 void GLPreviewFrame::panoramaImagesChanged(Panorama &pano, const UIntSet &changed)
@@ -2224,10 +2229,6 @@
 #endif
     } else {
 #if wxCHECK_VERSION(2, 9, 1)
-        /** @todo If the projection information bar was closed manually, don't show any more messages there.
-         * It should probably be stored as a configuration setting so it persits
-         * until "Load defaults" is selected on the preferences window.
-         */
         m_infoBar->ShowMessage(message, wxICON_INFORMATION);
 #else
         if (m_projectionStatusPushed) {
@@ -2242,3 +2243,31 @@
 #endif
     }
 };
+
+void GLPreviewFrame::SetShowProjectionHints(bool new_value)
+{
+    m_showProjectionHints=new_value;
+#if wxCHECK_VERSION(2,9,1)
+    if(!m_showProjectionHints)
+    {
+        m_infoBar->Dismiss();
+    };
+#endif
+};
+
+void GLPreviewFrame::OnHideProjectionHints(wxCommandEvent &e)
+{
+    wxMessageBox(_("You have hidden the infobar, which shows hints about selection of projection.\nIf you want to see the bar again, activate the bar in the preferences again."),
+#ifdef __WXMSW__
+        _("Hugin"),
+#else
+        wxT(""),
+#endif
+        wxOK | wxICON_INFORMATION, this);
+
+    wxConfigBase* cfg=wxConfigBase::Get();
+    cfg->Write(wxT("/GLPreviewWindow/ShowProjectionHints"), false);
+    m_showProjectionHints=false;
+    cfg->Flush();
+    e.Skip();
+};