]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/filedlgg.cpp
Don't needlessly indirect through NSNotificationCenter.
[wxWidgets.git] / src / generic / filedlgg.cpp
index c0e8a6ba1839be510588ac6100ee32590d366e45..2729d5db5d4739ce523f5724f438d682cb1e98a5 100644 (file)
@@ -996,6 +996,8 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
 {
     m_bypassGenericImpl = bypassGenericImpl;
 
 {
     m_bypassGenericImpl = bypassGenericImpl;
 
+    parent = GetParentForModalDialog(parent);
+
     if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile,
                                   wildCard, style, pos, sz, name))
     {
     if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile,
                                   wildCard, style, pos, sz, name))
     {
@@ -1006,7 +1008,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
         return true;
 
     if (!wxDialog::Create( parent, wxID_ANY, message, pos, sz,
         return true;
 
     if (!wxDialog::Create( parent, wxID_ANY, message, pos, sz,
-                           wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, name
+                           wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | style, name
                            ))
     {
         return false;
                            ))
     {
         return false;
@@ -1014,6 +1016,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
 
     ignoreChanges = true;
 
 
     ignoreChanges = true;
 
+#if wxUSE_CONFIG
     if (wxConfig::Get(false))
     {
         wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ViewStyle"),
     if (wxConfig::Get(false))
     {
         wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ViewStyle"),
@@ -1021,6 +1024,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
         wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ShowHidden"),
                               &ms_lastShowHidden);
     }
         wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ShowHidden"),
                               &ms_lastShowHidden);
     }
+#endif
 
     if ((m_dir.empty()) || (m_dir == wxT(".")))
     {
 
     if ((m_dir.empty()) || (m_dir == wxT(".")))
     {
@@ -1188,6 +1192,7 @@ wxGenericFileDialog::~wxGenericFileDialog()
 
     if (!m_bypassGenericImpl)
     {
 
     if (!m_bypassGenericImpl)
     {
+#if wxUSE_CONFIG
         if (wxConfig::Get(false))
         {
             wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ViewStyle"),
         if (wxConfig::Get(false))
         {
             wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ViewStyle"),
@@ -1195,6 +1200,7 @@ wxGenericFileDialog::~wxGenericFileDialog()
             wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ShowHidden"),
                                    ms_lastShowHidden);
         }
             wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ShowHidden"),
                                    ms_lastShowHidden);
         }
+#endif
 
         const int count = m_choice->GetCount();
         for ( int i = 0; i < count; i++ )
 
         const int count = m_choice->GetCount();
         for ( int i = 0; i < count; i++ )
@@ -1471,6 +1477,8 @@ void wxGenericFileDialog::HandleAction( const wxString &fn )
     {
         wxMessageBox(_("Please choose an existing file."), _("Error"),
                      wxOK | wxICON_ERROR );
     {
         wxMessageBox(_("Please choose an existing file."), _("Error"),
                      wxOK | wxICON_ERROR );
+                     
+        return;
     }
 
     SetPath( filename );
     }
 
     SetPath( filename );
@@ -1631,10 +1639,10 @@ void wxGenericFileDialog::UpdateControls()
 #endif // defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__)
 }
 
 #endif // defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__)
 }
 
-#ifdef wxUSE_GENERIC_FILEDIALOG
+#ifdef wxHAS_GENERIC_FILEDIALOG
 
 IMPLEMENT_DYNAMIC_CLASS(wxFileDialog, wxGenericFileDialog)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxFileDialog, wxGenericFileDialog)
 
-#endif // wxUSE_GENERIC_FILEDIALOG
+#endif // wxHAS_GENERIC_FILEDIALOG
 
 #endif // wxUSE_FILEDLG
 
 #endif // wxUSE_FILEDLG