Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

a suggestion about internal association

 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) Printable version
View previous topic :: View next topic  
Author Message
fallmq
Junior Member
Junior Member


Joined: 28 Jun 2012
Posts: 14

PostPosted: Sun Jul 08, 2012 9:56 am    Post subject: a suggestion about internal association Reply with quote

the internal association is a very interesting feature, it helps me to build my customize right-click menu and customize icons without edit windows Registry.

but some times I still meet problem, for example:
I define 3 file types *.c *.asm *.h, in order to get 3 different icons.
and I build internal right-click menu for all 3 types, the command is like this "edit with emeditor", "open in sourceinsight" ...
it works well if I select only 1 type of file at the same time. however, if I do a multiple selection, select some C and H files at the same time, I lost my right click menu.
even if I build another file type like this "*.c;*.asm;*.h", it didn't work as well.
Another example is that I am using a some tool "Unlocker" to unlock some opened files, I want to display it in the right-click menu of all files, it is also a impossible mission now, because of the similar reason.

My suggestion is: if we do a multiple file selection, and right click, we can try to match our selections with the file type entries one by one, if not matched or only partly matched, we can try to match the next entry. because some times we may need a different right-click menu when multiple selection.

is it possible to implement it?
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Mon Jul 09, 2012 8:48 am    Post subject: Reply with quote

Currently the function is only supported if all the selected files have the same extension. The problem is that although all the types have a verb "edit with emeditor", it may not be the same command.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4528
Location: Russian Federation

PostPosted: Mon Jul 09, 2012 10:38 am    Post subject: Reply with quote

TC may show items for every 'edit with emeditor' actions if these are defined for more than one template, and user can rename desired ones to distinguish them. Anyway combining of multiple template items would be great.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
fallmq
Junior Member
Junior Member


Joined: 28 Jun 2012
Posts: 14

PostPosted: Mon Jul 09, 2012 11:26 am    Post subject: Reply with quote

just as you said, I define tens of template such as *.c, *.h, *.cpp ......
in order to get a right click "edit by ...", I will have to modify all the templates, it is really a big job.

but as ghisler said, the problem is that even if we define the same verb for multiple template, it is not a good idea to combine them, because the real command maybe different.

so I think we can make a new template include several different files types.
I try it just now, if I define a new template with file type "*.c;*.h", and move the template to the top of internal association list, I can get my right-click menu even if I select multiple file of different extensions. but if I move the new template under my old template "*.c", the new template will not take effect.

so I think the most diffcult job has already been done, now we are able to select files of different extensions, and match them to one template - if the template support multiple extensions.
the real problem is that, multiple file selection may be matched with more then one templates, just as my example, when I select both C file and H file, my selection matched 3 templates at the same time: template "*.c", template "*.h", and template "*.c;*.h", which template will take effect just depend on their order in the internal association list.
So I guess maybe it is possible to modify the match method: when we do a multiple selection with C file and H file, we can go through all the templates one by one, we may meet the template "*.c" at first, it is not perfectly matched our selection, we can skip it, and try to match the next template, finally we will reach the template "*.c;*.h", it is perfectly match our selection, and we can use this template to show the correct right-click menu.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Wed Jul 11, 2012 2:26 am    Post subject: Reply with quote

That's an interesting idea: this way I wouldn't have to combine multiple templates, but just continue to search for one which matches all files.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Fri Jul 13, 2012 7:26 am    Post subject: Reply with quote

I have already added it to RC4 because it went well into the existing function. Could you try it, please?
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fallmq
Junior Member
Junior Member


Joined: 28 Jun 2012
Posts: 14

PostPosted: Fri Jul 20, 2012 2:02 am    Post subject: Reply with quote

Hi,

I have been using this new feature for several days, most time it works well, but sometimes it didn't work.

finally I find the reason today:
the file matching mechanism is a little different from my supposition before.
I can not describe it well, and I try to use a example.

I create 3 files in a folder: 1.ini, 2.txt, 3.ini. and sort them by file name.

I have 2 internal association templates, 1: (*.txt), 2: (all files). template_2 is under template_1

my test result is:
select 1.ini : match template (all files)
select 2.txt : match template (*.txt)
select 3.ini : match template (all files)
select 1.ini, 2.txt : don't match any template
select 2.txt, 3.ini : match template (all files)
select 1.ini, 3.ini : match template (all files)
select 1.ini, 2.txt, 3.ini : don't match any template

it seems file matching has a small problem, I don't know the detail, hope my test result will do some help.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Fri Jul 20, 2012 10:41 am    Post subject: Reply with quote

Thanks, I will check it in the debugger with your test cases. I didn't encounter such a problem with my tests.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fallmq
Junior Member
Junior Member


Joined: 28 Jun 2012
Posts: 14

PostPosted: Tue Jul 31, 2012 7:57 pm    Post subject: Reply with quote

This feature works very well in rc5, thanks for you effort!
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Thu Aug 02, 2012 6:56 am    Post subject: Reply with quote

Thanks for your feedback, nice to hear that it works now!
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group