Skip to content

Commit

Permalink
More locationsettings changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gryffon committed Mar 18, 2014
1 parent 9b5ad28 commit 7e6ee9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/gui/settings_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def Save(self):
else:
settings.imagepackdir_changed = False
settings.dir_imagepacks = self.dirImagePacks.GetValue()
locationsettings.data_dir = self.dirData.GetValue()

def Import(self):
try:
Expand Down Expand Up @@ -202,15 +203,15 @@ def OnGetImagesPath(self, event):

def OnDefaultDataDir(self, event):
self.dirData.SetValue(DEFAULT_SETTINGS_DATA_DIR['data_dir'])
locationsettings.data_dir = self.dirData.GetValue()



def OnGetDataDir(self, event):
fdlg = wx.DirDialog(None, message='Please select the directory containing Egg of P\'an Ku data ', \
defaultPath=locationsettings.data_dir, name='Select Data Dir')
if fdlg.ShowModal() == wx.ID_OK:
self.dirData.SetValue(fdlg.GetPath() if fdlg.GetPath().endswith('\\') else fdlg.GetPath() + '\\')
locationsettings.data_dir = self.dirData.GetValue()


def OnChangeDatabase(self, event):
fdlg = wx.FileDialog(None, wildcard='XML card database (*.xml)|*.xml|All files (*.*)|*.*', style=wx.OPEN|wx.FILE_MUST_EXIST)
Expand Down Expand Up @@ -346,7 +347,8 @@ def __init__(self, parent):
sizer.Add(buttonsizer, 0, wx.EXPAND | wx.ALL, 5)
self.SetSizer(sizer)

wx.EVT_BUTTON(self, self.GetAffirmativeId(), self.SaveSettings)
#wx.EVT_BUTTON(self, self.GetAffirmativeId(), self.SaveSettings)
self.Bind(wx.EVT_BUTTON, self.SaveSettings, self.GetAffirmativeId())


def SaveSettings(self, event):
Expand Down
2 changes: 1 addition & 1 deletion src/settings/xmlsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

class _XMLSettings:
def __init__(self, xmlfile,defaults):
def __init__(self, xmlfile, defaults):
self.__dict__['_filename'] = xmlfile
self.__dict__.update(defaults)
self.LoadSettingsFile(self._filename)
Expand Down

0 comments on commit 7e6ee9b

Please sign in to comment.