Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_info/space_info.c')
-rw-r--r--source/blender/editors/space_info/space_info.c44
1 files changed, 38 insertions, 6 deletions
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 6c172c13138..b47c8e8d189 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -37,9 +37,8 @@
#include "BLI_rand.h"
#include "BKE_context.h"
-#include "BKE_colortools.h"
+#include "BKE_global.h"
#include "BKE_screen.h"
-#include "BKE_utildefines.h"
#include "ED_screen.h"
@@ -49,6 +48,7 @@
#include "WM_types.h"
#include "UI_resources.h"
+#include "UI_interface.h"
#include "info_intern.h" // own include
@@ -111,11 +111,9 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
static void info_main_area_draw(const bContext *C, ARegion *ar)
{
- float col[3];
/* clear and setup matrix */
- UI_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
+ UI_ThemeClearColor(TH_BACK);
glClear(GL_COLOR_BUFFER_BIT);
}
@@ -127,11 +125,15 @@ void info_operatortypes(void)
WM_operatortype_append(FILE_OT_make_paths_absolute);
WM_operatortype_append(FILE_OT_report_missing_files);
WM_operatortype_append(FILE_OT_find_missing_files);
+
+ WM_operatortype_append(INFO_OT_reports_display_update);
}
void info_keymap(struct wmKeyConfig *keyconf)
{
+ wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0);
+ WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMER, KM_ANY, KM_ANY, 0);
}
/* add handlers, stuff you only do once or on area/region changes */
@@ -158,6 +160,10 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn)
if(ELEM(wmn->data, ND_SCREENCAST, ND_ANIMPLAY))
ED_region_tag_redraw(ar);
break;
+ case NC_WM:
+ if(wmn->data == ND_JOB)
+ ED_region_tag_redraw(ar);
+ break;
case NC_SCENE:
if(wmn->data==ND_RENDER_RESULT)
ED_region_tag_redraw(ar);
@@ -173,6 +179,31 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn)
}
+static void recent_files_menu(const bContext *C, Menu *menu)
+{
+ struct RecentFile *recent;
+ uiLayout *layout= menu->layout;
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
+ if (G.recent_files.first) {
+ for(recent = G.recent_files.first; (recent); recent = recent->next) {
+ uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
+ }
+ } else {
+ uiItemL(layout, "No Recent Files", 0);
+ }
+}
+
+void recent_files_menu_register()
+{
+ MenuType *mt;
+
+ mt= MEM_callocN(sizeof(MenuType), "spacetype info menu recent files");
+ strcpy(mt->idname, "INFO_MT_file_open_recent");
+ strcpy(mt->label, "Open Recent...");
+ mt->draw= recent_files_menu;
+ WM_menutype_add(mt);
+}
+
/* only called once, from space/spacetypes.c */
void ED_spacetype_info(void)
{
@@ -211,7 +242,8 @@ void ED_spacetype_info(void)
BLI_addhead(&st->regiontypes, art);
-
+ recent_files_menu_register();
+
BKE_spacetype_register(st);
}