From: Roman Rolinsky Date: Thu, 15 Mar 2007 19:17:27 +0000 (+0000) Subject: - undo/redo fix for nonchecked items X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a023b456b4daf8768225c64afd63782b674ea0b1 - undo/redo fix for nonchecked items - global modified state set as soon as possible - "option" property renamed to "proportion" git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wx/tools/XRCed/panel.py b/wxPython/wx/tools/XRCed/panel.py index 43fe83d6ad..0f098eef3d 100644 --- a/wxPython/wx/tools/XRCed/panel.py +++ b/wxPython/wx/tools/XRCed/panel.py @@ -160,6 +160,7 @@ class Panel(wx.Notebook): # Register undo object when modifying first time if not self.modified and value: g.undoMan.RegisterUndo(UndoEdit()) + g.frame.SetModified() self.modified = value def Apply(self): @@ -258,7 +259,8 @@ class ParamPage(wx.Panel): for k,v,e in state[1]: self.controls[k].SetValue(v) self.controls[k].Enable(e) - if e: self.controls[k].modified = True + # Set all states to modified + if e and k in self.xxx.params: self.controls[k].modified = True if self.controlName: self.controlName.SetValue(state[2]) @@ -290,8 +292,9 @@ class PropPage(ParamPage): label = wx.StaticText(self, paramIDs[param], param + ':', size = (LABEL_WIDTH,-1), name = param) else: - # Notebook has one very loooooong parameter + # Rename some parameters if param == 'usenotebooksizer': sParam = 'usesizer:' + elif param == 'option': sParam = 'proportion' else: sParam = param + ':' label = wx.CheckBox(self, paramIDs[param], sParam, size = (LABEL_WIDTH,-1), name = param) diff --git a/wxPython/wx/tools/XRCed/xrced.py b/wxPython/wx/tools/XRCed/xrced.py index 23cce5040b..36bd890746 100644 --- a/wxPython/wx/tools/XRCed/xrced.py +++ b/wxPython/wx/tools/XRCed/xrced.py @@ -479,10 +479,14 @@ class Frame(wx.Frame): # Extra check to not mess with idle updating if undoMan.CanUndo(): undoMan.Undo() + g.panel.SetModified(False) + if not undoMan.CanUndo(): + self.SetModified(False) def OnRedo(self, evt): if undoMan.CanRedo(): undoMan.Redo() + self.SetModified(True) def OnCopy(self, evt): selected = tree.selection @@ -1635,7 +1639,8 @@ Please upgrade wxWidgets to %d.%d.%d or higher.''' % MinWxVersion) cwd = os.getcwd() try: for dir in plugins.split(':'): - if os.path.isdir(dir): + if os.path.isdir(dir) and \ + os.path.isfile(os.path.join(dir, '__init__.py')): # Normalize dir = os.path.abspath(os.path.normpath(dir)) sys.path = sys_path + [os.path.dirname(dir)]