Added dialog for unapplied sorting on quit.

Closes #277.