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:
authorTon Roosendaal <ton@blender.org>2009-02-13 16:33:01 +0300
committerTon Roosendaal <ton@blender.org>2009-02-13 16:33:01 +0300
commit1d5115c2512704afad35efd40082e63fda1863e8 (patch)
tree9067573e950630a0ee101abe74140cdc428e0145 /source/blender/windowmanager
parent4d0f30f4750cf2d000ecbd8a347e2e4da5474fc3 (diff)
2.5
feature restored: window title shows file name, if saved/loaded.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c7
-rw-r--r--source/blender/windowmanager/intern/wm_window.c26
-rw-r--r--source/blender/windowmanager/wm_window.h2
3 files changed, 25 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 484d97e7b71..d4501c88e15 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -93,6 +93,7 @@
#include "WM_api.h"
#include "WM_types.h"
#include "wm.h"
+#include "wm_window.h"
/***/
@@ -521,6 +522,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports)
wm_window_match_init(C, &wmbase);
retval= BKE_read_file(C, name, NULL, reports);
+ G.save_over = 1;
/* match the read WM with current WM */
wm_window_match_do(C, &wmbase);
@@ -865,10 +867,9 @@ void WM_write_file(bContext *C, char *target, ReportList *reports)
G.relbase_valid = 1;
strcpy(G.main->name, di); /* is guaranteed current file */
-// XXX mainwindow_set_filename_to_title(G.main->name);
-
G.save_over = 1;
-
+ wm_window_titles(CTX_wm_manager(C));
+
writeBlog();
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 67eb043b1cf..a6eba6df0e6 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "DNA_listBase.h"
#include "DNA_screen_types.h"
@@ -180,6 +181,21 @@ static void wm_window_close(bContext *C, wmWindow *win)
WM_exit(C);
}
+void wm_window_titles(wmWindowManager *wm)
+{
+ if(G.save_over) {
+ wmWindow *win;
+ char *str= MEM_mallocN(strlen(G.sce) + 16, "title");
+
+ sprintf(str, "Blender [%s]", G.sce);
+
+ for(win= wm->windows.first; win; win= win->next)
+ GHOST_SetTitle(win->ghostwin, str);
+
+ MEM_freeN(str);
+ }
+}
+
/* belongs to below */
static void wm_window_add_ghostwindow(wmWindowManager *wm, char *title, wmWindow *win)
{
@@ -267,15 +283,16 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
if(win->eventstate==NULL)
win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state");
-
/* add keymap handlers (1 handler for all keys in map!) */
keymap= WM_keymap_listbase(wm, "Window", 0, 0);
WM_event_add_keymap_handler(&win->handlers, keymap);
keymap= WM_keymap_listbase(wm, "Screen", 0, 0);
WM_event_add_keymap_handler(&win->handlers, keymap);
-
}
+
+ wm_window_titles(wm);
+
}
/* new window, no screen yet, but we open ghostwindow for it */
@@ -632,11 +649,6 @@ void WM_event_remove_window_timer(wmWindow *win, wmTimer *timer)
/* ************************************ */
-void wm_window_set_title(wmWindow *win, char *title)
-{
- GHOST_SetTitle(win->ghostwin, title);
-}
-
void wm_window_get_position(wmWindow *win, int *posx_r, int *posy_r)
{
*posx_r= win->posx;
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index 86ceac9203e..5db86989fd9 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -36,6 +36,8 @@ void wm_ghost_init (bContext *C);
wmWindow *wm_window_new (bContext *C);
void wm_window_free (bContext *C, wmWindow *win);
+
+void wm_window_titles (wmWindowManager *wm);
void wm_window_add_ghostwindows (wmWindowManager *wm);
void wm_window_process_events (const bContext *C);