'Convert the abc.conf, user_download_choice.pickle, gui_settings and recent download history files
to triblerd.conf.'

def convert_main_config(self):

    new_config = self.session.config
    udcfilename = os.path.join(self.session.config.get_state_dir(), 'user_download_choice.pickle')
    if os.path.exists(udcfilename):
        with open(udcfilename, 'r') as udc_file:
            choices = cPickle.Unpickler(udc_file).load()
            choices = dict([(k.encode('hex'), v) for (k, v) in choices['download_state'].iteritems()])
            new_config.config['user_download_states'] = choices
            new_config.write()
        os.remove(udcfilename)
