|
ewemoa
|
 |
« Reply #275 on: March 29, 2012, 05:40:42 PM » |
|
No problem at all. Please rename appropriately.
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #276 on: March 29, 2012, 05:44:05 PM » |
|
Just thinking that one of the common uses for setInput would be when you zip a file, or do something else with a file to reopen Qatapult with the ouput file focused.
Thanks for the example situation. Along the lines of zipping / archiving, do you have any UI ideas how one might approach multiple files / folders being selected for zipping / archiving? In QS, there was the "comma trick", but I'm wondering whether there might be better alternatives...
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #277 on: March 29, 2012, 06:16:46 PM » |
|
The comma trick seems good to me. I had a look to integrate that this WE. This is really a core change and there is well over 50 places where I must fix things, so I will really need some quiet time to plug that. I don't know what could make it better, I think that allowing Qatapult to be a drop target might be nice so that we could drop files directly from the explorer into Qatapult. I would certainly use that. If you have some other usage ideas, I'm listening. As a status update, I'm doing two things right now : - fix memory leaks (I unplugged my memory leak finder to find a bug and left it unplugged. Leaks are not easier to find in larger quantities  ) - implementing a paste using the new DynaWrapper code. I have working clipboard code for text already. I'm also discovering that this is not a very easy environnement to develop into, but may be it will be easier as I write more wrappers.
|
|
|
|
|
Logged
|
|
|
|
|
|
ewemoa
|
 |
