diff options
author | pfaedit <pfaedit> | 2009-09-13 04:06:24 +0000 |
---|---|---|
committer | pfaedit <pfaedit> | 2009-09-13 04:06:24 +0000 |
commit | 5c9d9a086985977f9067cd8d8a274e1dfbe88dd0 (patch) | |
tree | aeac1f6d69c7fba2b727dc693510e81bf08ee212 /gdraw | |
parent | 42744c0abf748700ee84c21eba6dbceeddeeb422 (diff) |
Preserve the ImagePath resource string.
Diffstat (limited to 'gdraw')
-rw-r--r-- | gdraw/ggadgets.c | 2 | ||||
-rw-r--r-- | gdraw/gresedit.c | 12 | ||||
-rw-r--r-- | gdraw/gtextinfo.c | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/gdraw/ggadgets.c b/gdraw/ggadgets.c index 32eef2d5..6573491e 100644 --- a/gdraw/ggadgets.c +++ b/gdraw/ggadgets.c @@ -56,6 +56,7 @@ static int _GGadget_LeftMargin = 6; static int _GGadget_LineSkip = 3; int _GGadget_Skip = 6; int _GGadget_TextImageSkip = 4; +char *_GGadget_ImagePath = NULL; static int _ggadget_inited=0; extern void GGadgetInit(void); static Color popup_foreground=0, popup_background=COLOR_CREATE(0xff,0xff,0xc0); @@ -64,6 +65,7 @@ static int popup_delay=1000, popup_lifetime=20000; static GResInfo popup_ri; static struct resed ggadget_re[] = { {N_("Text Image Skip"), "TextImageSkip", rt_int, &_GGadget_TextImageSkip, N_("Space (in points) left between images and text in labels, buttons, menu items, etc. which have both")}, + {N_("Image Path"), "ImagePath", rt_stringlong, &_GGadget_ImagePath, N_("List of directories to search for images, separated by colons")}, NULL }; GResInfo ggadget_ri = { diff --git a/gdraw/gresedit.c b/gdraw/gresedit.c index 0d4d61c7..98462aba 100644 --- a/gdraw/gresedit.c +++ b/gdraw/gresedit.c @@ -2378,6 +2378,8 @@ return( true ); void GResEdit(GResInfo *additional,const char *def_res_file,void (*change_res_filename)(const char *)) { GResInfo *re_end; static int initted = false; + char *oldimagepath; + extern char *_GGadget_ImagePath; if ( !initted ) { initted = true; @@ -2423,7 +2425,17 @@ void GResEdit(GResInfo *additional,const char *def_res_file,void (*change_res_fi additional = &gdraw_ri; re_end = NULL; } + oldimagepath = copy( _GGadget_ImagePath ); GResEditDlg(additional,def_res_file,change_res_filename); + if (( oldimagepath!=NULL && _GGadget_ImagePath==NULL ) || + ( oldimagepath==NULL && _GGadget_ImagePath!=NULL ) || + ( oldimagepath!=NULL && _GGadget_ImagePath!=NULL && + strcmp(oldimagepath,_GGadget_ImagePath)!=0 )) { + char *new = _GGadget_ImagePath; + _GGadget_ImagePath = oldimagepath; + GGadgetSetImagePath(new); + } else + free( oldimagepath ); if ( re_end!=NULL ) re_end->next = NULL; diff --git a/gdraw/gtextinfo.c b/gdraw/gtextinfo.c index 2f8820fe..4847e99f 100644 --- a/gdraw/gtextinfo.c +++ b/gdraw/gtextinfo.c @@ -412,9 +412,11 @@ return( copyn(start,len)); void GGadgetSetImagePath(char *path) { int cnt, k; char *pt, *end; + extern char *_GGadget_ImagePath; if ( path==NULL ) return; + free( _GGadget_ImagePath ); if ( imagepath!=NULL ) { for ( k=0; imagepath[k]!=NULL; ++k ) @@ -432,6 +434,7 @@ return; if ( strlen(imagepath[cnt]) > imagepathlenmax ) imagepathlenmax = strlen(imagepath[cnt]); ImageCacheReload(); + _GGadget_ImagePath = copy(path); } static GImage *_GGadgetImageCache(char *filename, char **foundname) { |