Created first iteration of "Recent Fits" view, in which a nav button is interacted with to show a list of the 100 most recently modified fits. Ship Broswer is littered with ToggleRecentShips() to reset the icon when not in "recent" mode. This should probably be fixed at some point.
Removed the FIT_CHANGED binding from FitItem - this was causing very odd issues when the object was destroyed (navigating to another "stage") such as the Fit Changed event for that fit no longer firing (or at least seemingly so) To fix this, simply look at the active fit during FitItem.Refresh() Also creates a new query to get a list of items from the DB, although it's not used (was gonna use it, decided against it, but didn't want to delete the code - could prove handy later)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
import sys
|
||||
import os.path
|
||||
from logbook import Logger
|
||||
import datetime
|
||||
|
||||
import sqlalchemy
|
||||
# noinspection PyPackageRequirements
|
||||
@@ -919,7 +920,16 @@ class MainFrame(wx.Frame):
|
||||
wx.PostEvent(self, FitSelected(fitID=fit.ID))
|
||||
wx.PostEvent(self.shipBrowser, Stage3Selected(shipID=fit.shipID, back=True))
|
||||
else:
|
||||
wx.PostEvent(self.shipBrowser, ImportSelected(fits=fits, back=True))
|
||||
fits.sort(key=lambda _fit: (_fit.ship.item.name, _fit.name))
|
||||
results = []
|
||||
for fit in fits:
|
||||
results.append((
|
||||
fit.ID,
|
||||
fit.name,
|
||||
fit.modified or fit.created or datetime.datetime.fromtimestamp(fit.timestamp),
|
||||
fit.ship.item
|
||||
))
|
||||
wx.PostEvent(self.shipBrowser, ImportSelected(fits=results, back=True))
|
||||
|
||||
def closeProgressDialog(self):
|
||||
# Windows apparently handles ProgressDialogs differently. We can
|
||||
|
||||
Reference in New Issue
Block a user