== bugfix ==
[#10312] Append Link (image browser) bug if combined with Open window The only place where the special handling in newspace is relevenant is when opening it with the windowtype_pupmenu. All other overlaying windows( render in image space, scriptspace) should leave imagebrowser/filebrowser space alone.
This commit is contained in:
@@ -34,6 +34,7 @@ struct ScrArea;
|
||||
struct ID;
|
||||
|
||||
void free_imasel(struct SpaceImaSel *simasel);
|
||||
void reset_imaselspace(struct ScrArea *sa);
|
||||
|
||||
void clever_numbuts_imasel(void);
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ void activate_databrowse(struct ID *id, int idcode, int fromcode, int retval, sh
|
||||
void activate_databrowse_args(struct ID *id, int idcode, int fromcode, short *menup, void (*func)(char *, void *, void *), void *arg1, void *arg2);
|
||||
|
||||
void filesel_prevspace(void);
|
||||
void reset_filespace(struct ScrArea *sa);
|
||||
void free_filesel_spec(char *dir);
|
||||
void winqreadfilespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
||||
void main_to_filelist(struct SpaceFile *sfile);
|
||||
|
||||
@@ -1299,6 +1299,27 @@ void activate_databrowse_args(struct ID *id, int idcode, int fromcode, short *me
|
||||
sfile->ipotype= fromcode;
|
||||
}
|
||||
|
||||
/* resets a previous file space type */
|
||||
/* is used when opening a filebrowser directly from windowtype_pupmenu,
|
||||
since in that case we don't want any load/save/append/link action
|
||||
*/
|
||||
void reset_filespace(ScrArea *sa)
|
||||
{
|
||||
if (sa->spacetype == SPACE_FILE) {
|
||||
SpaceFile *sfile= sa->spacedata.first;
|
||||
|
||||
if(sfile->type==FILE_MAIN) {
|
||||
freefilelist(sfile);
|
||||
} else {
|
||||
sfile->type= FILE_UNIX;
|
||||
}
|
||||
|
||||
sfile->returnfunc= NULL;
|
||||
sfile->title[0]= 0;
|
||||
if(sfile->filelist) test_flags_file(sfile);
|
||||
}
|
||||
}
|
||||
|
||||
void filesel_prevspace()
|
||||
{
|
||||
SpaceFile *sfile= curarea->spacedata.first;
|
||||
|
||||
@@ -1434,6 +1434,8 @@ void do_global_buttons(unsigned short event)
|
||||
break;
|
||||
case B_NEWSPACE:
|
||||
newspace(curarea, curarea->butspacetype);
|
||||
reset_filespace(curarea);
|
||||
reset_imaselspace(curarea);
|
||||
break;
|
||||
case B_LOADTEMP: /* is button from space.c */
|
||||
BIF_read_autosavefile();
|
||||
|
||||
@@ -80,3 +80,26 @@ void free_imasel(SpaceImaSel *simasel)
|
||||
}
|
||||
}
|
||||
|
||||
/* resets a previous imagebrowser space type */
|
||||
/* is used when opening an imagebrowser directly from windowtype_pupmenu,
|
||||
since in that case we don't want any load/save/append/link action
|
||||
*/
|
||||
void reset_imaselspace(ScrArea *sa)
|
||||
{
|
||||
if(sa->spacetype==SPACE_IMASEL) {
|
||||
SpaceImaSel *simasel= sa->spacedata.first;
|
||||
if(simasel->type==FILE_MAIN) {
|
||||
if (simasel->files) {
|
||||
BIF_filelist_free(simasel->files);
|
||||
BIF_filelist_settype(simasel->files, FILE_MAIN);
|
||||
}
|
||||
} else {
|
||||
if (simasel->files) {
|
||||
simasel->type= FILE_UNIX;
|
||||
BIF_filelist_settype(simasel->files, simasel->type);
|
||||
}
|
||||
}
|
||||
simasel->returnfunc= NULL;
|
||||
simasel->title[0]= 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5611,6 +5611,7 @@ static void init_imaselspace(ScrArea *sa)
|
||||
simasel->files = BIF_filelist_new();
|
||||
}
|
||||
|
||||
|
||||
/* ******************** SPACE: OOPS ********************** */
|
||||
|
||||
extern void drawoopsspace(ScrArea *sa, void *spacedata);
|
||||
@@ -6155,39 +6156,7 @@ void newspace(ScrArea *sa, int type)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* exception: filespace */
|
||||
if(sa->spacetype==SPACE_FILE) {
|
||||
SpaceFile *sfile= sa->spacedata.first;
|
||||
|
||||
if(sfile->type==FILE_MAIN) {
|
||||
freefilelist(sfile);
|
||||
} else {
|
||||
sfile->type= FILE_UNIX;
|
||||
}
|
||||
|
||||
sfile->returnfunc= NULL;
|
||||
sfile->title[0]= 0;
|
||||
if(sfile->filelist) test_flags_file(sfile);
|
||||
}
|
||||
/* exception: imasel space */
|
||||
else if(sa->spacetype==SPACE_IMASEL) {
|
||||
SpaceImaSel *simasel= sa->spacedata.first;
|
||||
if(simasel->type==FILE_MAIN) {
|
||||
if (simasel->files) {
|
||||
BIF_filelist_free(simasel->files);
|
||||
BIF_filelist_settype(simasel->files, FILE_MAIN);
|
||||
}
|
||||
} else {
|
||||
if (simasel->files) {
|
||||
simasel->type= FILE_UNIX;
|
||||
BIF_filelist_settype(simasel->files, simasel->type);
|
||||
}
|
||||
}
|
||||
simasel->returnfunc= NULL;
|
||||
simasel->title[0]= 0;
|
||||
}
|
||||
else if(sa->spacetype==SPACE_OOPS) {
|
||||
if(sa->spacetype==SPACE_OOPS) {
|
||||
SpaceOops *so= sa->spacedata.first;
|
||||
if(xtra && so->type!=SO_OUTLINER) {
|
||||
so->type= SO_OUTLINER;
|
||||
|
||||
Reference in New Issue
Block a user