Re: Desperate for bindings help! Can ya spare a few minutes?
Re: Desperate for bindings help! Can ya spare a few minutes?
- Subject: Re: Desperate for bindings help! Can ya spare a few minutes?
- From: Steven Palm <email@hidden>
- Date: Tue, 14 Dec 2004 15:00:23 -0600
On Dec 14, 2004, at 12:19 AM, Steven Palm wrote:
Project archive is at:
http://n9yty.dyndns.org/openvpn_gui.zip
P.S. If you download this, please let me know, and ANY COMMENTS are
welcome, I'm always anxious to learn how to do things better rather
than making it "just work".
My mistake in not thinking through the packaging... It would have been
almost impossible to test this without an OpenVPN connection so I've
now included a stub program "openvpn" (with source so you know it's not
malicious) that pretends like it is making the remote connection, and
feeds the status back to the GUI. It exhibits the same problems as the
real openvpn binary, so it's a great standalone test case.
Fire up the program, import a PEM cert file in via File->Manage
Certifiates. It doesn't really matter what they are, any old certs
will do.
Create a dummy configuration, no parameters really matter except for
the fact that if you don't pick a certificate you imported in step one
via the certificates tab on the config editor, I think it raises an
exception when you try to make the connection... to be fixed later...
:-)
For testing, create a second config, doesn't matter at all what is in
here.
Click on the first config and hit the "Start VPN" button. The program
will make a fake connection, and you should see the red X change to
yellow and a few status messages appear and finally the yellow X
changes to a green checkmark. This is problem one... I'm currently
using an NSNotification posted by my config object to the AppController
object to update this. If I used bindings to bind the NSTextField
directly to the keyPath tunState of the Config object it wouldn't
update until the tunnel closed (NSTask ended).
Now, to see major problem two, either kill the openvpn program in the
Terminal window, or put your computer to sleep or change network
configurations. All of these are cases where the GUI should reset
itself... The data models do inasmuch as the green checkmark goes back
to a red X and internally the model knows that the connection is not
active, but the GUI for the buttons doesn't update problem (keyPath
active in the Config object controls the state of
StartVPN/StopVPN/Edit/Remove).
In this state, if you switch configs in the main GUI window and go
back to the first one you will see that this causes the bindings system
to get the right values and everything updates as it should.
Why don't the bindings work when the NSTask is running and/or when it
terminates?
Steve
Updated project at:
http://n9yty.dyndns.org/openvpn_gui.zip
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden