| 106 | # Define action on exit. |
| 107 | |
| 108 | def do_exit(event): |
| 109 | ## all = media.find_all() |
| 110 | ## options = [media.config()['background'][-1]] |
| 111 | ## for item in all: |
| 112 | ## options.append([reference[item].file, media.coords(item)]) |
| 113 | ## if hasattr(reference[item], 'shortcut'): |
| 114 | ## options[-1].append(reference[item].shortcut) |
| 115 | ## cPickle.dump(options, file('shell.ini', 'wb'), -1) |
| 116 | ## event.widget.quit() |
| 117 | software = Key(key=HKEY.CURRENT_USER, sub_key='Software') |
| 118 | if 'Atlantis Zero' not in software.keys: |
| 119 | software.keys = 'Atlantis Zero' |
| 120 | az = Key(key=software, sub_key='Atlantis Zero') |
| 121 | if 'Demo Shell' not in az.keys: |
| 122 | az.keys = 'Demo Shell' |
| 123 | ds = Key(key=az, sub_key='Demo Shell') |
| 124 | if 'winreg' not in ds.keys: |
| 125 | ds.keys = 'winreg' |
| 126 | winreg = Key(key=ds, sub_key='winreg', sam=KEY.ALL_ACCESS) |
| 127 | del winreg.values |
| 128 | winreg.values['background'] = REG_BINARY(media.config()['background'][-1]) |
| 129 | for index, item in enumerate(media.find_all()): |
| 130 | temp = [reference[item].file, media.coords(item)] |
| 131 | if hasattr(reference[item], 'shortcut'): |
| 132 | temp.append(reference[item].shortcut) |
| 133 | winreg.values['IMAGE_%s' % (index + 1)] = REG_BINARY(cPickle.dumps(temp, -1)) |
| 134 | event.widget.quit() |
| 135 | |
| 136 | # Start setting up the GUI. |
| 137 | |