Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Jenna on January 10, 2008, 03:31:22 pm

Title: svn4800 does not completely fix "file changed, reload?" dialog problem
Post by: Jenna on January 10, 2008, 03:31:22 pm
The following patch is also needed:
Code
--- codeblocks.orig/src/sdk/editormanager.cpp   2007-12-13 21:54:04.000000000 +0100
+++ codeblocks.work/src/sdk/editormanager.cpp   2007-12-18 11:50:54.000000000 +0100
@@ -919,10 +919,11 @@
             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)?"),
+                msg.Printf(_("File %s is modified outside the IDE...\nDo you want to reload it (you will lose any unsaved work)?\n"),
                            ed->GetFilename().c_str());
                 ConfirmReplaceDlg dlg(Manager::Get()->GetAppWindow(), false, msg);
                 dlg.SetTitle(_("Reload file?"));
+                dlg.GetSizer()->SetSizeHints(&dlg);
                 PlaceWindow(&dlg);
                 ret = dlg.ShowModal();
                 reloadAll = ret == crAll;

Sorry for the inconvenience.
Title: Re: svn4800 does not completely fix "file changed, reload?" dialog problem
Post by: MortenMacFly on January 11, 2008, 10:17:27 am
Code
-                msg.Printf(_("File %s is modified outside the IDE...\nDo you want to reload it (you will lose any unsaved work)?"),
+                msg.Printf(_("File %s is modified outside the IDE...\nDo you want to reload it (you will lose any unsaved work)?\n"),
Why do you add an extra linefeed there?! Is that truely needed?
Title: Re: svn4800 does not completely fix "file changed, reload?" dialog problem
Post by: Jenna on January 11, 2008, 10:35:22 am
Why do you add an extra linefeed there?! Is that truely needed?

Yes, without the linefeed the question "Do you want to reload it (you will lose any unsaved work)?" is not shown in the rare case that a file with a really long path is changed (so long that pathname gets wrapped).
If pathname fits in one line, there is an extra line between the question and the buttons.
I am not sure which of both possibilities is worse, so I decided to make the question visible, because it warns the user before doing something possible harmful.
Title: Re: svn4800 does not completely fix "file changed, reload?" dialog problem
Post by: MortenMacFly on January 13, 2008, 02:38:02 pm
Yes, without the linefeed the question "Do you want to reload it (you will lose any unsaved work)?" is not shown in the rare case that a file with a really long path is changed (so long that pathname gets wrapped).
This all is such a nasty hack... :-(

IMHO we should really solve this issue the "right" way. And this is *not* to use the ConfirmReplaceDlg at all. This just does not fit in there and was not designed nor will be modified to fit. A new dialog would be much better - it could use UI controls that just fit the needs for this purpose.

Any objections / suggestions (patches ;-))?!