Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
1b90bd37
Commit
1b90bd37
authored
Sep 04, 2015
by
eric pellegrini
Browse files
Changed the close pane event such that when a pane is closed, its parent
take the focus and the plugins tree get updated
parent
87466cd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
MDANSE/Framework/Plugins/IPlugin.py
View file @
1b90bd37
...
...
@@ -37,6 +37,7 @@ import wx
import
wx.aui
as
aui
from
MDANSE
import
REGISTRY
from
MDANSE.Externals.pubsub
import
pub
def
plugin_parent
(
window
):
...
...
@@ -136,6 +137,7 @@ class IPlugin(wx.Panel):
return
self
.
is_parent
(
window
.
Parent
)
def
close
(
self
):
pass
def
on_close_pane
(
self
,
event
):
...
...
@@ -147,7 +149,9 @@ class IPlugin(wx.Panel):
except
AttributeError
:
plugin
.
Close
()
self
.
_parent
.
SetFocus
()
self
.
SetFocus
()
pub
.
sendMessage
((
'msg_set_plugins_tree'
),
message
=
self
)
def
build_dialog
(
self
):
...
...
@@ -164,10 +168,10 @@ class IPlugin(wx.Panel):
def
drop
(
self
,
pluginName
):
# If no plugin match the name of the dropped plugin, do nothing.
plugin
=
REGISTRY
[
"plugin"
].
get
(
pluginName
,
None
)
plugin
=
REGISTRY
[
"plugin"
].
get
(
pluginName
,
None
)
if
plugin
is
None
:
return
klasses
=
tuple
([
REGISTRY
[
'plugin'
][
anc
]
for
anc
in
plugin
.
ancestor
])
if
not
issubclass
(
self
.
__class__
,
klasses
):
self
.
parent
.
drop
(
pluginName
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment