]> git.saurik.com Git - wxWidgets.git/commitdiff
[wxGTK] wxFileDialog: Use native overwrite confirmation if possible
authorMart Raudsepp <leio@gentoo.org>
Mon, 1 Aug 2005 16:39:57 +0000 (16:39 +0000)
committerMart Raudsepp <leio@gentoo.org>
Mon, 1 Aug 2005 16:39:57 +0000 (16:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/filedlg.cpp
src/gtk1/filedlg.cpp

index 1293d32fd3e1ff115736fad315f41d0ce1a27894..420c2e32c07999a76dcda8b20f2f3f81d7b83d5a 100644 (file)
@@ -50,6 +50,10 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
     int style = dialog->GetStyle();
     gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
 
+    // gtk version numbers must be identical with the one in ctor (that calls set_do_overwrite_confirmation)
+#if GTK_CHECK_VERSION(2,7,3)
+    if(gtk_check_version(2,7,3) != NULL)
+#endif
     if ((style & wxSAVE) && (style & wxOVERWRITE_PROMPT))
     {
         if ( g_file_test(filename, G_FILE_TEST_EXISTS) )
@@ -200,6 +204,11 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
 
             gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget),
                 wxConvFileName->cWX2MB(defaultFileName));
+
+#if GTK_CHECK_VERSION(2,7,3)
+            if (!gtk_check_version(2,7,3))
+                gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(m_widget), TRUE);
+#endif
         }
         else
         {
index 1293d32fd3e1ff115736fad315f41d0ce1a27894..420c2e32c07999a76dcda8b20f2f3f81d7b83d5a 100644 (file)
@@ -50,6 +50,10 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
     int style = dialog->GetStyle();
     gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
 
+    // gtk version numbers must be identical with the one in ctor (that calls set_do_overwrite_confirmation)
+#if GTK_CHECK_VERSION(2,7,3)
+    if(gtk_check_version(2,7,3) != NULL)
+#endif
     if ((style & wxSAVE) && (style & wxOVERWRITE_PROMPT))
     {
         if ( g_file_test(filename, G_FILE_TEST_EXISTS) )
@@ -200,6 +204,11 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
 
             gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget),
                 wxConvFileName->cWX2MB(defaultFileName));
+
+#if GTK_CHECK_VERSION(2,7,3)
+            if (!gtk_check_version(2,7,3))
+                gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(m_widget), TRUE);
+#endif
         }
         else
         {