Merge branch 'master' into cargo

Conflicts:
	eos/saveddata/fit.py
This commit is contained in:
blitzmann
2014-05-03 20:46:32 -04:00
24 changed files with 162 additions and 60 deletions

View File

@@ -19,8 +19,16 @@
import config
versionString = "{0} {1} - {2} {3}".format(config.version, config.tag, config.expansionName, config.expansionVersion)
license = "pyfa is released under GNU GPLv3"
licenseLocation = "gpl.txt"
developers = ("\n cncfanatics \t(Sakari Orisi)\n" , " DarkPhoenix \t(Kadesh Priestess)\n", " Darriele \t(Darriele)")
credits = (("Entity (Entity) \t\tCapacitor calculations / EVEAPI python lib / Reverence"), ("Aurora \t\tMaths"), ("Corollax (Aamrr) \tVarious EOS/pyfa improvements"))
description = "Pyfa (the Python Fitting Assistant) is a standalone application able to create and simulate fittings for EVE-Online SciFi MMORPG with a very high degree of accuracy.\nPyfa can be virtually ran on all platforms where python and wxwidgets are supported.\n\n\nAll EVE-Online related materials are property of CCP hf.\n\nSilk Icons Set by famfamfam.com released under Creative Commons Attribution 2.5 License\n\nFat Cow Icons by fatcow.com released under Creative Commons Attribution 3.0 License"
licenses = (
"pyfa is released under GNU GPLv3 - see included gpl.txt",
"All EVE-Online related materials are property of CCP hf.",
"Silk Icons Set by famfamfam.com - Creative Commons Attribution 2.5 License",
"Fat Cow Icons by fatcow.com - Creative Commons Attribution 3.0 License"
)
developers = ("blitzmann \t(Sable Blitzmann)", "cncfanatics \t(Sakari Orisi)" , "DarkPhoenix \t(Kadesh Priestess) (Project Lead)", "Darriele \t(Darriele)")
credits = ("Entity (Entity) \t\tCapacitor calculations / EVEAPI python lib / Reverence", "Aurora \t\t\tMaths", "Corollax (Aamrr) \tVarious EOS / pyfa improvements")
description = (
"Pyfa (the Python Fitting Assistant) is an open-source standalone application able to "
"create and simulate fittings for EVE-Online SciFi MMORPG with a very high degree of "
"accuracy. Pyfa can run on all platforms where Python and wxWidgets are supported."
)

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from gui.contextMenu import ContextMenu
import gui.mainFrame
import service
@@ -112,7 +113,7 @@ class ModuleAmmoPicker(ContextMenu):
def addSeperator(self, m, text):
id = wx.NewId()
m.Append(id, "--- %s ---" % text)
m.Append(id, u'%s' % text)
m.Enable(id, False)
def getSubMenu(self, context, selection, menu, i):
@@ -132,6 +133,11 @@ class ModuleAmmoPicker(ContextMenu):
sub = None
self.charges.sort(key=self.turretSorter)
for charge in self.charges:
# fix issue 71 - will probably have to change if CCP adds more Orbital ammo
if "Orbital" in charge.name:
item = self.addCharge(m, charge)
items.append(item)
continue
currBase = charge.name.rsplit()[-2:]
currRange = charge.getAttribute("weaponRangeMultiplier")
if nameBase is None or range != currRange or nameBase != currBase:
@@ -156,6 +162,7 @@ class ModuleAmmoPicker(ContextMenu):
if sub is not None:
self.addSeperator(sub, "More Damage")
for item in items:
m.AppendItem(item)

View File

@@ -233,10 +233,23 @@ class FittingView(d.Display):
event.Skip()
def fitRemoved(self, event):
'''If fit is removed and active, the page is deleted.
We also refresh the fit of the new current page in case
delete fit caused change in stats (projected)
'''
fitID = event.fitID
if fitID == self.getActiveFit():
self.parent.DeletePage(self.parent.GetPageIndex(self))
try:
# Sometimes there is no active page after deletion, hence the try block
cFit = service.Fit.getInstance()
cFit.refreshFit(self.getActiveFit())
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.activeFitID))
except wx._core.PyDeadObjectError:
pass
event.Skip()
def fitRenamed(self, event):

