Commit e41633ae authored by eric pellegrini's avatar eric pellegrini
Browse files

Bug fix when not accepting to close a plugin

Bug fix when changing selection keyword
Bug fix when setting a new atom selection from atom_transmutation widget
parent a2805403
......@@ -304,7 +304,7 @@ class AtomSelectionPlugin(UserDefinitionPlugin):
self._selectionSummary.SetValue("\n".join(text))
def insert_keyword_values(self, keyword, values):
self._query.add_query([keyword,values])
self.set_selection()
......@@ -361,6 +361,8 @@ class AtomSelectionPlugin(UserDefinitionPlugin):
if not self._selectors.has_key(selectionFilter):
self._selectors[selectionFilter] = [str(v) for v in REGISTRY["selector"][selectionFilter](self._trajectory.universe).choices]
self.values.DeselectAll()
self.values.Set(self._selectors[selectionFilter])
def on_insert_keyword_values(self, event):
......
......@@ -119,7 +119,7 @@ class IPlugin(wx.Panel):
return self._parent
def is_parent(self,window):
if window == self:
return True
......@@ -141,6 +141,7 @@ class IPlugin(wx.Panel):
d = wx.MessageDialog(None, 'Closing this plugin will also close all the other ones you plugged in in so far. Do you really want to close ?', 'Question', wx.YES_NO|wx.YES_DEFAULT|wx.ICON_QUESTION)
if d.ShowModal() == wx.ID_NO:
event.Veto()
return
window = event.GetPane().window
......
......@@ -96,6 +96,12 @@ class AtomSelectionWidget(UserDefinitionWidget):
self.Bind(wx.EVT_BUTTON, self.on_view_definition, view)
self.Bind(wx.EVT_BUTTON, self.on_remove_definition, remove)
def on_new_definition(self,event):
dlg = UserDefinitionDialog(None,self._trajectory,'atom_selection')
dlg.ShowModal()
def on_remove_definition(self,event):
self._sizer.Detach(event.GetEventObject().Parent)
......
......@@ -127,11 +127,8 @@ class WorkingPanel(wx.Panel):
d = wx.MessageDialog(None, 'Closing this data will also close all the other plugins you plugged in in so far. Do you really want to close ?', 'Question', wx.YES_NO|wx.YES_DEFAULT|wx.ICON_QUESTION)
if d.ShowModal() == wx.ID_NO:
event.Veto()
return
dataPlugin = self._notebook.GetPage(event.GetSelection())
dataPlugin.close_children()
if self._notebook.GetPageCount() == 1:
pub.sendMessage('msg_set_plugins_tree', plugin=None)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment