import sys
import wx.grid
import os.path
+import activegrid.util
+
_ = wx.GetTranslation
ACTIVEGRID_BASE_IDE = False
import PHPEditor
import wx.lib.ogl as ogl
import DebuggerService
+ import atexit
+ atexit.register(DebuggerService.DebuggerService.KillAllRunningProcesses)
import AboutDialog
+ import SVNService
+
if not ACTIVEGRID_BASE_IDE:
import DataModelEditor
import ProcessModelEditor
import WelcomeService
import ViewEditor
import PropertyService
-
+
# This creates some pens and brushes that the OGL library uses.
# It should be called after the app object has been created, but
deploymentService = self.InstallService(DeploymentService.DeploymentService())
dataModelService = self.InstallService(DataModelEditor.DataModelService())
welcomeService = self.InstallService(WelcomeService.WelcomeService())
- optionsService = self.InstallService(wx.lib.pydocview.DocOptionsService(allowModeChanges=False))
+ optionsService = self.InstallService(wx.lib.pydocview.DocOptionsService(supportedModes=wx.lib.docview.DOC_MDI))
aboutService = self.InstallService(wx.lib.pydocview.AboutService(AboutDialog.AboutDialog))
+ svnService = self.InstallService(SVNService.SVNService())
if not ACTIVEGRID_BASE_IDE:
projectService.AddRunHandler(processModelService)
optionsService.AddOptionsPanel(PHPEditor.PHPOptionsPanel)
optionsService.AddOptionsPanel(STCTextEditor.TextOptionsPanel)
optionsService.AddOptionsPanel(HtmlEditor.HtmlOptionsPanel)
+ optionsService.AddOptionsPanel(SVNService.SVNOptionsPanel)
filePropertiesService.AddCustomEventHandler(projectService)
propertyService.StartBackgroundTimer()
self.SetDefaultIcon(getActiveGridIcon())
- self.SetUseTabbedMDI(True)
if not ACTIVEGRID_BASE_IDE:
embeddedWindows = wx.lib.pydocview.EMBEDDED_WINDOW_TOPLEFT | wx.lib.pydocview.EMBEDDED_WINDOW_BOTTOMLEFT |wx.lib.pydocview.EMBEDDED_WINDOW_BOTTOM | wx.lib.pydocview.EMBEDDED_WINDOW_RIGHT
else:
if not projectService.OpenSavedProjects() and not docManager.GetDocuments() and self.IsSDI(): # Have to open something if it's SDI and there are no projects...
projectTemplate.CreateDocument('', wx.lib.docview.DOC_NEW).OnNewDocument()
-
+
+ TIPS_FILE_PARTS = ("activegrid", "tool", "data", "tips.txt")
+ tips_path = activegrid.util.mainModuleDir
+ for segment in TIPS_FILE_PARTS:
+ tips_path = os.path.join(tips_path, segment)
if not ACTIVEGRID_BASE_IDE:
if not welcomeService.RunWelcomeIfFirstTime():
- if os.path.exists("activegrid/tool/data/tips.txt"):
- wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider("activegrid/tool/data/tips.txt", 0))
+ if os.path.exists(tips_path):
+ wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider(tips_path, 0))
else:
- if os.path.exists("activegrid/tool/data/tips.txt"):
- wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider("activegrid/tool/data/tips.txt", 0))
+ if os.path.exists(tips_path):
+ wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider(tips_path, 0))
wx.UpdateUIEvent.SetUpdateInterval(200) # Overhead of updating menus was too much. Change to update every 200 milliseconds.