View File

@@ -26,9 +26,13 @@ import wx.lib.mixins.listctrl as listmix
import wx.html
from eos.types import Ship, Module, Skill, Booster, Implant, Drone
from gui.utils.numberFormatter import formatAmount
from collections import OrderedDict
import service
try:
from collections import OrderedDict
except ImportError:
from gui.utils.compat import OrderedDict
class ItemStatsDialog(wx.Dialog):
counter = 0
def __init__(self, victim, fullContext=None, pos = wx.DefaultPosition, size = wx.DefaultSize, maximized = False):

View File

@@ -243,14 +243,12 @@ class MainFrame(wx.Frame):
info = wx.AboutDialogInfo()
info.Name = "pyfa"
info.Version = gui.aboutData.versionString
info.Description = wordwrap(gui.aboutData.description + "\n\n\nDevelopers: " +
"".join(gui.aboutData.developers) +
"\n\nAdditional credits:\n " +
"\n ".join(gui.aboutData.credits)
+ "\n\nLicense: " +
gui.aboutData.license +
" - see included " +
gui.aboutData.licenseLocation +
info.Description = wordwrap(gui.aboutData.description + "\n\nDevelopers:\n\t" +
"\n\t".join(gui.aboutData.developers) +
"\n\nAdditional credits:\n\t" +
"\n\t".join(gui.aboutData.credits) +
"\n\nLicenses:\n\t" +
"\n\t".join(gui.aboutData.licenses) +
"\n\nPython: \t" + sys.version +
"\nwxPython: \t" + wx.__version__ +
"\nSQLAlchemy: \t" + sqlalchemy.__version__,
@@ -364,7 +362,7 @@ class MainFrame(wx.Frame):
# Export HTML
self.Bind(wx.EVT_MENU, self.exportHtml, id=menuBar.exportHtmlId)
# Preference dialog
self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id = menuBar.preferencesId)
self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id=wx.ID_PREFERENCES)
# User guide
self.Bind(wx.EVT_MENU, self.goWiki, id = menuBar.wikiId)
# EVE Forums
@@ -384,6 +382,7 @@ class MainFrame(wx.Frame):
self.additionstab2 = wx.NewId()
self.additionstab3 = wx.NewId()
self.additionstab4 = wx.NewId()
self.additionstab5 = wx.NewId()
# Close Page
self.Bind(wx.EVT_MENU, self.CloseCurrentPage, id=self.closePageId)
@@ -396,6 +395,7 @@ class MainFrame(wx.Frame):
self.Bind(wx.EVT_MENU, self.AdditionsTabSelect, id = self.additionstab2)
self.Bind(wx.EVT_MENU, self.AdditionsTabSelect, id = self.additionstab3)
self.Bind(wx.EVT_MENU, self.AdditionsTabSelect, id = self.additionstab4)
self.Bind(wx.EVT_MENU, self.AdditionsTabSelect, id = self.additionstab5)
actb = [(wx.ACCEL_CTRL, ord('T'), self.addPageId),
(wx.ACCEL_CMD, ord('T'), self.addPageId),
@@ -416,10 +416,12 @@ class MainFrame(wx.Frame):
(wx.ACCEL_CTRL, ord('2'), self.additionstab2),
(wx.ACCEL_CTRL, ord('3'), self.additionstab3),
(wx.ACCEL_CTRL, ord('4'), self.additionstab4),
(wx.ACCEL_CTRL, ord('5'), self.additionstab5),
(wx.ACCEL_CMD, ord('1'), self.additionstab1),
(wx.ACCEL_CMD, ord('2'), self.additionstab2),
(wx.ACCEL_CMD, ord('3'), self.additionstab3),
(wx.ACCEL_CMD, ord('4'), self.additionstab4)
(wx.ACCEL_CMD, ord('4'), self.additionstab4),
(wx.ACCEL_CMD, ord('5'), self.additionstab5)
]
atable = wx.AcceleratorTable(actb)
self.SetAcceleratorTable(atable)
@@ -434,7 +436,8 @@ class MainFrame(wx.Frame):
selTab = 2
if event.GetId() == self.additionstab4:
selTab = 3
if event.GetId() == self.additionstab5:
selTab = 4
if selTab is not None:
self.additionsPane.notebook.SetSelection(selTab)

