The following patch fixes the bug.
--- codeblocks-1.0svn.orig/src/sdk/resources/confirm_replace.xrc 2007-09-28 13:55:10.000000000 +0000
+++ codeblocks-1.0svn.work/src/sdk/resources/confirm_replace.xrc 2007-11-06 13:28:21.000000000 +0000
@@ -12,6 +12,7 @@
</object>
<flag>wxALL|wxGROW</flag>
<border>8</border>
+ <option>1</option>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
--- codeblocks-1.0svn.orig/src/sdk/resources/confirm_replace_multiple.xrc 2007-09-28 13:55:10.000000000 +0000
+++ codeblocks-1.0svn.work/src/sdk/resources/confirm_replace_multiple.xrc 2007-11-06 13:31:14.000000000 +0000
@@ -11,6 +11,7 @@
</object>
<flag>wxALL|wxGROW</flag>
<border>8</border>
+ <option>1</option>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
I added the line "<option>1</option>" to "confirm_replace_multiple.xrc" also, eve if it is not used by the fileupdate-Dlg, to make both behave identical.
If you confirm the patch, I can post it at berlios.
On windows the problem with extremly long file-name (-paths) is different, because the line is not wrapped there, and a part of it get cut by the Dialog-Border.
The following patch fixes the bug.
Are you sure? The "reload file?" box uses no xrc at all.
Your patch seems to address something different (search/replace). Apparently those dialogs are too small on our system too?
Yes, I'm sure !
The "cbMessageBox" is used when a file is deleted or moved :
editormanager.cpp (line 988s to 992)
msg.Printf(_("%s has been deleted, or is no longer available.\n"
"Do you wish to keep the file open?\n"
"Yes to keep the file, No to close it."), ed->GetFilename().c_str());
if (cbMessageBox(msg, _("File changed!"), wxICON_QUESTION | wxYES_NO) == wxID_YES)
ed->SetModified(true);
If a file gets modified outside the editor, this code is used :
editormanager.cpp (lines 1036 to 1038)
msg.Printf(_("File %s is modified outside the IDE...\nDo you want to reload it (you will lose any unsaved work)?"),
ed->GetFilename().c_str());
ConfirmReplaceDlg dlg(Manager::Get()->GetAppWindow(), false, msg);
The bug (I think it is a bug) only happens for me if I use very long file-/pathnames. I tested it.
The code with the "cbMessageBox" works for me, even with really deep nested paths.
Did anybody really read what I post?
We all did but you are missing the point here.
We talk about the code that informs about files being modified outside the C::B IDE. This has *nothing* (I repeat: *nothing*) to do with any search-and-replace operation. So we will *not* use code/dialogs/whatever (even if it's a XRC file) that is developed for the purpose of search-and-replace within the context we are talking about. Period.
With regards, Morten.
Sorry, but that's not right.
Open this (http://svn.berlios.de/viewcvs/codeblocks/trunk/src/sdk/editormanager.cpp?view=markup&rev=4600) link from the C::B-svn.
Search for the function "CheckForExternallyModifiedFiles()".
In the function you will find this code:
//File content changed?
if (last.IsLaterThan(ed->GetLastModificationTime()))
b_modified = true;
if (b_modified)
{
// modified; ask to reload
int ret = -1;
if (!reloadAll)
{
wxString msg;
msg.Printf(_("File %s is modified outside the IDE...\nDo you want to reload it (you will lose any unsaved work)?"),
ed->GetFilename().c_str());
ConfirmReplaceDlg dlg(Manager::Get()->GetAppWindow(), false, msg);
dlg.SetTitle(_("Reload file?"));
PlaceWindow(&dlg);
ret = dlg.ShowModal();
reloadAll = ret == crAll;
}
if (reloadAll || ret == crYes)
{
if (!ed->Reload())
failedFiles.Add(ed->GetFilename());
}
else if (ret == crCancel)
break;
else if (ret == crNo)
ed->Touch();
}
It includes this line:
ConfirmReplaceDlg dlg(Manager::Get()->GetAppWindow(), false, msg);
That's the fact, nothing else.
Edit:
It first came up in svn299 as you can see in the diff (http://svn.berlios.de/viewcvs/codeblocks/trunk/src/sdk/editormanager.cpp?rev=299&r1=289&r2=299).