Page 1 of 1

Alias overwrite warning

Posted: 2007-01-19, 17:57 UTC
by fenix_productions
Hello everybody.

First try to do something like this:
1. in usercmd.ini file define section similiar to:

Code: Select all

[em_test]
Menu=test
Cmd=D:\picture.jpg
button=
2. assign em_test to "notepad" alias

Now, writing "notepad" in command line will give You picture preview. Before 2nd step: typing "notepad" gives notepad application.

My proposal is that TC should check for existing Windows aliases and give a warning about overwriting it.

Or maybe give alternates:
1. warning dialog with "assign / change alias / cancel" buttons
2. assign alias to TC but give Information about possibility of executing system registry alias via (e.g.) Shift+Enter (this should be implemented)

Posted: 2007-01-19, 18:29 UTC
by petermad
I don't think notepad is a Windows alias (whatever that might be) - it is simply the name of an executable file that happens to be placed in a directory listed in the PATH environment and therefore executed no matter wich directory one might be in.

Therefore your suggestion implies that TC should check all executables in the PATH environment when assigning an alias - I don't think that is feasible. On my system that's 879 files, and it could easily be a lot more (I am very restrictive about what I install).

Posted: 2007-01-20, 02:26 UTC
by fenix_productions
As "Windows alias" I understand these applications which have own registry key below HKEY_CLASSES_ROOT\Applications.
I've realized that %PATH% does matter too for command line.

What is wrong with checking for existence of "sample.exe" in %PATH% or registry?

Why not feasible?
You just have to check one file.
I've wrote sample application for this purpose in 30 minutes (C# noob). It works pretty fast for ~500 exe files and 80 registry keys.

Posted: 2007-01-20, 10:20 UTC
by petermad
It works pretty fast for ~500 exe files and 80 registry keys.
How fast? And shouldn't you search for sample.exe, sample.com, sample.bat and sample.cmd to cover all instances of sample - and will that influence the speed considerably?

Don't misunderstand me - I am not against the idea, but if it means having to wait more than max. ½ a sec. I don't think it will be nice to work with.

Posted: 2007-01-20, 11:07 UTC
by fenix_productions
I understand delay issue. I've been wondering about this possibility because I'am assigning aliases very rarely, so even 2sec could be acceptable for me.

P.S. How often do You use thumbnails view? How long does it need to generate previews?
P.S.2. "How fast?" I can send You this app if You want to ;)

Posted: 2007-01-20, 11:37 UTC
by petermad
I understand delay issue. I've been wondering about this possibility because I'am assigning aliases very rarely, so even 2sec could be acceptable for me.
I see - you only want the alias check performed when assigning an alias - I thought that the check should be done every time a command (like notepad) was executed - to check for new programs with that name that might eventually have been installed after the alias was assigned.

If the check only has to be done during the alias assigning I agree that a bigger delay is tolerable.

How often do You use thumbnails view? How long does it need to generate previews?
I use them regularily. The time it takes generating them really depends on a lot of things, like OS, processor speed, generating method (plugin method, explorer method, viewer method) and the size of the pictures - Here it takes less than ½ sec for 16 96x72 pixels thumbnails (a full panel) of 500k jpeg's using the Explorer method on Win XP SP2 with a 3 GHz CPU

Posted: 2007-01-20, 16:16 UTC
by fenix_productions
petermad wrote:I see - you only want the alias check performed when assigning an alias
Yes.
And there would be always TC alias executed on Enter key. When user press Shift+Enter, TC should try to execute "Windows alias" (maybe using ShellExecute() function).

Posted: 2007-01-20, 19:01 UTC
by petermad
When user press Shift+Enter
Shift+Enter already has its own function:
1. Runs command line / program under cursor with preceding command /c and leave the program's window open. Only works if NOCLOSE.PIF is in your Windows directory!
2. With ZIP files: use alternative choice of these (as chosen in Packer config): (Treat archives like directories <-> call associated program, i.e. winzip or quinzip)
3. Inside an archive file: Unpack the file under the cursor and treat it like an archive (zip in zip processing)
4. In the list of last used dirs (History, Ctrl+D), open the directory on a new Tab

Posted: 2007-01-20, 20:28 UTC
by fenix_productions
One of available Enter combinations.
(Ctrl+Alt+Enter or Win+Enter)