--- a/LPCManager.py Thu Jan 18 10:59:37 2018 +0100
+++ b/LPCManager.py Fri Jan 19 15:15:47 2018 +0100
@@ -120,8 +120,6 @@
_lpcmanager_path = os.path.split(__file__)[0]
-sys.path.append(os.path.join(_lpcmanager_path, "SmartehWidgets"))
-import SmartehWidgets.SmartehScreenSplash as splash
from POULibrary import POULibrary
@@ -193,8 +191,6 @@
from types import MethodType
from IDEFrame import IDEFrame
from dialogs import SearchInProjectDialog
-from UriLocationEditor import UriLocationEditor
-from UriLocationEditor import UriTextControl
from controls import TextCtrlAutoComplete
from controls.LocationCellEditor import LocationCellControl, LocationCellEditor
from dialogs.BrowseLocationsDialog import BrowseLocationsDialog
@@ -475,195 +471,6 @@
("runtime_%s.py" % location_str, file(runtimefile_path, "rb")))
PythonFileCTNMixin.CTNGenerate_C = CTNGenerate_C
-def GenerateSizerElements(self, sizer, elements, path, clean=True):
- CTR = self.ParentWindow.CTR
- CTR_BeremizRoot = CTR.BeremizRoot
- CTR_AppFrame = CTR.AppFrame
- uri = CTR_BeremizRoot.getURI_location().strip()
- dialog = UriLocationEditor(CTR_AppFrame, uri)
- answer = dialog.ShowModal()
- CTR_BeremizRoot.setURI_location(uri)
- if CTR._View is not None:
- CTR._View.RefreshView()
- if CTR_AppFrame is not None:
- CTR_AppFrame.RefreshTitle()
- CTR_AppFrame.RefreshFileMenu()
- CTR_AppFrame.RefreshEditMenu()
- CTR_AppFrame.RefreshPageTitles()
- from editors.ConfTreeNodeEditor import GenStaticBitmap
- for element_infos in elements:
- element_path = "%s.%s" % (path, element_infos["name"])
- element_path = element_infos["name"]
- if element_infos["type"] == "element":
- name = element_infos["name"]
- value = element_infos["value"]
- label += " - %s" % _(value)
- staticbox = wx.StaticBox(self.ParamsEditor,
- label=_(label), size=wx.Size(10, 0))
- staticboxsizer = wx.StaticBoxSizer(staticbox, wx.VERTICAL)
- flags = (wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
- sizer.AddSizer(staticboxsizer, border=5, flag=flags)
- self.GenerateSizerElements(staticboxsizer,
- element_infos["children"],
- boxsizer = wx.FlexGridSizer(cols=3, rows=1)
- boxsizer.AddGrowableCol(1)
- flags = (wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
- sizer.AddSizer(boxsizer, border=5, flag=flags)
- staticbitmap = GenStaticBitmap(ID=-1, bitmapname=element_infos["name"],
- name="%s_bitmap" % element_infos["name"], parent=self.ParamsEditor,
- pos=wx.Point(0, 0), size=wx.Size(24, 24), style=0)
- boxsizer.AddWindow(staticbitmap, border=5, flag=wx.RIGHT)
- statictext = wx.StaticText(self.ParamsEditor,
- label="%s:" % _(element_infos["name"]))
- boxsizer.AddWindow(statictext, border=5,
- flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
- if isinstance(element_infos["type"], types.ListType):
- if isinstance(element_infos["value"], types.TupleType):
- browse_boxsizer = wx.BoxSizer(wx.HORIZONTAL)
- boxsizer.AddSizer(browse_boxsizer)
- textctrl = wx.TextCtrl(self.ParamsEditor,
- size=wx.Size(275, -1), style=wx.TE_READONLY)
- if element_infos["value"] is not None:
- textctrl.SetValue(element_infos["value"][0])
- value_infos = element_infos["value"][1]
- browse_boxsizer.AddWindow(textctrl)
- button = wx.Button(self.ParamsEditor,
- label="...", size=wx.Size(25, 25))
- browse_boxsizer.AddWindow(button)
- button.Bind(wx.EVT_BUTTON,
- self.GetBrowseCallBackFunction(element_infos["name"], textctrl, element_infos["type"],
- value_infos, element_path),
- combobox = wx.ComboBox(self.ParamsEditor,
- size=wx.Size(300, -1), style=wx.CB_READONLY)
- boxsizer.AddWindow(combobox)
- if element_infos["use"] == "optional":
- if len(element_infos["type"]) > 0 and isinstance(element_infos["type"][0], types.TupleType):
- for choice, xsdclass in element_infos["type"]:
- combobox.Append(choice)
- name = element_infos["name"]
- value = element_infos["value"]
- staticbox = wx.StaticBox(self.ParamsEditor,
- label="%s - %s" % (_(name), _(value)), size=wx.Size(10, 0))
- staticboxsizer = wx.StaticBoxSizer(staticbox, wx.VERTICAL)
- sizer.AddSizer(staticboxsizer, border=5, flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
- self.GenerateSizerElements(staticboxsizer, element_infos["children"], element_path)
- callback = self.GetChoiceContentCallBackFunction(combobox, staticboxsizer, element_path)
- for choice in element_infos["type"]:
- combobox.Append(choice)
- callback = self.GetChoiceCallBackFunction(combobox, element_path)
- if element_infos["value"] is None:
- combobox.SetStringSelection("")
- combobox.SetStringSelection(element_infos["value"])
- combobox.Bind(wx.EVT_COMBOBOX, callback, combobox)
- elif isinstance(element_infos["type"], types.DictType):
- if "min" in element_infos["type"]:
- scmin = element_infos["type"]["min"]
- if "max" in element_infos["type"]:
- scmax = element_infos["type"]["max"]
- spinctrl = wx.SpinCtrl(self.ParamsEditor,
- size=wx.Size(300, -1), style=wx.SP_ARROW_KEYS | wx.ALIGN_RIGHT)
- spinctrl.SetRange(scmin, scmax)
- boxsizer.AddWindow(spinctrl)
- if element_infos["value"] is not None:
- spinctrl.SetValue(element_infos["value"])
- spinctrl.Bind(wx.EVT_SPINCTRL,
- self.GetTextCtrlCallBackFunction(spinctrl, element_path),
- if element_infos["type"] == "boolean":
- checkbox = wx.CheckBox(self.ParamsEditor, size=wx.Size(17, 25))
- boxsizer.AddWindow(checkbox)
- if element_infos["value"] is not None:
- checkbox.SetValue(element_infos["value"])
- checkbox.Bind(wx.EVT_CHECKBOX,
- self.GetCheckBoxCallBackFunction(checkbox, element_path),
- elif element_infos["type"] in ["unsignedLong", "long", "integer"]:
- if element_infos["type"].startswith("unsigned"):
- spinctrl = wx.SpinCtrl(self.ParamsEditor,
- size=wx.Size(300, -1), style=wx.SP_ARROW_KEYS | wx.ALIGN_RIGHT)
- spinctrl.SetRange(scmin, scmax)
- boxsizer.AddWindow(spinctrl)
- if element_infos["value"] is not None:
- spinctrl.SetValue(element_infos["value"])
- spinctrl.Bind(wx.EVT_SPINCTRL,
- self.GetTextCtrlCallBackFunction(spinctrl, element_path),
- choices = self.ParentWindow.GetConfigEntry(element_path, [""])
- CTR = self.ParentWindow.CTR
- if element_infos["name"] == "URI_location":
- textctrl = UriTextControl(name=element_infos["name"],
- parent=self.ParamsEditor,
- element_path=element_path,
- textctrl = TextCtrlAutoComplete(name=element_infos["name"],
- parent=self.ParamsEditor,
- element_path=element_path,
- boxsizer.AddWindow(textctrl)
- if element_infos["value"] is not None:
- textctrl.ChangeValue(str(element_infos["value"]))
- callback = self.GetTextCtrlCallBackFunction(textctrl, element_path)
- textctrl.Bind(wx.EVT_TEXT_ENTER, callback)
- textctrl.Bind(wx.EVT_TEXT, callback)
- textctrl.Bind(wx.EVT_KILL_FOCUS, callback)
- self.RefreshScrollbars()
-ConfTreeNodeEditor.GenerateSizerElements = GenerateSizerElements
def ResetSearchResults(self):
@@ -2411,11 +2218,12 @@
def Show(self, loading=True):
- loading_splash = splash.SmartehScreenSplash(self, bitmap=GetPath(splash.SPLASH_FN), signal=signal_init)
- thread = Thread(target=loading_splash.Show)
+ # loading_splash = splash.SmartehScreenSplash(self, bitmap=GetPath(splash.SPLASH_FN), signal=signal_init) + # thread = Thread(target=loading_splash.Show) def CheckEnabler(self, event):
@@ -2944,13 +2752,6 @@
lpcberemiz_cmd = LPCBeremiz_Cmd(CTR, Log)
- # reset pid of running wxGlade
- config = wx.ConfigBase.Get()
- config.Write("BeremizRoot.wxGlade", str(wxGladePid))
Log = StdoutPseudoFile(port)
if projectOpen is not None:
@@ -2970,10 +2771,9 @@
# Install a exception handle for bug reports
- AddExceptHook(os.getcwd(), __version__)
+ import util.ExceptionHandler + util.ExceptionHandler.AddExceptHook(version.app_version) frame = LPCBeremiz(None, ctr=CTR, debug=True)
\ No newline at end of file