1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-08 23:04:15 +01:00

WPrefs: Display warning when attempting to modify a read-only menu file.

This commit is contained in:
Doug Torrance
2017-08-19 10:48:42 -04:00
committed by Carlos R. Mafra
parent b68a1994c2
commit 97702618de

View File

@@ -1484,6 +1484,7 @@ static void showData(_Panel * panel)
{
const char *gspath;
char *menuPath;
char buf[1024];
WMPropList *pmenu;
gspath = wusergnusteppath();
@@ -1510,6 +1511,21 @@ static void showData(_Panel * panel)
if (!path)
break;
if (access(path, W_OK) < 0) {
snprintf(buf, 1024,
_("The menu file \"%s\" referenced by "
"WMRootMenu is read-only.\n"
"You cannot use WPrefs to modify it."),
path);
WMRunAlertPanel(WMWidgetScreen(panel->parent),
panel->parent,
_("Warning"), buf,
_("OK"), NULL, NULL);
panel->dontSave = True;
wfree(path);
return;
}
pmenu = WMReadPropListFromFile(path);
wfree(path);
}