View File

@@ -33,7 +33,6 @@ class MainMenuBar(wx.MenuBar):
self.exportSkillsNeededId = wx.NewId()
self.importCharacterId = wx.NewId()
self.exportHtmlId = wx.NewId()
self.preferencesId = wx.NewId()
self.wikiId = wx.NewId()
self.forumId = wx.NewId()
@@ -59,7 +58,6 @@ class MainMenuBar(wx.MenuBar):
fileMenu.AppendSeparator()
fileMenu.Append(wx.ID_EXIT)
# Edit menu
editMenu = wx.Menu()
self.Append(editMenu, "&Edit")
@@ -67,7 +65,6 @@ class MainMenuBar(wx.MenuBar):
#editMenu.Append(wx.ID_UNDO)
#editMenu.Append(wx.ID_REDO)
copyText = "&To Clipboard" + ("\tCTRL+C" if 'wxMSW' in wx.PlatformInfo else "")
pasteText = "&From Clipboard" + ("\tCTRL+V" if 'wxMSW' in wx.PlatformInfo else "")
editMenu.Append(wx.ID_COPY, copyText, "Export a fit to the clipboard")
@@ -89,13 +86,9 @@ class MainMenuBar(wx.MenuBar):
graphFrameItem.SetBitmap(bitmapLoader.getBitmap("graphs_small", "icons"))
windowMenu.AppendItem(graphFrameItem)
#=======================================================================
# DISABLED FOR RC2 Release
#
preferencesItem = wx.MenuItem(windowMenu, self.preferencesId, "Preferences\tCTRL+P")
preferencesItem = wx.MenuItem(windowMenu, wx.ID_PREFERENCES, "Preferences\tCTRL+P")
preferencesItem.SetBitmap(bitmapLoader.getBitmap("preferences_small", "icons"))
windowMenu.AppendItem(preferencesItem)
#=======================================================================
# Help menu
helpMenu = wx.Menu()
@@ -108,8 +101,6 @@ class MainMenuBar(wx.MenuBar):
if config.debug:
helpMenu.Append( self.mainFrame.widgetInspectMenuID, "Open Widgets Inspect tool", "Open Widgets Inspect tool")
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
def fitChanged(self, event):

View File

@@ -132,20 +132,28 @@ class exportHtmlThread(threading.Thread):
if len(fits) > 0:
groupFits += len(fits)
# Ship group header
HTMLship = (
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
' <h2>' + ship.name + ' <span class="ui-li-count">'+str(len(fits))+'</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n')
for fit in fits:
if len(fits) == 1:
if self.stopRunning:
return;
return
fit = fits[0]
dnaFit = sFit.exportDna(fit[0])
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[1] + '</a></li>\n'
HTMLgroup += (
' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + fit[1] + '</a></li>\n')
else:
# Ship group header
HTMLship = (
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
' <h2>' + ship.name + ' <span class="ui-li-count">'+str(len(fits))+'</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n')
HTMLgroup += HTMLship + (' </ul>\n'
' </li>\n')
for fit in fits:
if self.stopRunning:
return
dnaFit = sFit.exportDna(fit[0])
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[1] + '</a></li>\n'
HTMLgroup += HTMLship + (' </ul>\n'
' </li>\n')
if groupFits > 0:
# Market group header
HTML += (