Page MenuHome

Simple confirm dialog when loading new file
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 24 2019, 2:38 PM.

Details

Summary

This is for T61599.

I also had to make the "New" operator a submenu in the
File Context Menu, so that you can still select the template.

The main issue currently is, that this does not work when
an already existing file is loaded.

The problem is, that we don't really support multi-step UI
interaction in a single operator. For example, we can't show
a confirm dialog first, and then a file browser.
Using the invoke method, only one indirection can be achieved.

This might become even more important, when we want to solve T61553 nicely.

I can think of two ways to solve the two-step-interaction for now:

  • Define a wrapper operator for the existing operator, that adds one user interaction step.
  • Use some state variable in the operator, so that it can call itself in the "next state".

Which one is better? Or should I use a completely different approach?
In general I'm not sure, how to forward all the parameters to the next
operator call in a nice way. I can just copy them one by one of course.

In any case, this patch already solves a big problem, so I think
it can be merged now. It can easily be replaced later on.

Diff Detail

Repository
rB Blender

Event Timeline

This is more a question of implementation rather than the UI.

Obviously ideally it would ‘just work’, and guide the user through the multi-step process of saving files correctly, before starting a new Blender file.

It would be good to have both the options to "Save and Continue" and "Discard Changes and Continue". I think this can already go in though.

As for multi-step user interaction, this is indeed not well supported by the operator system. Keeping all logic in a single operator seems most convenient, especially if you have more than two steps. The exact design for that I'm not sure about. I guess modal() should somehow be able to create a menu or call an operator, and receive some event when the user has finished interacting with it.

This revision is now accepted and ready to land.Apr 24 2019, 3:18 PM
This revision was automatically updated to reflect the committed changes.