PyDeadObjectError fixes and PFNotebook -> ChromeNotebook renaming
This commit is contained in:
@@ -29,7 +29,7 @@ from gui.builtinAdditionPanes.fighterView import FighterView
|
||||
from gui.builtinAdditionPanes.implantView import ImplantView
|
||||
from gui.builtinAdditionPanes.notesView import NotesView
|
||||
from gui.builtinAdditionPanes.projectedView import ProjectedView
|
||||
from gui.chrome_tabs import PFNotebook
|
||||
from gui.chrome_tabs import ChromeNotebook
|
||||
from gui.toggle_panel import TogglePanel
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class AdditionsPane(TogglePanel):
|
||||
baseSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
pane.SetSizer(baseSizer)
|
||||
|
||||
self.notebook = PFNotebook(pane, False)
|
||||
self.notebook = ChromeNotebook(pane, False)
|
||||
self.notebook.SetMinSize((-1, 1000))
|
||||
|
||||
baseSizer.Add(self.notebook, 1, wx.EXPAND)
|
||||
|
||||
@@ -288,7 +288,7 @@ class FittingView(d.Display):
|
||||
sFit = Fit.getInstance()
|
||||
sFit.refreshFit(self.getActiveFit())
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.activeFitID))
|
||||
except wx._core.PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.warning("Caught dead object")
|
||||
pass
|
||||
|
||||
@@ -518,7 +518,7 @@ class FittingView(d.Display):
|
||||
self.Refresh()
|
||||
|
||||
self.Show(self.activeFitID is not None and self.activeFitID == event.fitID)
|
||||
except wx._core.PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.error("Caught dead object")
|
||||
finally:
|
||||
event.Skip()
|
||||
|
||||
@@ -25,8 +25,6 @@ import sqlalchemy
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
# noinspection PyPackageRequirements
|
||||
from wx._core import PyDeadObjectError
|
||||
# noinspection PyPackageRequirements
|
||||
from wx.lib.wordwrap import wordwrap
|
||||
# noinspection PyPackageRequirements
|
||||
from wx.lib.inspection import InspectionTool
|
||||
@@ -39,7 +37,7 @@ import config
|
||||
from eos.config import gamedata_version
|
||||
|
||||
import gui.aboutData
|
||||
from gui.chrome_tabs import PFNotebook
|
||||
from gui.chrome_tabs import ChromeNotebook
|
||||
import gui.globalEvents as GE
|
||||
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
@@ -177,7 +175,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
self.fitMultiSwitch = MultiSwitch(self.fitting_additions_split)
|
||||
self.additionsPane = AdditionsPane(self.fitting_additions_split)
|
||||
|
||||
self.notebookBrowsers = PFNotebook(self.browser_fitting_split, False)
|
||||
self.notebookBrowsers = ChromeNotebook(self.browser_fitting_split, False)
|
||||
|
||||
marketImg = BitmapLoader.getImage("market_small", "gui")
|
||||
shipBrowserImg = BitmapLoader.getImage("ship_small", "gui")
|
||||
@@ -403,7 +401,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
dlg.ShowModal()
|
||||
try:
|
||||
dlg.Destroy()
|
||||
except PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.error("Tried to destroy an object that doesn't exist in <showDamagePatternEditor>.")
|
||||
|
||||
def showImplantSetEditor(self, event):
|
||||
@@ -430,7 +428,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
print(("oops, invalid fit format %d" % format_))
|
||||
try:
|
||||
dlg.Destroy()
|
||||
except PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.error("Tried to destroy an object that doesn't exist in <showExportDialog>.")
|
||||
return
|
||||
|
||||
@@ -440,7 +438,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
|
||||
try:
|
||||
dlg.Destroy()
|
||||
except PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.error("Tried to destroy an object that doesn't exist in <showExportDialog>.")
|
||||
|
||||
def showPreferenceDialog(self, event):
|
||||
@@ -779,7 +777,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
|
||||
try:
|
||||
dlg.Destroy()
|
||||
except PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.error("Tried to destroy an object that doesn't exist in <exportToClipboard>.")
|
||||
|
||||
def exportSkillsNeeded(self, event):
|
||||
@@ -835,7 +833,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
self.progressDialog.ShowModal()
|
||||
try:
|
||||
dlg.Destroy()
|
||||
except PyDeadObjectError:
|
||||
except RuntimeError:
|
||||
pyfalog.error("Tried to destroy an object that doesn't exist in <fileImportDialog>.")
|
||||
|
||||
def backupToXml(self, event):
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# =============================================================================
|
||||
|
||||
from gui.chrome_tabs import PFNotebook
|
||||
from gui.chrome_tabs import ChromeNotebook
|
||||
import gui.builtinViews.emptyView
|
||||
|
||||
|
||||
class MultiSwitch(PFNotebook):
|
||||
class MultiSwitch(ChromeNotebook):
|
||||
def __init__(self, parent):
|
||||
PFNotebook.__init__(self, parent)
|
||||
ChromeNotebook.__init__(self, parent)
|
||||
# self.AddPage() # now handled by mainFrame
|
||||
self.handlers = handlers = []
|
||||
for type in TabSpawner.tabTypes:
|
||||
@@ -40,10 +40,10 @@ class MultiSwitch(PFNotebook):
|
||||
tabWnd = gui.builtinViews.emptyView.BlankPage(self)
|
||||
tabWnd.handleDrag = lambda type, info: self.handleDrag(type, info)
|
||||
|
||||
PFNotebook.AddPage(self, tabWnd, tabTitle, tabImage, True)
|
||||
ChromeNotebook.AddPage(self, tabWnd, tabTitle, tabImage, True)
|
||||
|
||||
def DeletePage(self, n, *args, **kwargs):
|
||||
PFNotebook.DeletePage(self, n, *args, **kwargs)
|
||||
ChromeNotebook.DeletePage(self, n, *args, **kwargs)
|
||||
if self.GetPageCount() == 0:
|
||||
self.AddPage()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user