Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
36 user(s) are online (29 user(s) are browsing Forum)

Members: 0
Guests: 36

more...


Browsing this Thread:   1 Anonymous Users




« 1 ... 7 8 9 (10)


Re: Default Icon Action
#6
Home away from home
Home away from home


See User information
Hi Ball000,

thanks for your input :appreciated:

Quote:
Ball000 wrote:
Isn't it enough to put "CLI" (without the quotes) in the tooltypes of the default icon.

Appearantly not :/

It seems doing it like you suggested, it still does not 'push' the name of the script to the tool. The tool will run, but the script isn't started.

I always wondered about why it isn't possible (at least that i know of) to have that CLI tooltype have something like e.g. CLI %F, and that it automatically replaces the %F with the (full) name of the actual project file that the icon belongs to.

I actually got something working, but it needs some cleanup.

Basically it is just like the normal iconx command but with a search replace for an additional tooltype (CLICOMMAND in my situation).

- the tool is set to wb2cli
- normal tooltypes as for iconX apply
- extra tooltype e.g. CLICOMMAND=lua:lua "%F"
- wb2cli reads CLICOMMAND tooltype
- wb2cli replaces %F with the original project-name.
- wb2cli systemtags() the lua:lua command with additional parameter

I am all for a system default solution, but i haven't come across it yet :/ (which is not a big wonder as normally a command like lua would _know_ about tooltypes and act accordingly. Alas, reality is that wb2cli seems to fill a gap.

Any other suggestions are welcome, as i am out of ideas myself.

Posted on: 2014/2/22 16:17
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Default Icon Action
#5
Home away from home
Home away from home


See User information
Isn't it enough to put "CLI" (without the quotes) in the tooltypes of the default icon. It should be sufficient, considering how the OpenWorkbenchObject() function works.

Posted on: 2014/2/22 15:51
Everyone knew it was impossible. Along came a fool who did not know and he did it.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Default Icon Action
#4
Home away from home
Home away from home


See User information
@azvereth:
Exactly

You are on the right track. you might want to consider another tooltype called parameters (besides runwith).

Reason for this is for programs and/or scripts with spaces in their name, which could lead to problems. Ofcourse implementing quoting (and/or double-quoting) is also an option ofcourse. As long as it is handled ok, it should work.

Oh, and a word of warning: if you use your tool in a default icon, you also have to consider the fact that somneone could select 10 icons which have your tool in it's icon you would get all scripts as paramters in one go (in wbargs). At least that is how i understood it to work.

Posted on: 2014/2/22 8:58
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Default Icon Action
#3
Home away from home
Home away from home


See User information
Thanks....

Think is it not so hard to implement that with FPC.... Perhaps it is possible to use AmiLUA as a "wrapper" (investigating as I have not written a single line of code in lua ever).

Think I am going to give it a try.

It is just as simple as take the WBMessage which contain two params the tool and the invoked projectname...
the tool must be the imaginary WBtoCLI but perhaps it is possibel (it should be) to provide a default tool to use in tooltypes tab as an argument, for example RUNWITH=lua:lua

Internally the WBtoCLI should be like start a shell FROM passed script with lua:lua <projectfile>

Posted on: 2014/2/22 8:42
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Default Icon Action
#2
Home away from home
Home away from home


See User information
Hi azvareth,

More info required (so i can check).

- Wanderer or dopus magellan (and if the latter in which 'mode').
- Icaros desktop 1.5.2 regular or wip5, or perhaps even something else ?

In theory it should already work out of the box (if lua supports detecting started from wb), and if parameters are required then yes a solution like xicon (not iconx) can be used to parse (extra) parameters (could be a bit ackward on a default icon though).

red:
Here is an example of how to 'detect' started from wb/cli and act accordingly. More about implementation can be found here and to summarize here. (just try it with fpc, it's a piece of cake ).

Only when extra parameters are required then one would have to fallback to the arguments in the toollist and act accordingly.

red2: just checked (icaros WiP5) with for example Development/Lua/test-mui/Blancing.alua using doubleclick in Wanderer -> works like a charm.

red3: ah, got it. Indeed it would require some sort of 'frontend' like xicon that is capable of providing arguments through using tooltypes in the icon.

Reason for this is that programs like lua are not aware of amiga startup differences and tooltypes (hence why amilua exist).

The only way to be able to solve that is by either using a iconx script, but that would require you to provide the name of the script (and therefor iconx would defeat its own purpose) or something similar as xicon that can parse the tooltypes and 'push' them to the Tool given in the project icon. If something like textmacros can be used in the tooltype (e.g. %FILENAME% for the actual scriptname that was associated with the project's icon) then you could create a default icon for such (commandline) tools that doesn't have a clue about amiga.

Posted on: 2014/2/21 22:44

Edited by magorium on 2014/2/21 23:28:34
Edited by magorium on 2014/2/21 23:44:16
Edited by magorium on 2014/2/22 0:48:49
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Default Icon Action
#1
Home away from home
Home away from home


See User information
Hello!

This might be a quite stupid question, however... I am trying to do something like this...

I have a show all icons selected in lua test directory (as the files have no .info file...

There I try to doubleclick one of the icons in hope that it should (according to the default icons tooltype lua:lua) launch lua and pass the script to the parser/interpreter but it does not...

It stops in some sort of interactive commandline version of lua.

I can however launch a CLI window and type lua:lua script.lua, and that works.

So to the question.

Could the default_lua icon be set up so that lua (or whatever default project tool) is invoked and the selected project file is passed as an argument to the tool itself...

Like an imaginary WBToCli that takes all WBParams and adjust them for CLI usage. for example something like this WBToCLI <"default command"> [$selectedfile]

note: I tried to use the Open command as well... but it did not work, I guess that tool check the default icon project tool and finds itself.

Posted on: 2014/2/21 22:30
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




« 1 ... 7 8 9 (10)



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project