mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-04 21:04:18 +01:00
menu: New macro #usergnusteppath# for user GNUstep directory
This macro is used when handling directories with OPEN_MENU, e.g., to list available image files for setting the workspace background. When parsing a menu file, we replace any instances of #usergnusteppath# with either GNUSTEP_USER_ROOT or ~/GNUstep if the former is not set. In this way, authors of menu files do not have to worry about whether users will have this variable set or not. We also document this feature in WindowMaker/menu.in, which generates the default English language old-style menu and currently contains the existing documentation for the Window Maker menu system.
This commit is contained in:
committed by
Carlos R. Mafra
parent
bfda22ef1a
commit
5f2dac318c
@@ -74,6 +74,11 @@
|
||||
* -noext strip whatever is after the last dot in the
|
||||
* file name
|
||||
*
|
||||
* // Use #usergnusteppath# as a placeholder for the path to the user
|
||||
* // GNUstep directory. Window Maker will replace this with the value
|
||||
* // of GNUSTEP_USER_ROOT, if this environment variable is set, or
|
||||
* // "~/GNUstep" otherwise
|
||||
*
|
||||
* <Parameters> is the program to execute.
|
||||
*
|
||||
* ** Options for command line in EXEC:
|
||||
|
||||
@@ -673,6 +673,11 @@ static void constructMenu(WMenu * menu, WMenuEntry * entry)
|
||||
}
|
||||
|
||||
tmp = wexpandpath(path[i]);
|
||||
|
||||
if (strstr(tmp, "#usergnusteppath#") == tmp)
|
||||
tmp = wstrconcat(wusergnusteppath(),
|
||||
tmp + 17);
|
||||
|
||||
wfree(path[i]);
|
||||
lpath = getLocalizedMenuFile(tmp);
|
||||
if (lpath) {
|
||||
|
||||
Reference in New Issue
Block a user