Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-04

Renaming an existing unit

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis
to Richard Mace
Richard Mace wrote
What's the best steps for renaming a unit, that is part of an existing project?

File -> Save as. And answer yes on the question whether you want to update all references.

Joost.

Reply by email

Richard Mace
to Joost van der Sluis
Joost van der Sluis wrote 9 lines
On Thu, 2012-04-19 at 15:29 +0100, Richard Mace wrote: > What's the best steps for renaming a unit, that is part of an existing > project? File -> Save as. And answer yes on the question whether you want to update all references. Joost.

Wow, I wasn't expecting it to be that easy/cool :)

Thanks Joost
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120419/dab212f5/attachment.html>

Reply by email

Jürgen Hestermann
to Richard Mace
> What's the best steps for renaming a unit, that is part of an

existing

> project? File -> Save as. And answer yes on the question whether you want to update all references. Wow, I wasn't expecting it to be that easy/cool :)

Not so very cool IMO.
The question was how to *rename* a unit. But this is not a rename. It seems to create a copy and you have to clean up the original version yourself.
Though better than nothing of course.

Reply by email

Sven Barth
to Jürgen Hestermann
J?rgen Hestermann wrote 12 lines
Richard Mace schrieb: > > What's the best steps for renaming a unit, that is part of an existing > > project? > File -> Save as. And answer yes on the question whether you want to > update all references. > Wow, I wasn't expecting it to be that easy/cool :) Not so very cool IMO. The question was how to *rename* a unit. But this is not a rename. It seems to create a copy and you have to clean up the original version yourself. Though better than nothing of course.

Joost did forget to mention that between the Save As and the update of the references dialog there is also a dialog which asks you whether you want to delete the original file.

Regards,
Sven

Reply by email

Graeme Geldenhuys
to Jürgen Hestermann: existing Not so very cool IMO. The question was how to *rename* a unit. But this is not a…
J?rgen Hestermann wrote
The question was how to *rename* a unit. But this is not a rename. It seems to create a copy and you have to clean up the original version yourself.

Nope, Joost is correct. Lazarus IDE detects it as a "rename", and prompts you to update all other references and if you want to delete the old unit.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Richard Mace
to Graeme Geldenhuys
Graeme Geldenhuys wrote 11 lines
On 19 April 2012 19:30, J?rgen Hestermann wrote: > The question was how to *rename* a unit. But this is not a rename. > It seems to create a copy and you have to clean up the original version > yourself. Nope, Joost is correct. Lazarus IDE detects it as a "rename", and prompts you to update all other references and if you want to delete the old unit.

It did ask, and worked exactly as I would expected to.

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120419/a87a1057/attachment.html>

Reply by email

Jürgen Hestermann
to Sven Barth: Joost did forget to mention that between the Save As and the update of the references…
Show quoted text 19 lines
On 19.04.2012 19:30, J?rgen Hestermann wrote: > Richard Mace schrieb: > > > What's the best steps for renaming a unit, that is part of an > existing > > > project? > > File -> Save as. And answer yes on the question whether you want to > > update all references. > > Wow, I wasn't expecting it to be that easy/cool :) > > Not so very cool IMO. > The question was how to *rename* a unit. But this is not a rename. > It seems to create a copy and you have to clean up the original version > yourself. > Though better than nothing of course. Joost did forget to mention that between the Save As and the update of the references dialog there is also a dialog which asks you whether you want to delete the original file.

That's good news! Was this added recently?
I remember vaguely that I did the same long ago but if I remember right I was not asked about deleting the old version.

Reply by email

Sven Barth
to Jürgen Hestermann
"J?rgen Hestermann" wrote 8 lines
Sven Barth schrieb: > On 19.04.2012 19:30, J?rgen Hestermann wrote: >> >> Richard Mace schrieb: >> > > What's the best steps for renaming a unit, that is part of an

existing

Show quoted text 13 lines
>> > > project? >> > File -> Save as. And answer yes on the question whether you want to >> > update all references. >> > Wow, I wasn't expecting it to be that easy/cool :) >> >> Not so very cool IMO. >> The question was how to *rename* a unit. But this is not a rename. >> It seems to create a copy and you have to clean up the original version >> yourself. >> Though better than nothing of course. > > > Joost did forget to mention that between the Save As and the update of

the references dialog there is also a dialog which asks you whether you want to delete the original file.

> That's good news! Was this added recently? I remember vaguely that I did the same long ago but if I remember right I was not asked about deleting the old version.

That dialog is quite old already. I remember it existing in at least 0.9.26 if not earlier.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120420/0c7872f1/attachment-0001.html>

Reply by email

Jürgen Hestermann
to Sven Barth: Joost did forget to mention that between the Save As and the update of the references…
On 19.04.2012 19:30, J?rgen Hestermann wrote: > Richard Mace schrieb: > > > What's the best steps for renaming a unit, that is part of an

existing

Show quoted text 14 lines
> > > project? > > File -> Save as. And answer yes on the question whether you want to > > update all references. > > Wow, I wasn't expecting it to be that easy/cool :) > > Not so very cool IMO. > The question was how to *rename* a unit. But this is not a rename. > It seems to create a copy and you have to clean up the original version > yourself. > Though better than nothing of course. Joost did forget to mention that between the Save As and the update of the references dialog there is also a dialog which asks you whether you want to delete the original file.

Though it does actually what was intended I still think this is a very crude workaround.
If I don't know about the mentioned behaviour I would not click on "Save as" when I
just want to rename a unit. I would search for a function "Rename" instead. "Save as" is a common function for creating a copy of something. That a dialog will appear that allows deletion of the original version is completely unexpected an unintuitve. Much better would be to offer a "Rename" directly.

Reply by email

Graeme Geldenhuys
to Jürgen Hestermann
J?rgen Hestermann wrote
"Save as" is a common function for creating a copy of something. That a dialog will appear that allows deletion of the original version is completely unexpected an unintuitve. Much better would be to offer a "Rename" directly.

If you haven't yet, you should read the book "About Face 3" [1]. It's all about UI design, and the author of that book fully agrees with you (and so do I). "Save as" is rather ambiguous, and should probably be "Save as copy" or "Save a copy" in all applications. But as you suggested, "Rename" makes the intention crystal clear. :)

[1] About Face 3: The Essentials of Interaction Design http://www.amazon.com/About-Face-Essentials-Interaction-Design/dp/0470084111

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
[...] suggested, "Rename" makes the intention crystal clear. :)

Never underestimate the universe.
Some people distinguish between rename, move, change type.

"Save As" can move a unit/form to another directory and the IDE will ask if unit search paths should be removed and/or added.

If someone wants to implement a rename, for example in the project inspector, patches are welcome.

Mattias

Reply by email

Jürgen Hestermann
to Mattias Gaertner
> suggested, "Rename" makes the intention crystal clear. :) Never underestimate the universe. Some people distinguish between rename, move, change type.

Yes.
So a distinct function for each would make it clear.

Reply by email

Mattias Gaertner
to Jürgen Hestermann
Show quoted text 7 lines
Mattias Gaertner schrieb: >> suggested, "Rename" makes the intention crystal clear. :) > Never underestimate the universe. > Some people distinguish between rename, move, change type. Yes. So a distinct function for each would make it clear.

Yes, for those people.
The others who don't understand the difference will be confused.

Mattias

Reply by email