When pgAdmin fires the FileMenu while using the Backup Form (the second time), the...
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Tue, 29 Apr 2008 09:07:00 +0000 (09:07 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Tue, 29 Apr 2008 09:07:00 +0000 (09:07 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7244 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/frm/frmBackup.cpp
pgadmin/frm/frmBackupGlobals.cpp
pgadmin/frm/frmBackupServer.cpp
pgadmin/frm/frmRestore.cpp

index 47804c891c7baa75742ee3da74fe680934c75c13..d2bf589c0f6793530afd55daa690b6ee11cd1a66 100644 (file)
@@ -112,7 +112,7 @@ wxString frmBackup::GetHelpPage() const
 
 void frmBackup::OnSelectFilename(wxCommandEvent &ev)
 {
-    wxString title, prompt;
+    wxString title, prompt, FilenameOnly;
 
     if (rbxFormat->GetSelection() == 2) // plain
     {
@@ -125,8 +125,8 @@ void frmBackup::OnSelectFilename(wxCommandEvent &ev)
         prompt = _("Backup files (*.backup)|*.backup|All files (*.*)|*.*");
     }
 
-    
-    wxFileDialog file(this, title, ::wxPathOnly(txtFilename->GetValue()), txtFilename->GetValue(), prompt, wxFD_SAVE);
+    wxFileName::SplitPath(txtFilename->GetValue(), NULL, NULL, &FilenameOnly, NULL);
+    wxFileDialog file(this, title, ::wxPathOnly(txtFilename->GetValue()), FilenameOnly, prompt, wxFD_SAVE);
 
     if (file.ShowModal() == wxID_OK)
     {
index a5660ca8a862300d4b9f45799b0faa82b535c77d..77041539a6f20d174be62135291be1734230a9d6 100644 (file)
@@ -94,12 +94,13 @@ wxString frmBackupGlobals::GetHelpPage() const
 \r
 void frmBackupGlobals::OnSelectFilename(wxCommandEvent &ev)\r
 {\r
-    wxString title, prompt;\r
+    wxString title, prompt, FilenameOnly;\r
 \r
     title  = _("Select output file");\r
     prompt = _("Query files (*.sql)|*.sql|All files (*.*)|*.*");\r
-    \r
-    wxFileDialog file(this, title, ::wxPathOnly(txtFilename->GetValue()), txtFilename->GetValue(), prompt, wxFD_SAVE);\r
+\r
+    wxFileName::SplitPath(txtFilename->GetValue(), NULL, NULL, &FilenameOnly, NULL);\r
+    wxFileDialog file(this, title, ::wxPathOnly(txtFilename->GetValue()), FilenameOnly, prompt, wxFD_SAVE);\r
 \r
     if (file.ShowModal() == wxID_OK)\r
     {\r
index 344a594ce45380ddc6b51d6ba11f9e458d38c5c9..9f8565f7963cca3977086ca7803578b9804e4268 100644 (file)
@@ -86,13 +86,14 @@ wxString frmBackupServer::GetHelpPage() const
 \r
 void frmBackupServer::OnSelectFilename(wxCommandEvent &ev)\r
 {\r
-    wxString title, prompt;\r
+    wxString title, prompt, FilenameOnly;\r
 \r
     title  = _("Select output file");\r
     prompt = _("Query files (*.sql)|*.sql|All files (*.*)|*.*");\r
     \r
-    wxFileDialog file(this, title, ::wxPathOnly(txtFilename->GetValue()), txtFilename->GetValue(), prompt, wxFD_SAVE);\r
-\r
+    wxFileName::SplitPath(txtFilename->GetValue(), NULL, NULL, &FilenameOnly, NULL);\r
+    wxFileDialog file(this, title, ::wxPathOnly(txtFilename->GetValue()), FilenameOnly, prompt, wxFD_SAVE);\r
+    \r
     if (file.ShowModal() == wxID_OK)\r
     {\r
         txtFilename->SetValue(file.GetPath());\r
index 0fc9938e88edc52339871ef212054f5058bdecde..6425fc05fc21c7d1dd02953dc40af696a4cf6d4d 100644 (file)
@@ -132,7 +132,11 @@ wxString frmRestore::GetHelpPage() const
 
 void frmRestore::OnSelectFilename(wxCommandEvent &ev)
 {
-    wxFileDialog file(this, _("Select backup filename"), ::wxPathOnly(txtFilename->GetValue()), txtFilename->GetValue(), 
+    
+    wxString FilenameOnly;    
+    wxFileName::SplitPath(txtFilename->GetValue(), NULL, NULL, &FilenameOnly, NULL);
+    
+    wxFileDialog file(this, _("Select backup filename"), ::wxPathOnly(txtFilename->GetValue()), FilenameOnly, 
         _("Backup files (*.backup)|*.backup|All files (*.*)|*.*"));
 
     if (file.ShowModal() == wxID_OK)