Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 30 Nov 2018 02:24:17 +0000 (13:24 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 30 Nov 2018 02:24:17 +0000 (13:24 +1100)
1  2 
source/blender/windowmanager/intern/wm_files.c

@@@ -984,12 -908,19 +984,10 @@@ void wm_homefile_read
  
        bmain->name[0] = '\0';
  
 -      if (use_userdef) {
 -              /* When loading factory settings, the reset solid OpenGL lights need to be applied. */
 -              if (!G.background) {
 -                      GPU_default_lights();
 -              }
 -      }
 -
        /* start with save preference untitled.blend */
        G.save_over = 0;
 -      /* disable auto-play in startup.blend... */
 -      G.fileflags &= ~G_FILE_AUTOPLAY;
  
 -      wm_file_read_post(C, true, use_userdef);
 +      wm_file_read_post(C, true, reset_app_template);
-       return true;
  }
  
  /** \name WM History File API
@@@ -1743,33 -1670,13 +1741,29 @@@ static int wm_homefile_read_exec(bConte
                app_template = WM_init_state_app_template_get();
        }
  
-       if (wm_homefile_read(C, op->reports, use_factory_settings, use_empty_data, use_userdef, filepath, app_template)) {
-               if (use_splash) {
-                       WM_init_splash(C);
-               }
-               return OPERATOR_FINISHED;
-       }
-       else {
-               return OPERATOR_CANCELLED;
+       wm_homefile_read(C, op->reports, use_factory_settings, use_empty_data, use_userdef, filepath, app_template);
+       if (use_splash) {
+               WM_init_splash(C);
        }
+       return OPERATOR_FINISHED;
  }
  
 +static int wm_homefile_read_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
 +{
 +      /* Draw menu which includes default startup and application templates. */
 +      uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("New File"), ICON_FILE_NEW);
 +      uiLayout *layout = UI_popup_menu_layout(pup);
 +
 +      MenuType *mt = WM_menutype_find("TOPBAR_MT_file_new", false);
 +      if (mt) {
 +              UI_menutype_draw(C, mt, layout);
 +      }
 +
 +      UI_popup_menu_end(C, pup);
 +
 +      return OPERATOR_INTERFACE;
 +}
 +
  void WM_OT_read_homefile(wmOperatorType *ot)
  {
        PropertyRNA *prop;