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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2007-03-18 06:30:24 +0300
committerJoshua Leung <aligorith@gmail.com>2007-03-18 06:30:24 +0300
commit41aac13d9eb1c39f34b2b8471f349471ee2f0f5b (patch)
treee2eb17b843a30a24d58f178fbf16147292c2789d /source
parent6b4f197983c013707e23a69628f26dcb0b2b9c5a (diff)
== Recently-Opened Files List (Patch #5708) ==
In the past, this was limited to only having 10 items. Now you can set the number of recently opened files that are remembered (ranging from 0 to 30 items). Setting for this can be found under 'Auto-Save' in the Info window.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/src/header_info.c2
-rw-r--r--source/blender/src/space.c5
-rw-r--r--source/blender/src/toets.c2
-rw-r--r--source/blender/src/usiblender.c8
5 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index b83568def5d..d486f8eae5f 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -178,7 +178,7 @@ typedef struct UserDef {
short rvibright; /* rotating view icon brightness */
char versemaster[160];
char verseuser[160];
- short pad;
+ short recent_files; /* maximum number of recently used files to remember */
} UserDef;
extern UserDef U; /* from usiblender.c !!!! */
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c
index ed4d2a546b4..b948dbc921c 100644
--- a/source/blender/src/header_info.c
+++ b/source/blender/src/header_info.c
@@ -924,7 +924,7 @@ static uiBlock *info_openrecentmenu(void *arg_unused)
menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
}
- for (recent = G.recent_files.first, i=0; i<10 && recent; recent = recent->next, i++) {
+ for (recent = G.recent_files.first, i=0; i<U.recent_files && recent; recent = recent->next, i++) {
if (strcmp(recent->filename, G.sce)!=0) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, recent->filename, 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, i+1, "");
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 710c7b55bc2..38d2cbb3dd2 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -3515,6 +3515,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
0, 0, 0, 0, 0,"Open the most recently saved temporary file");
}
+ uiDefButS(block, NUM, B_DRAWINFO, "Recent Files:",
+ (xpos+edgsp+(2*mpref)+(3*midsp)),y3,(mpref),buth,
+ &U.recent_files, 0, 30, 0, 0,
+ "Maximum number of recently opened files to remember");
+
} else if (U.userpref == 4) { /* system & opengl */
uiDefBut(block, LABEL,0,"Solid OpenGL lights:",
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index dbbe97fbe20..04b21d32203 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -377,7 +377,7 @@ char *recent_filelist(void)
ofs = 1;
} else ofs = 0;
- for (recent = G.recent_files.first, i=0; (i<10) && (recent); recent = recent->next, i++) {
+ for (recent = G.recent_files.first, i=0; (i<U.recent_files) && (recent); recent = recent->next, i++) {
if (strcmp(recent->filename, G.sce)) {
p+= sprintf(p, "|%s %%x%d", recent->filename, i+ofs+1);
}
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index 140e97d4028..b81cba7d1d0 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -353,6 +353,10 @@ static void init_userdef_file(void)
}
}
}
+ if (G.main->versionfile <= 243) {
+ /* set default number of recently-used files (if not set) */
+ if (U.recent_files == 0) U.recent_files = 10;
+ }
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
@@ -567,7 +571,7 @@ static void readBlog(void)
G.recent_files.first = G.recent_files.last = NULL;
/* read list of recent opend files from .Blog to memory */
- for (l= lines, num= 0; l && (num<10); l= l->next, num++) {
+ for (l= lines, num= 0; l && (num<U.recent_files); l= l->next, num++) {
line = l->link;
if (!BLI_streq(line, "")) {
if (num==0)
@@ -666,7 +670,7 @@ static void writeBlog(void)
recent = recent->next;
i=1;
/* write rest of recent opened files to .Blog */
- while((i<10) && (recent)){
+ while((i<U.recent_files) && (recent)){
/* this prevents to have duplicities in list */
if (strcmp(recent->filename, G.sce)!=0) {
fprintf(fp, "%s\n", recent->filename);