Preselect the categories of selected preset mode in 'Edit Categories' mode

Clicking on 'Edit Categories' button in any preset mode opens the manual
selection dialog though we are still present in preset selection mode.

Correct behavior should be to open manual selection dialog *preselecting*
only those categories which are included in the current selected preset
mode. Any change in the preset mode categories should move us to manual
selection mode.

BUG=682
Merge pull request #687 from kphanee/fixup_edit_categories

Preselect categories of selected preset mode in 'Edit Categories' mode