Jump to content
PeterPanettone

Uses Clause Manager - Showing the filepath of the selected unit in the StatusBar

Recommended Posts

I've added a very useful feature to UCM: Showing the full file path of the selected unit in the StatusBar (this works in all tabs):

 

image.thumb.png.ee7d3c7e730a9673cd2f1012a87a9897.png

 

Double-Clicking on the StatusBar copies the full file path displayed on the StatusBar to the clipboard!

 

Here are the sources:

 

GX_UsesExpert.zip

 

Here is the link to the filed request:

 

https://sourceforge.net/p/gexperts/feature-requests/82/

 

Edited by PeterPanettone
  • Thanks 2

Share this post


Link to post

Fixed another small bug: If the selected UnitFilePath does not exist (not GxOtaTryFindPathToFile) then the StatusBar text was not cleared.

 

Please download this newest version:

 

GX_UsesExpert4.zip

Edited by PeterPanettone

Share this post


Link to post

• Fixed a bug: The context popup menu of the Units List was not available in the Identifiers tab.:

 

    cpmit.png.8d065b2791531f64741d876e3b10768e.png   

 

• Improved the context popup menu of the Units List:

 

    cmul.thumb.png.7ac8950bed2c93211bc4174756a36a31.png

    • Added new menu item Copy this Identifier to the Clipboard only to the Units-List context menu of the Identifiers tab

    • Added new icons to the Units-List context menu

 

Please download this newest version:

 

GX_UsesExpert5.zip

 

  • Thanks 1

Share this post


Link to post

Thanks, committed. Please use the current sources if you want to improve this further. I'll keep my hands off this code for now in order to not create any conflicts.

 

I made Copy text to clipboard the default for the status bar context menu. The other changes, in particular to the dfm file are due to incompatibilities to Delphi 6.

  • Like 2

Share this post


Link to post
16 hours ago, PeterPanettone said:

I have added a context popup menu to the UCM StatusBar:

 

image.thumb.png.2ea8585c56fcdaae93b80b662ef8cc87.png

 

Here are the changed sources:

 

GX_UsesExpert2.zip

 

What's the difference between "Copy this TEXT" and "Copy this FILE" ?

Personally I would name these items differently as they look a bit odd (probably a matter of taste):

Like "Copy File to Clipboard" (or "Copy Path to Clipboard" ?)  and "Copy Text to Clipboard"  but I'm not quite sure what the function behind is doing.

 

I would also rename "Show this File in WindowsExplorer" to "Open File Location" (Same terminology as Windows) or at least write "Windows Explorer" instead of "WindowsExplorer"

  • Like 1

Share this post


Link to post
50 minutes ago, toms said:

What's the difference between "Copy this TEXT" and "Copy this FILE" ?

The first one works, the second one doesn't 😉 (Not implemented)

 

It guess Peter's intention is to make this the same as pressing Ctrl+C in the Windows Explorer.

Share this post


Link to post

From the point of usability, it's better to indicate somehow that popup menu is available. Otherwise the feature won't be used by nobody except authors ))

Share this post


Link to post
1 hour ago, toms said:

What's the difference between "Copy this TEXT" and "Copy this FILE" ?

For an experienced computer user (and for developers in general), this should be pretty clear:

 

•  "Copy this TEXT" copies the TEXT on the StatusBar to the Windows clipboard and then can be PASTED into a text editor or into the IDE Source Code Editor. I deliberately used the wording "TEXT" (and not "path") because in the future the UCM StatusBar could contain other text types and not only file-paths. A very useful feature.

 

• "Copy this FILE" copies the selected unit FILE to the Windows clipboard and then can be pasted (e.g. with CTRL-V) as a FILE into Windows Explorer (or your custom File Manager). A very useful feature. I am planning to implement this soon. Of course, if the StatusBar does not contain a path to an existing file, then this menu item will be disabled. This has already been implemented.

 

You can see that the wording of the menu items was carefully selected for SPECIFIC SENSIBLE REASONS.

Edited by PeterPanettone

Share this post


Link to post
45 minutes ago, Fr0sT.Brutal said:

From the point of usability, it's better to indicate somehow that popup menu is available. Otherwise the feature won't be used by nobody except authors ))

You are right. I will add an explaining hint to the StatusBar, so anybody capable of moving the mouse pointer over the StatusBar can see this explanation.

 

If anybody wishes it I could even add a clickable INFOimage.png.fe8ad11dd11b994540327a7b5c802e56.png or DROPDOWNimage.png.f6fa4b11c0bf6906c9e85c06c8610d6f.png  icon to the StatusBar.

Edited by PeterPanettone
  • Like 1

Share this post


Link to post
25 minutes ago, PeterPanettone said:

 

You can see that the wording of the menu items was carefully selected for SPECIFIC SENSIBLE REASONS.

Does that also apply for my other remark?

 

Quote

 

I would also rename "Show this File in WindowsExplorer" to "Open File Location" (Same terminology as Windows) or at least write "Windows Explorer" instead of "WindowsExplorer"

 


 

WindowsExplorer is written like this: Windows Explorer and has been renamed in Windows 10: https://support.microsoft.com/en-ie/help/4026617/windows-10-windows-explorer-has-a-new-name
  • Like 1

Share this post


Link to post
3 minutes ago, toms said:

"Open File Location"

This feature does not only open the File Location but also visibly selects the file in File Explorer. So using the wording "open the File Location" could possibly be misleading. What do you think?

Share this post


Link to post
7 minutes ago, PeterPanettone said:

This feature does not only open the File Location but also visibly selects the file in File Explorer. So using the wording "open the File Location" could possibly be misleading. What do you think?

Since it is the same functionality as in Windows, when you right click on a shortcut, I think it's fine to call it the same: "Open file location"

 

  • Like 1

Share this post


Link to post
1 hour ago, dummzeuch said:

Since it is the same functionality as in Windows, when you right click on a shortcut, I think it's fine to call it the same: "Open file location"

 

Many wordings in Windows IMO are imprecise or outright naive. But for the sake of compatibility, I have changed it to "Open Location of This File". Is this fine for everybody?

 

(In another context, I would have added shell functionality to the StatusBar, but this is not possible here). However, I could add a menu item that displays the Explorer file context menu of the file displayed in the StatusBar. That would be useful in several situations.

Edited by PeterPanettone

Share this post


Link to post

The full source filenames are now cached and added whenever they are available (e.g. when the identifier parser finishes or when the project units parser does not use the map file but the dpr), so they rarely need to be searched for again. This speeds up updating the status bar quite a lot and prevents the annoying lags when scrolling through the lists which was previously caused by the search.

 

I haven't tried it on a slow computer yet, but I am confident that this change makes quite a difference there too.

  • Like 1
  • Thanks 1

Share this post


Link to post

Please add a switch to the "Identifiers" tab using the Alt + I keyboard shortcut. Thanks in advance

Share this post


Link to post
On 3/4/2020 at 6:41 AM, Dinar said:

Please add a switch to the "Identifiers" tab using the Alt + I keyboard shortcut. Thanks in advance

I was just about to say that Alt+I is already taken by some other function, because I distinctly remember not setting it for some reason, but apparently it isn't and my memory is wrong. So: Done in revision #3063

  • Thanks 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×