diff options
author | Rob Haarsma <phaseIV@zonnet.nl> | 2003-12-08 16:08:24 +0300 |
---|---|---|
committer | Rob Haarsma <phaseIV@zonnet.nl> | 2003-12-08 16:08:24 +0300 |
commit | b4192ad94bad0aed066a933e0a1a9568d9c677f8 (patch) | |
tree | acb23cadbdc03f46bb8b8a675d84c2567d58d4ae /source | |
parent | d57df6373ea750e58ef08a67c707ee07d3d65fd4 (diff) |
Prints current blend filename in windowheader.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/include/BIF_space.h | 1 | ||||
-rw-r--r-- | source/blender/src/editscreen.c | 17 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 6 |
3 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index 924e1a0274b..fdc3d2da80e 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -109,6 +109,7 @@ extern void group_menu(void); extern void mainwindow_toggle_fullscreen(int fullscreen); #endif +extern void mainwindow_set_title(char *title); extern void mainwindow_raise(void); extern void mainwindow_make_active(void); extern void mainwindow_close(void); diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 6521713c75b..0c9469d9282 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -1160,14 +1160,31 @@ void mainwindow_toggle_fullscreen(int fullscreen){ void mainwindow_raise(void) { window_raise(mainwin); } + void mainwindow_make_active(void) { window_make_active(mainwin); } + void mainwindow_close(void) { window_destroy(mainwin); mainwin= NULL; } +void mainwindow_set_filename_to_title(char *filename) { + char str[FILE_MAXDIR + FILE_MAXFILE]; + char dir[FILE_MAXDIR]; + char file[FILE_MAXFILE]; + + BLI_split_dirfile(filename, dir, file); + + if(BLI_streq(file, ".B.blend") || filename[0] =='\0') + sprintf(str, "Blender"); + else + sprintf(str, "Blender [%s]", filename); + + window_set_title(mainwin, str); +} + /* ********* AREAS ************* */ void setprefsize(int stax, int stay, int sizx, int sizy) diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index bf941b6e715..80997e24887 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -135,6 +135,8 @@ void BIF_read_file(char *name) BKE_read_file(name, NULL); } + mainwindow_set_filename_to_title(G.main->name); + sound_initialize_sounds(); winqueue_break= 1; /* leave queues everywhere */ @@ -392,7 +394,9 @@ void BIF_write_file(char *target) if (BLO_write_file(di, G.fileflags, &err)) { strcpy(G.sce, di); - strcpy(G.main->name, di); /* is guarenteed current file */ + strcpy(G.main->name, di); /* is guaranteed current file */ + + mainwindow_set_filename_to_title(G.main->name); G.save_over = 1; |