Example #1
0
bool GuiPackageResolver(const String& error, const String& path, int line)
{
prompt:
	switch(Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(),
	              error + "&while parsing package " + DeQtf(path),
		          "Edit \\& Retry", "Ignore",  "Stop")) {
	case 0:
		if(!PromptYesNo("Ignoring will damage package. Everything past the "
			            "point of error will be lost.&Do you want to continue ?"))
			goto prompt;
		return false;
	case 1: {
			TopWindow win;
			LineEdit edit;
			edit.Set(LoadFile(path));
			edit.SetCursor(edit.GetPos(line));
			win.Title(path);
			win.Add(edit.SizePos());
			win.Run();
			SaveFile(path, edit.Get());
		}
		return true;;
	case -1:
		exit(1);
	}
	return false;
}