« Reply #278 on: March 29, 2012, 07:12:49 PM » |
|
The comma trick seems good to me. I had a look to integrate that this WE. This is really a core change and there is well over 50 places where I must fix things, so I will really need some quiet time to plug that. I don't know what could make it better,
I don't know about the aesthetics of it, but the following display idea came up: 1. Press comma 2. Current pane extends vertically (like a stack?) Just a random thought 
I think that allowing Qatapult to be a drop target might be nice so that we could drop files directly from the explorer into Qatapult. I would certainly use that.
Same here! Drop target would be great. Also being able to drag from Qatapult would be nice too -- quickly find something with Qatapult for use elsewhere (until there's a plugin  ).
One thing that I've wanted in FARR is the ability to drop items on to an individual result. I have FARR configured to use "Blank search shows files from launch history..." -- and I've wanted to use that as a kind of dock to drop items on to, but last I checked, this doesn't work. So certainly would be nice to have this in Qatapult!
As a status update, I'm doing two things right now : - fix memory leaks (I unplugged my memory leak finder to find a bug and left it unplugged. Leaks are not easier to find in larger quantities  ) - implementing a paste using the new DynaWrapper code. I have working clipboard code for text already. I'm also discovering that this is not a very easy environnement to develop into, but may be it will be easier as I write more wrappers. Wishing you luck in these matters...
By the way, what do you think of the idea of a command history like in command line shells? IIRC, in bash and other *nix shells, Control-P / Control-N is used for previous command / next command. If there were hooks for a plugin to register to execute code upon certain key sequences as well as a chance to operate on command content before Qatapult executes the command, I'd be interested in writing a plugin for command history 
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #279 on: April 04, 2012, 08:01:09 PM » |
|
Do you mind if I change the name of setInput to setOutput ? I think it would be more appropriate.
On a related note regarding renaming -- I think in English, spelling for collector ends in 'or'. When I did search, I found that in French there is a word that ends in 'er'. May be you knew this already 
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #280 on: April 05, 2012, 06:33:58 AM » |
|
I don't know about the aesthetics of it, but the following display idea came up:
1. Press comma 2. Current pane extends vertically (like a stack?)
I think, I'll let skins handle that. I was considering doing something similar to QS as a default : putting extra arguments icon under each items. But that's going to be totally customisable in others skins. History is something you'd need probably more access that you currently have. The history I though was most interesting is an history of rules, I really think that objects are insufficient, you want to repeat an action usually, not get the previous object. However I totally like the idea, and this is going to find its way into Qatapult. Collecter is a a mistake. Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
ewemoa
|
 |
« Reply #282 on: April 05, 2012, 06:49:03 PM » |
|
FWIW, AutoHotkey.dll is what I've been using for at least one earlier Qatapult plugin -- the Calculate one. For reference, below is a bit from Calculate.ahk: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] ; XXX: ScriptText should have #Persistent and a function def ; Pass the script's text using ScriptText ; Pass the name of the function in using FuncName RunFuncInScriptWithInputText(ScriptText, FuncName, InputText) { ; XXX: before didn't need to muck with path... AhkDll := AhkDllThread (A_ScriptDir . "\..\AHK\AutoHotkey.dll") ;OutputDebug, % "Script content: " . ScriptText AhkDll.ahkTextDll(ScriptText) Result := AhkDll.ahkFunction(FuncName, InputText) AhkDll.Terminate() } Calculate(InputText) { FuncName := "Calculate" ScriptText := "#Persistent`n`n" . "#NoTrayIcon`n`n" . FuncName . "()`n" . "{`n" . " Result := " . InputText . "`n" . " Return % Result . A_Space`n" ; XXX: convert to string . "}`n" Result := RunFuncInScriptWithInputText(ScriptText, FuncName, InputText) Result := RTrim(Result) ; XXX: consider whether to modify trailing zeros }
AutoHotkey.dll has some nice features and the developer (HotKeyIt) is usually pretty responsive about bug reports, but docs for his things are not always up-to-date.
|
|
|
|
« Last Edit: April 05, 2012, 06:54:58 PM by ewemoa »
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #283 on: April 09, 2012, 05:18:01 PM » |
|
I've uploaded a new version. This is the ground for the future settings ui that should be more usable. You can now enable and disable plugins from the UI. There is also a ton of less memory leaks.
There are new functions that you can use by doing a require("lib/clipboard.js") : they are clip and paste. Paste can optionally take a text to paste. You can also do a sendinput but it's currently limited to printable characters only. If you feel like improving it, I'll be happy to take your version and put it in Qatapult.
Both functions are built with direct call to win32 dll from javascript using the dynamic wrapper. Have a look to clipboard.js in lib if you want to see what it looks like.
There is a new jsmath plugin that eval javascript as a way to evaluate mathematical expression. Start a query with = on the first pane to trigger it. It work well but doesn't handle the display exactly the way I would like : The perfect thing ihmo would be to have a custom display on the first pane that display both the expression and the result, then a second pane with the operation. The current thing use 3 panes. I think that it might be worthwhile that we use some specially named values that skins could detect and handle display for a large number of types instead of handling types individually like we do today : skins could be more versatile that way ihmo.
I've also fixed the collecter things as ewemoa suggested => please use now collector.js for your plugins now.
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #284 on: April 09, 2012, 05:42:43 PM » |
|
I've uploaded a new version. This is the ground for the future settings ui that should be more usable. You can now enable and disable plugins from the UI. There is also a ton of less memory leaks. Thanks for the new version! Just a quick note -- I no longer see "Quit" or "Reload". This is with a fresh install on Windows XP SP3. Any ideas?
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #285 on: April 09, 2012, 05:48:22 PM » |
|
There are new functions that you can use by doing a require("lib/clipboard.js") : they are clip and paste. Paste can optionally take a text to paste. You can also do a sendinput but it's currently limited to printable characters only. If you feel like improving it, I'll be happy to take your version and put it in Qatapult.
Both functions are built with direct call to win32 dll from javascript using the dynamic wrapper. Have a look to clipboard.js in lib if you want to see what it looks like.
There is a new jsmath plugin that eval javascript as a way to evaluate mathematical expression. Start a query with = on the first pane to trigger it. It work well but doesn't handle the display exactly the way I would like : The perfect thing ihmo would be to have a custom display on the first pane that display both the expression and the result, then a second pane with the operation. The current thing use 3 panes. I think that it might be worthwhile that we use some specially named values that skins could detect and handle display for a large number of types instead of handling types individually like we do today : skins could be more versatile that way ihmo.
Looking forward to checking these bits out...however, I don't see them in the latest zip. I tried downloading with 2 browsers but didn't notice any difference. For reference, the MD5 of what I ended up with was: MD5: 7a416eb360fcbd53dcfc1e672f575839 What am I missing?
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #286 on: April 09, 2012, 05:59:36 PM » |
|
Oups, I forgot to say that I moved all Qatapult verbs under the Qatapult file : type Qatapult and look at the available verbs
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #287 on: April 09, 2012, 06:02:37 PM » |
|
Thanks for spotting the missing plugins, they were still excluded from the package. The last version should contain all of them.
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #288 on: April 09, 2012, 07:52:50 PM » |
|
...the missing plugins, they were still excluded from the package. The last version should contain all of them.
I see them now. Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #289 on: April 09, 2012, 07:56:55 PM » |
|
I moved all Qatapult verbs under the Qatapult file : type Qatapult and look at the available verbs
I typed 'qatapult' (no quotes) and I see three results in pane 0: - qatapult.png
- Qatapult.exe
- qatapult
None of the associated verbs for any of these (in pane 1) appears to be 'Quit' nor 'Reload'. May be I misunderstood? FWIW, the currentversion.txt file contains: 20120410010112 and MD5 of the zip file is: 614f0ec74c5ccdf48b6af2574d341858
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #290 on: April 09, 2012, 08:59:55 PM » |
|
please use now collector.js for your plugins now.
FWIW, in the latest download, I see the following file names: - jsmath.collecter.js
- putty.collecter.js
- snippets.collecter.js
- uninstall.collecter.js
Also, in Qatapult\Lib there is FileGetVersionInfo.ahk -- I think this is unnecessary.
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #291 on: April 09, 2012, 09:11:39 PM » |
|
There is a new jsmath plugin that eval javascript as a way to evaluate mathematical expression. Start a query with = on the first pane to trigger it.
I like that I get an immediate result displayed  Now how to get a history thing working... BTW, any chance of functionality for clearing the current pane's input? May be there is already something...
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #292 on: April 09, 2012, 09:13:11 PM » |
|
There are new functions that you can use by doing a require("lib/clipboard.js") : they are clip and paste. Paste can optionally take a text to paste. You can also do a sendinput but it's currently limited to printable characters only. If you feel like improving it, I'll be happy to take your version and put it in Qatapult.
Both functions are built with direct call to win32 dll from javascript using the dynamic wrapper. Have a look to clipboard.js in lib if you want to see what it looks like.
I found clibpboard.js and test.command.js in plugins\commands -- taking a look now. Thanks for this example code.
|
|
|
|
« Last Edit: April 09, 2012, 09:18:23 PM by ewemoa »
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #293 on: April 10, 2012, 06:23:27 AM » |
|
In plugins\commands\clipboard.js there are a few lines that I don't understand well. Please explain what the following were meant to do: Formatted for Javascript with the GeSHI Syntax Highlighter [ copy or print] for(var a in args[i]) { break; }
Formatted for Javascript with the GeSHI Syntax Highlighter [ copy or print] this.length+=desc[t].size;
For the second bit, I don't see any desc anywhere else in the file. I see that Struct is defined in lib\stdutils.js, so may be I should be ignoring some or all of clipboard.js?
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #294 on: April 11, 2012, 06:39:05 AM » |
|
About the collecter plugins, I feared that people would copy plugins folder over the old one without deleting the previous one. That's what I do actually. I feared that it would lead to entries being duplicated so I just leaved collecter for the moment. However if you create a new plugin collector.js is the correct name to use. Just thinking about it, I think that I could let qatapult rename theses files for consistency. Reload, Quit and Options should now appears under the Qatapult entry. Here is what I got :  Is it different from what you have ewemoa ? I agree with you about the history ewemoa. I was considering doing a global history. May be there should be some way to narrow the history to things that have the same start as the current selection so that we could get an history of math results and an history of operations on some file. You're right about clipboard.js. It should be there. It's actually useless as it's not loaded. It doesn't do anything. The whole code about clipboard is in test.command.js that I should probably rename. I probably considered that it should only be called by command plugins so there wasn't too much needs to put it available as a library. I'm not sure if that's a good choice. this.length+=desc[t].size; clipboard.js is actually useless, this code is incorrect. for(var a in args) { break; } This is a trick to have a take the value of the first available item. I iterate once then exits. It do that because I describe types of the Struct function as an array of object : [{key:value}]. This line allows me to get the name of the key. I don't know of any other way to get that in javascript.
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #295 on: April 11, 2012, 06:19:54 PM » |
|
Thanks for the response  Reload, Quit and Options should now appears under the Qatapult entry.
...
Is it different from what you have Yes. I get: 
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #296 on: April 11, 2012, 06:21:28 PM » |
|
I was considering doing a global history. May be there should be some way to narrow the history to things that have the same start as the current selection so that we could get an history of math results and an history of operations on some file. Narrowing / filtering history sounds like an interesting idea. May be it's worth trying if it's easy to implement.
|
|
|
|
|
Logged
|
|
|
|
|
ewemoa
|
 |
« Reply #297 on: April 11, 2012, 06:45:17 PM » |
|
Thanks for the explanations regarding the 2 bits of code. Regarding the "for in" construct, I remember something about possible problems in some circumstances if hasOwnProperty is not used to check that an iterated key is not inherited. I'm not sure of what the precise details are, but FWIW, the following is from the Options page of jshint: This option requires all for in loops to filter objects' items. The for in statement allows for looping through the names of all of the properties of an object including those inherited throught the prototype chain. This behavior can lead to unexpected items in your object so it is generally safer to always filter inherited properties out as shown in the example: for (key in obj) { if (obj.hasOwnProperty(key)) { // We are sure that obj[key] belongs to the object and was not inherited. } } For more in-depth understanding of for in loops in JavaScript, read Exploring JavaScript for-in loops by Angus Croll. I wonder if it is relevant in this case.
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #298 on: April 12, 2012, 06:15:06 AM » |
|
Thanks for the explanations regarding the 2 bits of code. No pb. About the for in construct, yes it can be annoying if it match some extra properties defined on prototype object. I will avoid to do that, it is somewhat seen as a bad practice now because of such issues.
|
|
|
|
|
Logged
|
|
|
|
|
ecaradec
|
 |
« Reply #299 on: April 12, 2012, 06:16:13 AM » |
|
I think that your version of Qatapult.exe is old, it probably didn't copied correctly or something like that. The new version has an hi-resolution icon when you focus it.
|
|
|
|
|
Logged
|
|
|
|
|