Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
3795d12f
Commit
3795d12f
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to fsl platform module. Workaround wx GTK fit
bug (
http://trac.wxwidgets.org/ticket/16440
) in FSLDIRDialog.
parent
c7612816
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/utils/dialog.py
+7
-6
7 additions, 6 deletions
fsl/utils/dialog.py
fsl/utils/platform.py
+20
-13
20 additions, 13 deletions
fsl/utils/platform.py
with
27 additions
and
19 deletions
fsl/utils/dialog.py
+
7
−
6
View file @
3795d12f
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/platform.py
+
20
−
13
View file @
3795d12f
...
...
@@ -70,7 +70,7 @@ class Platform(notifier.Notifier):
fsldir
haveGui
wx
Build
wx
Platform
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
wx
Build
(
self
):
def
wx
Platform
(
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
.
__wx
Build
return
self
.
__wx
Platform
@property
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment