Docview and IDE patch from Morag Hua with fix for bug #1217890

"Closing view crashes Python" plus some new features:

    New feature added to the IDE is 'Extensions'.  Under
    Tools|Options|Extensions, you can add calls to external programs.
    For example you can add a "Notepad" extension (under windows) that
    will exec Notepad on the currently open file.  A new "Notepad"
    menu item will appear under the Tools menu.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-06-11 23:18:57 +00:00
parent 94211100ea
commit 2eeaec1909
19 changed files with 1285 additions and 533 deletions

View File

@@ -20,7 +20,7 @@ from wxPython.lib.rcsizer import RowColSizer
import time
import Service
import sys
import activegrid.util.objutils
import activegrid.util.xmlutils
import UICommon
import Wizard
import SVNService
@@ -49,10 +49,10 @@ HALF_SPACE = 5
#----------------------------------------------------------------------------
def load(fileObject):
return activegrid.util.objutils.defaultLoad(fileObject)
return activegrid.util.xmlutils.defaultLoad(fileObject, knownTypes={"projectmodel" : ProjectModel})
def save(fileObject, projectModel):
activegrid.util.objutils.defaultSave(fileObject, projectModel, prettyPrint=True)
activegrid.util.xmlutils.defaultSave(fileObject, projectModel, prettyPrint=True, knownTypes={"projectmodel" : ProjectModel})
#----------------------------------------------------------------------------
@@ -1055,7 +1055,8 @@ class ProjectView(wx.lib.docview.View):
descr = template.GetDescription() + _(" (") + template.GetFileFilter() + _(")")
choices.append(descr)
allfilter = allfilter + template.GetFileFilter()
choices.insert(0, _("All (%s)") % allfilter)
choices.insert(0, _("All (%s)") % allfilter) # first item
choices.append(_("Any (*.*)")) # last item
filterChoice = wx.Choice(frame, -1, size=(250, -1), choices=choices)
filterChoice.SetSelection(0)
filterChoice.SetToolTipString(_("Select file type filter."))
@@ -1112,7 +1113,8 @@ class ProjectView(wx.lib.docview.View):
paths = []
index = filterChoice.GetSelection()
if index:
lastIndex = filterChoice.GetCount()-1
if index and index != lastIndex: # if not All or Any
template = visibleTemplates[index-1]
# do search in files on disk
@@ -1121,7 +1123,7 @@ class ProjectView(wx.lib.docview.View):
break
for name in files:
if index == 0: # all
if index == 0: # All
for template in visibleTemplates:
if template.FileMatchesTemplate(name):
filename = os.path.join(root, name)
@@ -1132,6 +1134,11 @@ class ProjectView(wx.lib.docview.View):
paths.append(filename)
break
elif index == lastIndex: # Any
filename = os.path.join(root, name)
# if already in project, don't add it, otherwise undo will remove it from project even though it was already in it.
if not doc.IsFileInProject(filename):
paths.append(filename)
else: # use selected filter
if template.FileMatchesTemplate(name):
filename = os.path.join(root, name)