# Path: plover/machine/registry.py
# class NoSuchMachineException(Exception):
# class Registry(object):
#     def __init__(self, id):
#     def __str__(self):
#     def __init__(self):
#     def register(self, name, machine):
#     def add_alias(self, alias, name):
#     def get(self, name):
#     def get_all_names(self):
#     def resolve_alias(self, name):
# 
# Path: plover/dictionary/loading_manager.py
# class DictionaryLoadingManager(object):
# class DictionaryLoadingOperation(object):
#     def __init__(self):
#     def start_loading(self, filename):
#     def load(self, filenames):
#     def __init__(self, filename):
#     def load(self):
#     def get(self):
# 
# Path: plover/gui/keyboard_config.py
# class KeyboardConfigDialog(wx.Dialog):
#     """Keyboard configuration dialog."""
# 
#     def __init__(self, options, parent, config):
#         self.config = config
#         self.options = options
#         
#         pos = (config.get_keyboard_config_frame_x(), 
#                config.get_keyboard_config_frame_y())
#         wx.Dialog.__init__(self, parent, title=DIALOG_TITLE, pos=pos)
# 
#         sizer = wx.BoxSizer(wx.VERTICAL)
#         
#         instructions = wx.StaticText(self, label=ARPEGGIATE_INSTRUCTIONS)
#         sizer.Add(instructions, border=UI_BORDER, flag=wx.ALL)
#         self.arpeggiate_option = wx.CheckBox(self, label=ARPEGGIATE_LABEL)
#         self.arpeggiate_option.SetValue(options.arpeggiate)
#         sizer.Add(self.arpeggiate_option, border=UI_BORDER, 
#                   flag=wx.LEFT | wx.RIGHT | wx.BOTTOM)
#         
#         ok_button = wx.Button(self, id=wx.ID_OK)
#         ok_button.SetDefault()
#         cancel_button = wx.Button(self, id=wx.ID_CANCEL)
# 
#         button_sizer = wx.BoxSizer(wx.HORIZONTAL)
#         button_sizer.Add(ok_button, border=UI_BORDER, flag=wx.ALL)
#         button_sizer.Add(cancel_button, border=UI_BORDER, flag=wx.ALL)
#         sizer.Add(button_sizer, flag=wx.ALL | wx.ALIGN_RIGHT, border=UI_BORDER)
#                   
#         self.SetSizer(sizer)
#         sizer.Fit(self)
#         self.SetRect(AdjustRectToScreen(self.GetRect()))
#         
#         self.Bind(wx.EVT_MOVE, self.on_move)
#         ok_button.Bind(wx.EVT_BUTTON, self.on_ok)
#         cancel_button.Bind(wx.EVT_BUTTON, self.on_cancel)
# 
#     def on_move(self, event):
#         pos = self.GetScreenPositionTuple()
#         self.config.set_keyboard_config_frame_x(pos[0]) 
#         self.config.set_keyboard_config_frame_y(pos[1])
#         event.Skip()
# 
#     def on_ok(self, event):
#         self.options.arpeggiate = self.arpeggiate_option.GetValue()
#         self.EndModal(wx.ID_OK)
#     
#     def on_cancel(self, event):
#         self.EndModal(wx.ID_CANCEL)


import os
import os.path
import wx
import wx.lib.filebrowsebutton as filebrowse
import plover.config as conf
import plover.gui.add_translation
import plover.gui.lookup
from wx.lib.utils import AdjustRectToScreen
from collections import namedtuple
from wx.lib.scrolledpanel import ScrolledPanel
from plover.gui.serial_config import SerialConfigDialog
from plover.app import update_engine
from plover.machine.registry import machine_registry
from plover.exception import InvalidConfigurationError
from plover.dictionary.loading_manager import manager as dict_manager
from plover.gui.paper_tape import StrokeDisplayDialog
from plover.gui.keyboard_config import KeyboardConfigDialog

        if self.IsModal():
            self.EndModal(wx.ID_SAVE)
        else:
            self.Close()


