From 8a9107c798ab7284d8eab686fd295a139bed3193 Mon Sep 17 00:00:00 2001 From: Will Wykeham Date: Tue, 13 Oct 2015 15:56:58 +0100 Subject: [PATCH 1/4] Fix a double handle of the delete event On GTK, the handler will get called twice if you call skip(), and a ValueError exception is thrown on cmdline We're handling the event so skip not necessary. --- gui/projectedView.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gui/projectedView.py b/gui/projectedView.py index 3b0d8f3af..c36d34de1 100644 --- a/gui/projectedView.py +++ b/gui/projectedView.py @@ -96,8 +96,6 @@ class ProjectedView(d.Display): sFit.removeProjected(fitID, self.get(row)) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID)) - event.Skip() - def handleDrag(self, type, fitID): #Those are drags coming from pyfa sources, NOT builtin wx drags if type == "fit": From 53b8ca3940effa47fd793a54f6b14419e6a8f960 Mon Sep 17 00:00:00 2001 From: Will Wykeham Date: Tue, 13 Oct 2015 15:59:06 +0100 Subject: [PATCH 2/4] Fix some indentation inconsistency --- gui/projectedView.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gui/projectedView.py b/gui/projectedView.py index c36d34de1..0d7192120 100644 --- a/gui/projectedView.py +++ b/gui/projectedView.py @@ -27,18 +27,18 @@ from gui.contextMenu import ContextMenu import eos.types class ProjectedViewDrop(wx.PyDropTarget): - def __init__(self, dropFn): - wx.PyDropTarget.__init__(self) - self.dropFn = dropFn - # this is really transferring an EVE itemID - self.dropData = wx.PyTextDataObject() - self.SetDataObject(self.dropData) + def __init__(self, dropFn): + wx.PyDropTarget.__init__(self) + self.dropFn = dropFn + # this is really transferring an EVE itemID + self.dropData = wx.PyTextDataObject() + self.SetDataObject(self.dropData) - def OnData(self, x, y, t): - if self.GetData(): - data = self.dropData.GetText().split(':') - self.dropFn(x, y, data) - return t + def OnData(self, x, y, t): + if self.GetData(): + data = self.dropData.GetText().split(':') + self.dropFn(x, y, data) + return t class ProjectedView(d.Display): DEFAULT_COLS = ["State", From bb9760f79c1557e47dbe5f99d2d71a6dfdd61609 Mon Sep 17 00:00:00 2001 From: Will Wykeham Date: Tue, 13 Oct 2015 16:01:13 +0100 Subject: [PATCH 3/4] Add a usage hint to the Projected tab --- gui/projectedView.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gui/projectedView.py b/gui/projectedView.py index 0d7192120..8e99fba1b 100644 --- a/gui/projectedView.py +++ b/gui/projectedView.py @@ -26,6 +26,16 @@ from gui.builtinViewColumns.state import State from gui.contextMenu import ContextMenu import eos.types + +class DummyItem: + def __init__(self, txt): + self.name = txt + self.icon = None + +class DummyEntry: + def __init__(self, txt): + self.item = DummyItem(txt) + class ProjectedViewDrop(wx.PyDropTarget): def __init__(self, dropFn): wx.PyDropTarget.__init__(self) @@ -178,6 +188,10 @@ class ProjectedView(d.Display): self.EnsureVisible(item) self.deselectItems() + + if stuff == []: + stuff = [DummyEntry("Drag an item or fit, or use right-click menu for system effects")] + self.update(stuff) def get(self, row): From 73de795082d9947ce6c2d2acb887581a9849c249 Mon Sep 17 00:00:00 2001 From: Will Wykeham Date: Tue, 13 Oct 2015 16:13:35 +0100 Subject: [PATCH 4/4] Fix click on dummy item --- gui/projectedView.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/projectedView.py b/gui/projectedView.py index 8e99fba1b..0043ac639 100644 --- a/gui/projectedView.py +++ b/gui/projectedView.py @@ -197,6 +197,11 @@ class ProjectedView(d.Display): def get(self, row): numMods = len(self.modules) numDrones = len(self.drones) + numFits = len(self.fits) + + if (numMods + numDrones + numFits) == 0: + return None + if row < numMods: stuff = self.modules[row] elif row - numMods < numDrones: