Skip to content
Snippets Groups Projects
Commit 3795d12f authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Fixes to fsl platform module. Workaround wx GTK fit

parent c7612816
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,8 @@ import threading
import wx
from fsl.utils.platform import platform as fslplatform
class SimpleMessageDialog(wx.Dialog):
"""A simple, no-frills :class:`wx.Dialog` for displaying a message. The
......@@ -637,16 +639,14 @@ class FSLDirDialog(wx.Dialog):
self.__icon.SetBitmap(bmp)
self.__message.SetLabel(
'The $FSLDIR environment variable '
'is not set - {} may not behave '
'correctly.'.format(toolName))
'The $FSLDIR environment variable is not set - {} '
'may not behave correctly.'.format(toolName))
self.__locate .SetLabel('Locate $FSLDIR')
self.__skip .SetLabel('Skip')
self.__skip .Bind(wx.EVT_BUTTON, self.__onSkip)
self.__locate.Bind(wx.EVT_BUTTON, self.__onLocate)
self.__mainSizer = wx.BoxSizer(wx.HORIZONTAL)
self.__contentSizer = wx.BoxSizer(wx.VERTICAL)
self.__buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
......@@ -671,8 +671,9 @@ class FSLDirDialog(wx.Dialog):
self.__message.Wrap(self.GetSize().GetWidth())
self.SetSizer(self.__mainSizer)
self.Layout()
self.Fit()
self.__mainSizer.Layout()
self.__mainSizer.Fit(self)
self.CentreOnParent()
......
......@@ -70,7 +70,7 @@ class Platform(notifier.Notifier):
fsldir
haveGui
wxBuild
wxPlatform
wxFlavour
glVersion
glRenderer
......@@ -79,7 +79,14 @@ class Platform(notifier.Notifier):
def __init__(self):
"""Create a ``Platform`` instance. """
# For things which 'from fsl.utils.platform import platform',
# these identifiers are available on the platform instance
self.WX_PYTHON = WX_PYTHON
self.WX_PHOENIX = WX_PHOENIX
self.WX_MAC_COCOA = WX_MAC_COCOA
self.WX_MAC_CARBON = WX_MAC_CARBON
self.WX_GTK = WX_GTK
self.__fsldir = os.environ.get('FSLDIR', None)
self.__haveGui = False
......@@ -108,16 +115,16 @@ class Platform(notifier.Notifier):
if isPhoenix: self.__wxFlavour = WX_PHOENIX
else: self.__wxFlavour = WX_PYTHON
if any(['cocoa' in p for p in pi]): build = WX_MAC_COCOA
elif any(['carbon' in p for p in pi]): build = WX_MAC_CARBON
elif any(['gtk' in p for p in pi]): build = WX_GTK
else: build = None
if any(['cocoa' in p for p in pi]): platform = WX_MAC_COCOA
elif any(['carbon' in p for p in pi]): platform = WX_MAC_CARBON
elif any(['gtk' in p for p in pi]): platform = WX_GTK
else: platform = None
self.__build = build
self.__wxPlatform = platform
if self.__build is None:
log.warning('Could not determine wx build from '
'platform information: {}'.format(pi))
if self.__wxPlatform is None:
log.warning('Could not determine wx platform from '
'information: {}'.format(pi))
@property
......@@ -127,11 +134,11 @@ class Platform(notifier.Notifier):
@property
def wxBuild(self):
def wxPlatform(self):
"""One of :data:`WX_MAC_COCOA`, :data:`WX_MAC_CARBON`, or
:data:`WX_GTK`, indicating the wx build.
:data:`WX_GTK`, indicating the wx platform.
"""
return self.__wxBuild
return self.__wxPlatform
@property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment