[Unison-hackers] Command line arguments and OS X GUI

Alan Schmitt alan.schmitt at polytechnique.org
Mon Sep 6 12:35:31 EDT 2010


On 6 sept. 2010, at 17:53, Alan Schmitt wrote:

> On 28 juil. 2010, at 15:21, Benjamin C. Pierce wrote:
> 
>>> Should we try then to fix the GUI, or to change the tutorial?
>> 
>> Seems like fixing the GUI is the right thing to do, and probably pretty easy (for someone that knows their way around that code a little)...
> 
> So I identified what needs to be done to fix this, but I'm not comfortable around the Objective C link to OCaml code to actually do it.
> 
> The problem: when roots are given on the command line, the profile chooser is still opened.
> The reason: when the command line is parsed, the roots encountered are stored by a call to "Globals.setRawRoots" (in uimacbridgenew.ml, unisonInit0). If there is a profile, it is checked whether it exists then it is returned. The Objective C code only tests whether a profile is returned, and opens the profile chooser otherwise.
> The solution: check whether roots were set.
> 
> Now I don't know how to access Globals.rawRoots in Objective C (and match whether it's the empty list).
> 
> Alternatively, I could create a function on the ml side that does the check and returns a boolean. It's probably simpler, but I need to understand how to add these callbacks.

I finally went that root, and it's working. I've only made the change in uimacnew09 for the moment. I'd like other people to give their opinion on the changes before putting it in other uis.

Alan


More information about the Unison-hackers mailing list