class MachineConfig(wx.Panel):
    """Stenotype machine configuration graphical user interface."""

    def __init__(self, config, parent):
        """Create a configuration component based on the given ConfigParser.

        Arguments:

        config -- A Config object.

        parent -- This component's parent component.

        """
        wx.Panel.__init__(self, parent, size=CONFIG_PANEL_SIZE)
        self.config = config
        sizer = wx.BoxSizer(wx.VERTICAL)
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.Add(wx.StaticText(self, label=MACHINE_LABEL),
                border=COMPONENT_SPACE,
                flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
        machines = machine_registry.get_all_names()
        value = self.config.get_machine_type()
        self.choice = wx.Choice(self, choices=machines)

# Path: plover/machine/registry.py
# class NoSuchMachineException(Exception):
# class Registry(object):
#     def __init__(self, id):
#     def __str__(self):
#     def __init__(self):
#     def register(self, name, machine):
#     def add_alias(self, alias, name):
#     def get(self, name):
#     def get_all_names(self):
#     def resolve_alias(self, name):
# 
# Path: plover/dictionary/loading_manager.py
# class DictionaryLoadingManager(object):
# class DictionaryLoadingOperation(object):
#     def __init__(self):
#     def start_loading(self, filename):
#     def load(self, filenames):
#     def __init__(self, filename):
#     def load(self):
#     def get(self):
# 
# Path: plover/gui/keyboard_config.py
# class KeyboardConfigDialog(wx.Dialog):
#     """Keyboard configuration dialog."""
# 
#     def __init__(self, options, parent, config):
#         self.config = config
#         self.options = options
#         
#         pos = (config.get_keyboard_config_frame_x(), 
#                config.get_keyboard_config_frame_y())
#         wx.Dialog.__init__(self, parent, title=DIALOG_TITLE, pos=pos)
# 
#         sizer = wx.BoxSizer(wx.VERTICAL)
#         
#         instructions = wx.StaticText(self, label=ARPEGGIATE_INSTRUCTIONS)
#         sizer.Add(instructions, border=UI_BORDER, flag=wx.ALL)
#         self.arpeggiate_option = wx.CheckBox(self, label=ARPEGGIATE_LABEL)
#         self.arpeggiate_option.SetValue(options.arpeggiate)
#         sizer.Add(self.arpeggiate_option, border=UI_BORDER, 
#                   flag=wx.LEFT | wx.RIGHT | wx.BOTTOM)
#         
#         ok_button = wx.Button(self, id=wx.ID_OK)
#         ok_button.SetDefault()
#         cancel_button = wx.Button(self, id=wx.ID_CANCEL)
# 
#         button_sizer = wx.BoxSizer(wx.HORIZONTAL)
#         button_sizer.Add(ok_button, border=UI_BORDER, flag=wx.ALL)
#         button_sizer.Add(cancel_button, border=UI_BORDER, flag=wx.ALL)
#         sizer.Add(button_sizer, flag=wx.ALL | wx.ALIGN_RIGHT, border=UI_BORDER)
#                   
#         self.SetSizer(sizer)
#         sizer.Fit(self)
#         self.SetRect(AdjustRectToScreen(self.GetRect()))
#         
#         self.Bind(wx.EVT_MOVE, self.on_move)
#         ok_button.Bind(wx.EVT_BUTTON, self.on_ok)
#         cancel_button.Bind(wx.EVT_BUTTON, self.on_cancel)
# 
#     def on_move(self, event):
#         pos = self.GetScreenPositionTuple()
#         self.config.set_keyboard_config_frame_x(pos[0]) 
#         self.config.set_keyboard_config_frame_y(pos[1])
#         event.Skip()
# 
#     def on_ok(self, event):
#         self.options.arpeggiate = self.arpeggiate_option.GetValue()
#         self.EndModal(wx.ID_OK)
#     
#     def on_cancel(self, event):
#         self.EndModal(wx.ID_CANCEL)


# Path: plover/gui/config.py
import os
import os.path
import wx
import wx.lib.filebrowsebutton as filebrowse
import plover.config as conf
import plover.gui.add_translation
import plover.gui.lookup
from wx.lib.utils import AdjustRectToScreen
from collections import namedtuple
from wx.lib.scrolledpanel import ScrolledPanel
from plover.gui.serial_config import SerialConfigDialog
from plover.app import update_engine
from plover.machine.registry import machine_registry
from plover.exception import InvalidConfigurationError
from plover.dictionary.loading_manager import manager as dict_manager
from plover.gui.paper_tape import StrokeDisplayDialog
from plover.gui.keyboard_config import KeyboardConfigDialog


        if self.IsModal():
            self.EndModal(wx.ID_SAVE)
        else:
            self.Close()


class MachineConfig(wx.Panel):
    """Stenotype machine configuration graphical user interface."""

    def __init__(self, config, parent):
        """Create a configuration component based on the given ConfigParser.

        Arguments:

        config -- A Config object.

        parent -- This component's parent component.

        """
        wx.Panel.__init__(self, parent, size=CONFIG_PANEL_SIZE)
        self.config = config
        sizer = wx.BoxSizer(wx.VERTICAL)
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.Add(wx.StaticText(self, label=MACHINE_LABEL),
                border=COMPONENT_SPACE,
                flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
        machines = machine_registry.get_all_names()
        value = self.config.get_machine_type()
        self.choice = wx.Choice(self, choices=machines)

        self.choice.SetStringSelection(machine_registry.resolve_alias(value))