Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

svn4800 does not completely fix "file changed, reload?" dialog problem

(1/1)

Jenna:
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;

--- End code ---

Sorry for the inconvenience.

MortenMacFly:

--- Quote from: jens on January 10, 2008, 03:31:22 pm ---
--- 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"),

--- End code ---

--- End quote ---
Why do you add an extra linefeed there?! Is that truely needed?

Jenna:

--- Quote from: MortenMacFly on January 11, 2008, 10:17:27 am ---Why do you add an extra linefeed there?! Is that truely needed?

--- End quote ---

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.

MortenMacFly:

--- Quote from: jens on January 11, 2008, 10:35:22 am ---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).

--- End quote ---
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 ;-))?!

Navigation

[0] Message Index

Go to full version