Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
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
No related tags found
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
...
@@ -22,6 +22,8 @@ import threading
import
wx
import
wx
from
fsl.utils.platform
import
platform
as
fslplatform
class
SimpleMessageDialog
(
wx
.
Dialog
):
class
SimpleMessageDialog
(
wx
.
Dialog
):
"""
A simple, no-frills :class:`wx.Dialog` for displaying a message. The
"""
A simple, no-frills :class:`wx.Dialog` for displaying a message. The
...
@@ -637,16 +639,14 @@ class FSLDirDialog(wx.Dialog):
...
@@ -637,16 +639,14 @@ class FSLDirDialog(wx.Dialog):
self
.
__icon
.
SetBitmap
(
bmp
)
self
.
__icon
.
SetBitmap
(
bmp
)
self
.
__message
.
SetLabel
(
self
.
__message
.
SetLabel
(
'
The $FSLDIR environment variable
'
'
The $FSLDIR environment variable is not set - {}
'
'
is not set - {} may not behave
'
'
may not behave correctly.
'
.
format
(
toolName
))
'
correctly.
'
.
format
(
toolName
))
self
.
__locate
.
SetLabel
(
'
Locate $FSLDIR
'
)
self
.
__locate
.
SetLabel
(
'
Locate $FSLDIR
'
)
self
.
__skip
.
SetLabel
(
'
Skip
'
)
self
.
__skip
.
SetLabel
(
'
Skip
'
)
self
.
__skip
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
__onSkip
)
self
.
__skip
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
__onSkip
)
self
.
__locate
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
__onLocate
)
self
.
__locate
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
__onLocate
)
self
.
__mainSizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
__mainSizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
__contentSizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
__contentSizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
__buttonSizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
__buttonSizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
...
@@ -671,8 +671,9 @@ class FSLDirDialog(wx.Dialog):
...
@@ -671,8 +671,9 @@ class FSLDirDialog(wx.Dialog):
self
.
__message
.
Wrap
(
self
.
GetSize
().
GetWidth
())
self
.
__message
.
Wrap
(
self
.
GetSize
().
GetWidth
())
self
.
SetSizer
(
self
.
__mainSizer
)
self
.
SetSizer
(
self
.
__mainSizer
)
self
.
Layout
()
self
.
__mainSizer
.
Layout
()
self
.
Fit
()
self
.
__mainSizer
.
Fit
(
self
)
self
.
CentreOnParent
()
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):
...
@@ -70,7 +70,7 @@ class Platform(notifier.Notifier):
fsldir
fsldir
haveGui
haveGui
wx
Build
wx
Platform
wxFlavour
wxFlavour
glVersion
glVersion
glRenderer
glRenderer
...
@@ -79,7 +79,14 @@ class Platform(notifier.Notifier):
...
@@ -79,7 +79,14 @@ class Platform(notifier.Notifier):
def
__init__
(
self
):
def
__init__
(
self
):
"""
Create a ``Platform`` instance.
"""
"""
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
.
__fsldir
=
os
.
environ
.
get
(
'
FSLDIR
'
,
None
)
self
.
__haveGui
=
False
self
.
__haveGui
=
False
...
@@ -108,16 +115,16 @@ class Platform(notifier.Notifier):
...
@@ -108,16 +115,16 @@ class Platform(notifier.Notifier):
if
isPhoenix
:
self
.
__wxFlavour
=
WX_PHOENIX
if
isPhoenix
:
self
.
__wxFlavour
=
WX_PHOENIX
else
:
self
.
__wxFlavour
=
WX_PYTHON
else
:
self
.
__wxFlavour
=
WX_PYTHON
if
any
([
'
cocoa
'
in
p
for
p
in
pi
]):
build
=
WX_MAC_COCOA
if
any
([
'
cocoa
'
in
p
for
p
in
pi
]):
platform
=
WX_MAC_COCOA
elif
any
([
'
carbon
'
in
p
for
p
in
pi
]):
build
=
WX_MAC_CARBON
elif
any
([
'
carbon
'
in
p
for
p
in
pi
]):
platform
=
WX_MAC_CARBON
elif
any
([
'
gtk
'
in
p
for
p
in
pi
]):
build
=
WX_GTK
elif
any
([
'
gtk
'
in
p
for
p
in
pi
]):
platform
=
WX_GTK
else
:
build
=
None
else
:
platform
=
None
self
.
__
build
=
build
self
.
__
wxPlatform
=
platform
if
self
.
__
build
is
None
:
if
self
.
__
wxPlatform
is
None
:
log
.
warning
(
'
Could not determine wx
build
from
'
log
.
warning
(
'
Could not determine wx
platform
from
'
'
platform
information: {}
'
.
format
(
pi
))
'
information: {}
'
.
format
(
pi
))
@property
@property
...
@@ -127,11 +134,11 @@ class Platform(notifier.Notifier):
...
@@ -127,11 +134,11 @@ class Platform(notifier.Notifier):
@property
@property
def
wx
Build
(
self
):
def
wx
Platform
(
self
):
"""
One of :data:`WX_MAC_COCOA`, :data:`WX_MAC_CARBON`, or
"""
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
@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