res:dock:: fix preview problem.

the preview is not closed on global menu is triggered.
res:dock:: fix setting problem.

reason:
backend is changed to use enum instead of string, frontend is not changed.
res/app:dock:: exit on connecting to backend failed.