From cc2d9a93913e8290ba8492c976e958e19b4a145b Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 13:37:32 +0300 Subject: [PATCH 1/9] Removed the test if saveddata.db exists, sqlalchemy checks it anyway --- run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run.py b/run.py index ca02c8bb3..f6f4feb92 100644 --- a/run.py +++ b/run.py @@ -30,8 +30,7 @@ if __name__ == "__main__": if not os.path.exists(config.homePath): os.mkdir(config.homePath) - if not os.path.exists(config.saveddata): - eos.db.saveddata_meta.create_all() + eos.db.saveddata_meta.create_all() pyfa = wx.App(False) MainFrame() From 4d102c5d8a802ce55afcfc0f150ff8a315205d80 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 17:06:30 +0300 Subject: [PATCH 2/9] Fixed ticket #84, it seems that not only wxmac sux but wxgtk too, character editor remade as wx.frame + some tricks to emulate a modal dialog --- gui/characterEditor.py | 11 +++++++---- gui/mainFrame.py | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index ab03c1e06..9d1ca2a08 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -31,13 +31,15 @@ import sys CharListUpdated, CHAR_LIST_UPDATED = wx.lib.newevent.NewEvent() CharChanged, CHAR_CHANGED = wx.lib.newevent.NewEvent() -class CharacterEditor(wx.Dialog): +class CharacterEditor(wx.Frame): def __init__(self, parent): - wx.Dialog.__init__ (self, parent, id=wx.ID_ANY, title=u"pyfa: Character Editor", pos=wx.DefaultPosition, - size=wx.Size(641, 600), style=wx.CAPTION | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) + wx.Frame.__init__ (self, parent, id=wx.ID_ANY, title=u"pyfa: Character Editor", pos=wx.DefaultPosition, + size=wx.Size(641, 600), style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_FLOAT_ON_PARENT|wx.TAB_TRAVERSAL) + self.disableWin=wx.WindowDisabler(self) self.SetSizeHintsSz(wx.Size(640, 600), wx.DefaultSize) - + self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) + mainSizer = wx.BoxSizer(wx.VERTICAL) self.navSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -120,6 +122,7 @@ class CharacterEditor(wx.Dialog): def editingFinished(self, event): wx.PostEvent(self.mainFrame, CharListUpdated()) + self.Destroy() event.Skip() def registerEvents(self): diff --git a/gui/mainFrame.py b/gui/mainFrame.py index cb41f2e58..452a697ba 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -125,9 +125,9 @@ class MainFrame(wx.Frame): wx.AboutBox(info) def showCharacterEditor(self, event): - dlg=CharacterEditor(None) - dlg.ShowModal() - dlg.Destroy() + dlg=CharacterEditor(self) + dlg.Show() + cFit = service.Fit.getInstance() cFit.clearFit(self.getActiveFit()) wx.PostEvent(self, fv.FitChanged(fitID=self.getActiveFit())) From 2e51ffde138c80450177469662f10e3baec96a8b Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 18:21:37 +0300 Subject: [PATCH 3/9] Little misspelling fix --- gui/characterEditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 9d1ca2a08..a78e9b4a5 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -268,7 +268,7 @@ class SkillTreeView (wx.Panel): self.levelIds = {} idUnlearned = wx.NewId() - self.levelIds[idUnlearned] = "Not Learned" + self.levelIds[idUnlearned] = "Not learned" self.levelChangeMenu.Append(idUnlearned, "Unlearn") for level in xrange(6): From d00325470b70674b6f2aaa08bfbcb421197b97fc Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 19:35:58 +0300 Subject: [PATCH 4/9] Fixed context menu getting closed when releasing right mouse button --- gui/fittingView.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/fittingView.py b/gui/fittingView.py index 8b94811a6..567a5d1f4 100644 --- a/gui/fittingView.py +++ b/gui/fittingView.py @@ -42,7 +42,7 @@ class FittingView(d.Display): d.Display.__init__(self, parent) self.mainFrame.Bind(FIT_CHANGED, self.fitChanged) self.Bind(wx.EVT_LEFT_DCLICK, self.removeItem) - self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu) + self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.scheduleMenu) self.activeFitID = None #Gets called from the fitMultiSwitch when it decides its time @@ -131,4 +131,4 @@ class FittingView(d.Display): contexts.append("ship") menu = ContextMenu.getMenu(selection, *contexts) - self.PopupMenu(menu) \ No newline at end of file + self.PopupMenu(menu) From ff18cc9dfc1f691d33253167364b6868e09247d1 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 19:42:14 +0300 Subject: [PATCH 5/9] Revert "Fixed context menu getting closed when releasing right mouse button" This reverts commit d00325470b70674b6f2aaa08bfbcb421197b97fc. --- gui/fittingView.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/fittingView.py b/gui/fittingView.py index 567a5d1f4..8b94811a6 100644 --- a/gui/fittingView.py +++ b/gui/fittingView.py @@ -42,7 +42,7 @@ class FittingView(d.Display): d.Display.__init__(self, parent) self.mainFrame.Bind(FIT_CHANGED, self.fitChanged) self.Bind(wx.EVT_LEFT_DCLICK, self.removeItem) - self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.scheduleMenu) + self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu) self.activeFitID = None #Gets called from the fitMultiSwitch when it decides its time @@ -131,4 +131,4 @@ class FittingView(d.Display): contexts.append("ship") menu = ContextMenu.getMenu(selection, *contexts) - self.PopupMenu(menu) + self.PopupMenu(menu) \ No newline at end of file From f042041c93b3466df888d78d917fc3d3e7a16bf3 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 20:23:20 +0300 Subject: [PATCH 6/9] Fixed context menu misbehaviour on wxgtk in fittingview --- gui/fittingView.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/fittingView.py b/gui/fittingView.py index 8b94811a6..0cd08f933 100644 --- a/gui/fittingView.py +++ b/gui/fittingView.py @@ -42,7 +42,11 @@ class FittingView(d.Display): d.Display.__init__(self, parent) self.mainFrame.Bind(FIT_CHANGED, self.fitChanged) self.Bind(wx.EVT_LEFT_DCLICK, self.removeItem) - self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu) + if "__WXGTK__" in wx.PlatformInfo: + self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu) + else: + self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu) + self.activeFitID = None #Gets called from the fitMultiSwitch when it decides its time @@ -131,4 +135,4 @@ class FittingView(d.Display): contexts.append("ship") menu = ContextMenu.getMenu(selection, *contexts) - self.PopupMenu(menu) \ No newline at end of file + self.PopupMenu(menu) From 799bd084255f01cbd4de1c769abcd92cd5b44fe5 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 20:44:00 +0300 Subject: [PATCH 7/9] Fixed a small bug in context menu, we didn't checked if selection is empty - marketbrowser --- gui/marketBrowser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/marketBrowser.py b/gui/marketBrowser.py index db859f002..64471e96a 100644 --- a/gui/marketBrowser.py +++ b/gui/marketBrowser.py @@ -314,7 +314,8 @@ class MarketBrowser(wx.Panel): itemId = self.itemView.GetItemData(sel) sel = self.itemView.GetNextSelected(sel) selection.append(cMarket.getItem(itemId)) - + if len(selection) == 0: + return menu = ContextMenu.getMenu(selection, "item") self.PopupMenu(menu) From c1ec68ed8296a97914aed9062f27657677fb55ed Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 20:51:05 +0300 Subject: [PATCH 8/9] Added proper icon to chareditor window (it has none on msw, it inherited the parent icon on wxgtk) --- gui/characterEditor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index a78e9b4a5..0263c7b2d 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -36,6 +36,9 @@ class CharacterEditor(wx.Frame): wx.Frame.__init__ (self, parent, id=wx.ID_ANY, title=u"pyfa: Character Editor", pos=wx.DefaultPosition, size=wx.Size(641, 600), style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_FLOAT_ON_PARENT|wx.TAB_TRAVERSAL) + i = wx.IconFromBitmap(bitmapLoader.getBitmap("character_small", "icons")) + self.SetIcon(i) + self.disableWin=wx.WindowDisabler(self) self.SetSizeHintsSz(wx.Size(640, 600), wx.DefaultSize) self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) From babe9a4d327344caab7f4e9cd8b6a20106184e81 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 7 Oct 2010 22:15:43 +0300 Subject: [PATCH 9/9] Removed a print leftover --- gui/itemStats.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gui/itemStats.py b/gui/itemStats.py index 3f70267e6..b6fffc66d 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -295,9 +295,7 @@ class ItemAffectedBy (wx.Panel): self.effectList.InsertColumn(0,"Name") self.effectList.setResizeColumn(0) - - print stuff.itemModifiedAttributes._ModifiedAttributeDict__affectedBy - + effects = item.effects names = list(effects.iterkeys()) names.sort()