Application Templates: make templates more prominent in the UI.

The goal here is to make app templates usable for default templates
that we can ship with Blender. These only have a custom startup.blend
currently and so are quite limited compared to app templates that fully
customize Blender.

But still it seems like the same kind of concept where we should be
sharing the code and UI. It is useful to be able to save a startup.blend
per template, and I can imagine some scripting being useful in the future
as well.

Changes made:

* File > New and Ctrl+N now list the templates, replacing a separate
  Application Templates menu that was not as easy to discover.
* File menu now shows name of active template above Save Startup File
  and Load Factory Settings to indicate these are saved/loaded per
  template.
* The "Default" template was renamed to "General".
* Workspaces can now be added from any of the template startup.blend
  files when clicking the (+) button in the topbar.

* User preferences are now fully shared between app templates, unless
  the template includes a custom userpref.blend. I think this will be
  useful in general, not all app templates need their own keymaps for
  example.
* Previously Save User Preferences would save the current app template
  and then Blender would start using that template by default. I've
  disabled this, to me it seems it was unintentional, or at least not
  clear at all that saving user preferences also makes the current

Differential Revision: https://developer.blender.org/D3690
This commit is contained in:
2018-08-28 15:12:14 +02:00
parent b08d9f036e
commit 84f21c170d
12 changed files with 264 additions and 124 deletions

View File

@@ -838,7 +838,7 @@ ID *UI_context_active_but_get_tab_ID(bContext *C)
static void template_ID_tabs(
bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag,
const char *newop, const char *UNUSED(openop), const char *menu)
const char *newop, const char *menu)
{
const ARegion *region = CTX_wm_region(C);
const PointerRNA active_ptr = RNA_property_pointer_get(&template->ptr, template->prop);
@@ -934,7 +934,7 @@ static void ui_template_id(
if (template_ui->idlb) {
if (use_tabs) {
uiLayoutRow(layout, true);
template_ID_tabs(C, layout, template_ui, type, flag, newop, openop, unlinkop);
template_ID_tabs(C, layout, template_ui, type, flag, newop, unlinkop);
}
else {
uiLayoutRow(layout, true);
@@ -996,13 +996,13 @@ void uiTemplateGpencilColorPreview(
void uiTemplateIDTabs(
uiLayout *layout, bContext *C,
PointerRNA *ptr, const char *propname,
const char *newop, const char *openop, const char *unlinkop,
const char *newop, const char *unlinkop,
int filter)
{
ui_template_id(
layout, C, ptr, propname,
newop, openop, unlinkop,
UI_ID_BROWSE | UI_ID_RENAME | UI_ID_DELETE,
newop, NULL, unlinkop,
UI_ID_BROWSE | UI_ID_RENAME,
0, 0, filter, true, 1.0f, false);
}