On 13/08/2009 23:53, Vincent van Ravesteijn wrote:
Abdelrazak Younes schreef:
On 13/08/2009 21:20, Vincent van Ravesteijn wrote:
Vincent van Ravesteijn schreef:
This patch moves the LayoutBox * member from GuiToolbar to GuiView.

As a result, the LayoutDialog will also be shown when the user requests it. Previously it was only shown if the toolbar was visible, or has been visible before.

Objections ?

Vincent
Never mind, it doesn't seem to work.

As I said in my last commit message, we need a LayoutModel class. The LayoutBox combo can of course be reused but it's difficult to see where you are going to make it appear without a toolbar. But with a LayoutModel, you can reuse that for pretty much anything: tol-level menu, context menu, dockwidget, or a stand-alone toolbar 'a la' GuiCommandBuffer via a toolbar.

Abdel.

Now it works!..

Yes, it's a bit random I guess where it will be placed, but the popup-box also appeared when the toolbar was not there before, so... it seem to work. I had to repair a little thing that was creeped in during the refactoring, but now it doesn't crash anymore.

I'm sorry, I've no knowledge about Model-classes.. :S

That's not so complicated. Take the TocModels for example, GuiView::tocModels() offers the model and it's up to the dialog to present the data offered by the model in any way it wants. In this case, instead of having GuiView::layoutBox(), we would have GuiView::layoutModel(). Your patch is thus going into the right direction but GuiView should not care about the way the layout list is shown (or even how many times it is shown in multiple dialogs). Your patch motivated me to do some model/view separation, give me 10 more minutes to see if I can achieve something. If not, no objection to your patch.

Abdel.

Reply via email to