User forums > General (but related to Code::Blocks)
"file updated" dialogue bug
Jenna:
--- Quote from: MortenMacFly on November 07, 2007, 11:21:16 am ---
--- Quote from: jens on November 07, 2007, 11:18:38 am ---I still think it is a good solution as long as "ConfirmReplaceDlg" is used.
--- End quote ---
I'm sorry, but within the content we are talking about this is not an option.
Edit: For clarification: Hijacking foreign dialogs and mis-using them within a foreign content is no good.
--- End quote ---
Did anybody really read what I post?
I try to make it a little bit clearer.
There is existing code in editormanager.cpp, not written by me.
I don't know who the author is and I think this doesn't matter.
The fact is: this code is there and it is used.
I also think that Hijacking code is not good, because if the author of the "stolen" code changes it, it might break something.
But: I didn't do that, it was a C::B-developer, or a C::B-developer decided to put in into svn!
No problems with that.
The changes to the xrc-files on the other hand do not break the original-code. The only change the original behaviour, when the label contains too long text. This is a standard-beaviour when using sizers in wxWidgets, and that is one of the main causes to use them.
The clean solution would be to rewrite the editormanager-code.
Perhaps I will do so, but I don't have enaough time to do so until (perhaps) the next weekend.
Jenna:
--- Quote from: MortenMacFly on November 07, 2007, 10:51:57 am ---... or at least shorten the path. That's it.
--- End quote ---
By the way, it's not always the developers decision which path he uses.
And I don't think an IDE should force the user to use special paths, if there is no really good cause to do that.
MortenMacFly:
--- Quote from: jens on November 07, 2007, 11:41:05 am ---Did anybody really read what I post?
--- End quote ---
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.
thomas:
--- Quote ---Did anybody really read what I post?
--- End quote ---
Read yes, understand no. I think you are talking about an entirely different dialog.
--- Quote ---There is existing code in editormanager.cpp, not written by me.
--- End quote ---
Yes, this code uses cbMessageBox. It does not use XRC. And, it is a different dialog than the one you want to patch.
--- Quote ---The changes to the xrc-files on the other hand do not break the original-code. The only change the original behaviour, when the label contains too long text. This is a standard-beaviour when using sizers in wxWidgets, and that is one of the main causes to use them.
--- End quote ---
Yes, nobody doubts this... but it is a completely unrelated dialog.
--- Quote ---The clean solution would be to rewrite the editormanager-code.
--- End quote ---
The code in editormanager.cpp is clean, it does not need a rewrite. EditorManager calls a standard function which takes a text and shows a "Yes/No" dialog box using standard components (wxMessageDialog). That is a 100% legitimate thing to do.
I don't know why it does not work properly for the OP, but it surely does not need any rewrite inside EditorManager.
Jenna:
--- Quote from: MortenMacFly on November 07, 2007, 11:51:09 am ---
--- Quote from: jens on November 07, 2007, 11:41:05 am ---Did anybody really read what I post?
--- End quote ---
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.
--- End quote ---
Sorry, but that's not right.
Open this link from the C::B-svn.
Search for the function "CheckForExternallyModifiedFiles()".
In the function you will find this code:
--- 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();
}
--- End code ---
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version