Beispiel #1
0
    def set_regedit_keys(self):
        """Reset regedit keys according to config."""
        prefix = self.prefix_path
        prefix_manager = WinePrefixManager(prefix)
        # Those options are directly changed with the prefix manager and skip
        # any calls to regedit.
        managed_keys = {
            'ShowCrashDialog': prefix_manager.set_crash_dialogs,
            'UseXVidMode': prefix_manager.use_xvid_mode,
            'Desktop': prefix_manager.set_virtual_desktop,
            'WineDesktop': prefix_manager.set_desktop_size
        }

        for key, path in self.reg_keys.items():
            value = self.runner_config.get(key) or 'auto'
            if not value or value == 'auto' and key not in managed_keys.keys():
                prefix_manager.clear_registry_key(path)
            elif key in self.runner_config:
                if key in managed_keys.keys():
                    # Do not pass fallback 'auto' value to managed keys
                    if value == 'auto':
                        value = None
                    managed_keys[key](value)
                    continue
                prefix_manager.set_registry_key(path, key, value)
Beispiel #2
0
    def set_wine_desktop(self, enable_desktop=False):
        prefix = self.prefix_path
        prefix_manager = WinePrefixManager(prefix)
        path = self.reg_keys['Desktop']

        if enable_desktop:
            prefix_manager.set_registry_key(path, 'Desktop', 'WineDesktop')
        else:
            prefix_manager.clear_registry_key(path)