Skip to content

Commit

Permalink
Added dictionary editor frame coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
mighele committed Apr 4, 2014
1 parent 318dca0 commit 6094d14
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions plover/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
LOOKUP_FRAME_Y_OPTION = 'y'
DEFAULT_LOOKUP_FRAME_Y = -1

DICTIONARY_EDITOR_FRAME_SECTION = 'Dictionary Editor Frame'
DICTIONARY_EDITOR_FRAME_X_OPTION = 'x'
DEFAULT_DICTIONARY_EDITOR_FRAME_X = -1
DICTIONARY_EDITOR_FRAME_Y_OPTION = 'y'
DEFAULT_DICTIONARY_EDITOR_FRAME_Y = -1

SERIAL_CONFIG_FRAME_SECTION = 'Serial Config Frame'
SERIAL_CONFIG_FRAME_X_OPTION = 'x'
DEFAULT_SERIAL_CONFIG_FRAME_X = -1
Expand Down Expand Up @@ -326,6 +332,22 @@ def get_lookup_frame_y(self):
return self._get_int(LOOKUP_FRAME_SECTION,
LOOKUP_FRAME_Y_OPTION,
DEFAULT_LOOKUP_FRAME_Y)

def set_dictionary_editor_frame_x(self, x):
self._set(DICTIONARY_EDITOR_FRAME_SECTION, DICTIONARY_EDITOR_FRAME_X_OPTION, x)

def get_dictionary_editor_frame_x(self):
return self._get_int(DICTIONARY_EDITOR_FRAME_SECTION,
DICTIONARY_EDITOR_FRAME_X_OPTION,
DEFAULT_DICTIONARY_EDITOR_FRAME_X)

def set_dictionary_editor_frame_y(self, y):
self._set(DICTIONARY_EDITOR_FRAME_SECTION, DICTIONARY_EDITOR_FRAME_Y_OPTION, y)

def get_dictionary_editor_frame_y(self):
return self._get_int(DICTIONARY_EDITOR_FRAME_SECTION,
DICTIONARY_EDITOR_FRAME_Y_OPTION,
DEFAULT_DICTIONARY_EDITOR_FRAME_Y)

def set_serial_config_frame_x(self, x):
self._set(SERIAL_CONFIG_FRAME_SECTION, SERIAL_CONFIG_FRAME_X_OPTION, x)
Expand Down Expand Up @@ -360,8 +382,7 @@ def get_keyboard_config_frame_y(self):
return self._get_int(KEYBOARD_CONFIG_FRAME_SECTION,
KEYBOARD_CONFIG_FRAME_Y_OPTION,
DEFAULT_KEYBOARD_CONFIG_FRAME_Y)



def _set(self, section, option, value):
if not self._config.has_section(section):
self._config.add_section(section)
Expand Down

0 comments on commit 6094d14

Please sign in to comment.