My changes leave all tray icon and menu creation/initialization logic untouched. It only shows or hides the icon according to the setting.
A new checkbox was added to the OptionsDialog under the Window tab. A bool option named "disableTray" was added to OptionsModel. This checkbox was mapped like other all options to the OptionsModel.
A signal was added to the OptionsModel for broadcasting changes the the disableTray option. This signal was connected to a new slot added to BitcoinGUI named updateDisableTray(bool). The slot simply hides or shows the trayIcon in BitcoinGUI according to the parameter recieved.
The negative wording of "disableTray" instead of a positive wording ("enableTray") because enabled is the default. Perhaps "hideTray" would be better than disable.
This pull request intends to resolve this issue: #7160