Hi,
When pgAdmin fires the FileMenu while using the Backup Form (the second
time), the wxFileDialog is called with the filepath + filename instead of
just the filename that it expects as its third parameter. This throws up a
warning. The same thing happens with the Restore Form as well.
One such Debug report is given below.
Attached is a patch that passes just the FileName to wxFileDialog in both
the forms.
Regards,
*Robins Tharakan*
Debug report:
ASSERT INFO:
../src/common/filename.cpp(476): assert "volDummy.empty() &&
pathDummy.empty()" failed in Assign(): the file name shouldn't contain the
path
BACKTRACE:
[1] wxFileDialog::wxFileDialog(wxWindow*, wxString const&, wxString const&,
wxString const&, wxString const&, long, wxPoint const&, wxSize const&,
wxString const&)
[2] frmRestore::OnSelectFilename(wxCommandEvent&)
/projects/pgadmin/40_line_numbers_in_sql_view/7/pgadmin/./frm/frmRestore.cpp:136
[3] wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&)
[4] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[5] wxEvtHandler::ProcessEvent(wxEvent&)
[6] wxWindowBase::TryParent(wxEvent&)
[7] wxEvtHandler::ProcessEvent(wxEvent&)
[8] wxWindowBase::TryParent(wxEvent&)
[9] wxEvtHandler::ProcessEvent(wxEvent&)
[10] wxWindowBase::TryParent(wxEvent&)
[11] wxEvtHandler::ProcessEvent(wxEvent&)
[12] g_closure_invoke()
[13] g_signal_emit_valist()
[14] g_signal_emit()
[15] g_closure_invoke()
[16] g_signal_emit_valist()
[17] g_signal_emit()
[18] g_closure_invoke()
[19] g_signal_emit_valist()
[20] g_signal_emit()
[21] gtk_propagate_event()
[22] gtk_main_do_event()
[23] g_main_context_dispatch()
[24] g_main_loop_run()
[25] gtk_main()
Index: pgadmin/frm/frmBackup.cpp
===================================================================
--- pgadmin/frm/frmBackup.cpp (revision 7237)
+++ pgadmin/frm/frmBackup.cpp (working copy)
@@ -112,7 +112,7 @@
void frmBackup::OnSelectFilename(wxCommandEvent &ev)
{
- wxString title, prompt;
+ wxString title, prompt, FilenameOnly;
if (rbxFormat->GetSelection() == 2) // plain
{
@@ -125,8 +125,8 @@
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: pgadmin/frm/frmRestore.cpp
===================================================================
--- pgadmin/frm/frmRestore.cpp (revision 7237)
+++ pgadmin/frm/frmRestore.cpp (working copy)
@@ -132,7 +132,11 @@
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)
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers