Prints current blend filename in windowheader.

This commit is contained in:
2003-12-08 13:08:24 +00:00
parent d57df6373e
commit b4192ad94b
3 changed files with 23 additions and 1 deletions

View File

@@ -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);

View File

@@ -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)

View File

@@ -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;