On Tuesday 06 March 2001 15:35, John Levon wrote:
> On Tue, 6 Mar 2001, Angus Leeming wrote:
>
> > Note though that LyXFunc still launches the fileDialog explicitly,
> > rather than by emitting a signal in one "case" statement and
> > receiving the result in another. Is this to stay as it is, or should
> > it be slated for change too? Me, I'd vote to change to signals,
> > so that the kernel really has NO idea about the frontend's existence.
> Maybe it would be nicer like this (essentially just splitting MENUNEW
> into two different lyxfuncs, one for given filename, one for not). Or do you
> mean something else ?
I'm not absolutely sure what I mean! (Because I haven't tried to encode any
of this.) However, it strikes me that we could use exactly the same mechanism
here as is used by the Insets.
(I'll use my new controller/view terminology here because I like it ;-) I
think it also makes my meaning clearer.)
Here's a brief desciption of ehat the insets do, (mainly for my own benefit).
----------------
Use the menu and LyXFunc::Dispatch() emits a CREATE_INSET signal.
Click on an existing inset, and a SHOW_INSET signal is emitted.
In both cases, the signals are connected to a InsetController which sets up
the data needed by the View and calls View.show(). The View then gets hold of
the information made available to it by the Controller and eventually returns
it to the Controller.
The Controller then calls LyXFunc::Dispatch() with the appropiate kb_action
and the information.
-----------------
In this case, each inset controller has one View only. However, I'm picturing
a very similar scheme for the FileDialogs, but here a single FileDialog
Controller would control multiple Views, one for each NEW_FILE, OPEN_FILE etc
signal emitted by the kernel. Or then again, maybe not; maybe the Controller
should have only one View and freeze other input until the popup is closed.
The main point, however, is that a single FileDialog controller would take
care of all the hard stuff leaving the GUI-specific FileDialog view to do as
little as possible.
> I just went for minimal sensible change at first.
Sure.