'Generate the module configuration byte words by the selection from
function list on the main dialog.
:param mode: Operation mode for making hosts file. The valid value
could be one of `system`, `ansi`, and `utf-8`.
.. seealso:: Method
:meth:`~gui.qdialog_d.QDialogDaemon.make_hosts`.'

def set_config_bytes(self, mode):

    ip_flag = self._ipv_id
    selection = {}
    if (mode == 'system'):
        localhost_word = {'Windows': 1, 'Linux': 2, 'Unix': 2, 'OS    X': 4}[self.platform]
    else:
        localhost_word = 8
    selection[2] = localhost_word
    ch_parts = [8, (32 if ip_flag else 16), 64]
    if ((self.custom != None) and os.path.isfile(self.custom)):
        ch_parts.insert(0, 4)
    slices = self.slices[ip_flag]
    for (i, part) in enumerate(ch_parts):
        part_cfg = self._funcs[ip_flag][slices[i]:slices[(i + 1)]]
        part_word = 0
        for (i, cfg) in enumerate(part_cfg):
            part_word += (cfg << i)
        selection[part] = part_word
    self.make_cfg = selection
