From ccd13e1b20cdb5e4ac6d1a24ee1d8ae6eafb028a Mon Sep 17 00:00:00 2001 From: Corollax Date: Tue, 2 Nov 2010 11:46:52 -0500 Subject: [PATCH 1/9] Fix a spacing issue in __init__.py No biggie. --- eos | 2 +- gui/builtinViewColumns/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eos b/eos index 6f6c3b488..04ea363d0 160000 --- a/eos +++ b/eos @@ -1 +1 @@ -Subproject commit 6f6c3b488044102879fff4358f97f881224e616b +Subproject commit 04ea363d0bf28b81f32206130d60a257ff194994 diff --git a/gui/builtinViewColumns/__init__.py b/gui/builtinViewColumns/__init__.py index a9aff35e8..f85f4bd13 100644 --- a/gui/builtinViewColumns/__init__.py +++ b/gui/builtinViewColumns/__init__.py @@ -1,5 +1,5 @@ __all__ = ["moduleState", "moduleName", "attributeDisplay", "maxRange", "name", "droneDps", "droneNameAmount", "droneCheckbox", "moduleAmmo", "capacitorUse", "activityCheckbox", "moduleAmmoIcon", "modulePrice", - "projectedName", "projectedState", "projectedAmmoIcon", "projectedAmmo", - "moduleTracking"] + "projectedName", "projectedState", "projectedAmmoIcon", + "projectedAmmo", "moduleTracking"] From f52639f7f14685f253d12bcb9d2b6f37f2f2b16b Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Tue, 2 Nov 2010 22:04:40 +0200 Subject: [PATCH 2/9] Added a little padding for values in resource pane --- gui/builtinStatsViews/resourcesViewFull.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/builtinStatsViews/resourcesViewFull.py b/gui/builtinStatsViews/resourcesViewFull.py index 2ad4061d7..7934a7c5f 100644 --- a/gui/builtinStatsViews/resourcesViewFull.py +++ b/gui/builtinStatsViews/resourcesViewFull.py @@ -75,7 +75,7 @@ class ResourcesViewFull(StatsView): suffix = {'turret':'Hardpoints', 'launcher':'Hardpoints', 'drones':'Active', 'calibration':'Points'} lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr(self, "label%sUsed%s%s" % (panel.capitalize(), type.capitalize(), suffix[type].capitalize()), lbl) - box.Add(lbl, 0, wx.ALIGN_CENTER) + box.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5) box.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER) @@ -109,7 +109,7 @@ class ResourcesViewFull(StatsView): lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr(self, "label%sUsed%s" % (panel.capitalize(), capitalizedType), lbl) - absolute.Add(lbl, 0, wx.ALIGN_LEFT) + absolute.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3) absolute.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_LEFT) From a4f6916fbce4e149291a74783b34c1c2bd0f6fc3 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Tue, 2 Nov 2010 22:28:51 +0200 Subject: [PATCH 3/9] Added an event for doing a full content refresh in shipbrowser (for active stage) --- gui/shipBrowser.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index e146d7afc..9c423010f 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -19,6 +19,7 @@ Stage1Selected, EVT_SB_STAGE1_SEL = wx.lib.newevent.NewEvent() Stage2Selected, EVT_SB_STAGE2_SEL = wx.lib.newevent.NewEvent() Stage3Selected, EVT_SB_STAGE3_SEL = wx.lib.newevent.NewEvent() SearchSelected, EVT_SB_SEARCH_SEL = wx.lib.newevent.NewEvent() +SBRefreshContent, EVT_SB_REFRESH_CONTENT = wx.lib.newevent.NewEvent() class ShipBrowser(wx.Panel): def __init__(self, parent): @@ -63,10 +64,16 @@ class ShipBrowser(wx.Panel): self.Bind(EVT_SB_STAGE1_SEL, self.stage1) self.Bind(EVT_SB_STAGE3_SEL, self.stage3) self.Bind(EVT_SB_SEARCH_SEL, self.searchStage) + self.Bind(EVT_SB_REFRESH_CONTENT, self.RefreshContent) self.mainFrame.Bind(fv.FIT_CHANGED, self.RefreshList) self.stage1(None) + def RefreshContent(self,event): + stage = self.GetActiveStage() + stageData = self.GetStageData(stage) + self.hpane.gotoStage(stage, stageData) + def RefreshList(self, event): stage = self.GetActiveStage() if stage == 3 or stage == 4: From e0624b3d7dedc3734beebd931033cd6a8917f5db Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Tue, 2 Nov 2010 22:37:48 +0200 Subject: [PATCH 4/9] No event, just method --- gui/shipBrowser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 9c423010f..e1485492f 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -19,7 +19,7 @@ Stage1Selected, EVT_SB_STAGE1_SEL = wx.lib.newevent.NewEvent() Stage2Selected, EVT_SB_STAGE2_SEL = wx.lib.newevent.NewEvent() Stage3Selected, EVT_SB_STAGE3_SEL = wx.lib.newevent.NewEvent() SearchSelected, EVT_SB_SEARCH_SEL = wx.lib.newevent.NewEvent() -SBRefreshContent, EVT_SB_REFRESH_CONTENT = wx.lib.newevent.NewEvent() + class ShipBrowser(wx.Panel): def __init__(self, parent): @@ -64,12 +64,12 @@ class ShipBrowser(wx.Panel): self.Bind(EVT_SB_STAGE1_SEL, self.stage1) self.Bind(EVT_SB_STAGE3_SEL, self.stage3) self.Bind(EVT_SB_SEARCH_SEL, self.searchStage) - self.Bind(EVT_SB_REFRESH_CONTENT, self.RefreshContent) + self.mainFrame.Bind(fv.FIT_CHANGED, self.RefreshList) self.stage1(None) - def RefreshContent(self,event): + def RefreshContent(self): stage = self.GetActiveStage() stageData = self.GetStageData(stage) self.hpane.gotoStage(stage, stageData) From 0b3d1d0e2a2d683ba8e94baaeb44702e4add0086 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Tue, 2 Nov 2010 22:44:00 +0200 Subject: [PATCH 5/9] Shipbrowser content is refreshed after an import is done --- gui/mainFrame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 3ee31b015..65a37c178 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -186,7 +186,7 @@ class MainFrame(wx.Frame): if importCount == 1: if self.getActiveFit() != fitIDs[0]: wx.PostEvent(self, FitSelected(fitID=fitIDs[0])) - + self.shipBrowser.RefreshContent() def showExportDialog(self, event): dlg=wx.FileDialog( self, From 1c0fb855acfe193ae43b098f1c902a180fb685ac Mon Sep 17 00:00:00 2001 From: Corollax Date: Tue, 2 Nov 2010 15:54:32 -0500 Subject: [PATCH 6/9] Update tooltip if all ship prerequisites are met And put out a message to that effect --- eos | 2 +- gui/characterSelection.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eos b/eos index 04ea363d0..50cfd51f1 160000 --- a/eos +++ b/eos @@ -1 +1 @@ -Subproject commit 04ea363d0bf28b81f32206130d60a257ff194994 +Subproject commit 50cfd51f128ccad1f480f17a670eaed461b1e6e7 diff --git a/gui/characterSelection.py b/gui/characterSelection.py index 3cc0f985c..f06e85d6b 100644 --- a/gui/characterSelection.py +++ b/gui/characterSelection.py @@ -115,12 +115,12 @@ class CharacterSelection(wx.Panel): sCharacter = service.Character.getInstance() reqs = sCharacter.checkRequirements(fit) if len(reqs) == 0: + tip = "All prerequisites have been met" self.skillReqsStaticBitmap.SetBitmap(self.greenSkills) - self.skillReqsStaticBitmap.SetToolTip(None) else: tip = self._buildSkillsTooltip(reqs) self.skillReqsStaticBitmap.SetBitmap(self.redSkills) - self.skillReqsStaticBitmap.SetToolTipString(tip.strip()) + self.skillReqsStaticBitmap.SetToolTipString(tip.strip()) if newCharID == None: cChar = service.Character.getInstance() From 5edb712fae80d645475f117433a72833ad1ae00d Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Tue, 2 Nov 2010 23:08:17 +0200 Subject: [PATCH 7/9] Stuff already there but ppl have no eyes to see it. Closes #277 --- gui/mainFrame.py | 16 +++++++++------- gui/mainMenuBar.py | 16 ++++++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 65a37c178..380d6df96 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -112,6 +112,9 @@ class MainFrame(wx.Frame): self.SetSizer(mainSizer) + self.addTabId = wx.NewId() + self.closeTabId = wx.NewId() + #Add menu self.SetMenuBar(MainMenuBar()) #self.SetToolBar(MainToolBar(self)) @@ -246,17 +249,16 @@ class MainFrame(wx.Frame): #Clipboard exports self.Bind(wx.EVT_MENU, self.exportToClipboard, id=wx.ID_COPY) - addTabId = wx.NewId() toggleShipMarketId = wx.NewId() # Close Tab - self.Bind(wx.EVT_MENU, self.CloseCurrentFit, id=wx.ID_CLOSE) - self.Bind(wx.EVT_MENU,self.HAddTab, id = addTabId) + self.Bind(wx.EVT_MENU, self.CloseCurrentFit, id=self.closeTabId) + self.Bind(wx.EVT_MENU,self.HAddTab, id = self.addTabId) self.Bind(wx.EVT_MENU,self.toggleShipMarket, id = toggleShipMarketId) - actb = [(wx.ACCEL_CTRL, ord('T'), addTabId), - (wx.ACCEL_CMD, ord('T'), addTabId), - (wx.ACCEL_CTRL, ord("W"), wx.ID_CLOSE), - (wx.ACCEL_CMD, ord("W"), wx.ID_CLOSE), + actb = [(wx.ACCEL_CTRL, ord('T'), self.addTabId), + (wx.ACCEL_CMD, ord('T'), self.addTabId), + (wx.ACCEL_CTRL, ord("W"), self.closeTabId), + (wx.ACCEL_CMD, ord("W"), self.closeTabId), (wx.ACCEL_CTRL, ord(" "), toggleShipMarketId), (wx.ACCEL_CMD, ord(" "), toggleShipMarketId)] atable = wx.AcceleratorTable(actb) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 8619d9ede..19c8ab029 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -28,21 +28,25 @@ class MainMenuBar(wx.MenuBar): self.damagePatternEditorId = wx.NewId() self.backupFitsId = wx.NewId() + self.mainFrame = gui.mainFrame.MainFrame.getInstance() + wx.MenuBar.__init__(self) # File menu fileMenu = wx.Menu() self.Append(fileMenu, "&File") - if 'wxMSW' in wx.PlatformInfo: - fileMenu.Append(wx.ID_CLOSE, "&Close\tCTRL+W", "Close the currently open fit") - else: - fileMenu.Append(wx.ID_CLOSE) - fileMenu.Append(wx.ID_EXIT) + + fileMenu.Append(self.mainFrame.addTabId, "New fitting tab\tCTRL+T", "Close the currently open fit") + fileMenu.Append(self.mainFrame.closeTabId, "Close current fitting tab\tCTRL+W", "Close the currently open fit") fileMenu.AppendSeparator() + fileMenu.Append(self.backupFitsId, "&Backup fits", "Backup all fittings to a XML file") fileMenu.Append(wx.ID_OPEN, "&Import\tCTRL+O", "Import a fit into pyfa.") fileMenu.Append(wx.ID_SAVEAS, "&Export\tCTRL+S", "Export the fit to another format.") + fileMenu.AppendSeparator() + fileMenu.Append(wx.ID_EXIT) + # Edit menu editMenu = wx.Menu() @@ -79,7 +83,7 @@ class MainMenuBar(wx.MenuBar): helpMenu.Append(911,"Open Widgets Inspect tool", "Open Widgets Inspect tool") - self.mainFrame = gui.mainFrame.MainFrame.getInstance() + self.mainFrame.Bind(gui.fittingView.FIT_CHANGED, self.fitChanged) def fitChanged(self, event): From c1cb0e41c50e97870e344e666abbd2b131c461ad Mon Sep 17 00:00:00 2001 From: Corollax Date: Wed, 3 Nov 2010 02:47:20 -0500 Subject: [PATCH 8/9] Cleaned up the menu bar a touch. Added some alt-key accelerators, that sort of thing. --- eos | 2 +- gui/mainMenuBar.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eos b/eos index 50cfd51f1..92007b0d5 160000 --- a/eos +++ b/eos @@ -1 +1 @@ -Subproject commit 50cfd51f128ccad1f480f17a670eaed461b1e6e7 +Subproject commit 92007b0d59e1f35d21debbd7042c13246bf7b26a diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 19c8ab029..2bddf751f 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -36,15 +36,15 @@ class MainMenuBar(wx.MenuBar): fileMenu = wx.Menu() self.Append(fileMenu, "&File") - fileMenu.Append(self.mainFrame.addTabId, "New fitting tab\tCTRL+T", "Close the currently open fit") - fileMenu.Append(self.mainFrame.closeTabId, "Close current fitting tab\tCTRL+W", "Close the currently open fit") + fileMenu.Append(self.mainFrame.addTabId, "&New Tab\tCTRL+T", "Open a new fitting tab") + fileMenu.Append(self.mainFrame.closeTabId, "&Close Tab\tCTRL+W", "Close the current fit") fileMenu.AppendSeparator() fileMenu.Append(self.backupFitsId, "&Backup fits", "Backup all fittings to a XML file") fileMenu.Append(wx.ID_OPEN, "&Import\tCTRL+O", "Import a fit into pyfa.") fileMenu.Append(wx.ID_SAVEAS, "&Export\tCTRL+S", "Export the fit to another format.") - fileMenu.AppendSeparator() + fileMenu.Append(wx.ID_EXIT) From 1dc258b9adda73a5d7317d38891552821653e875 Mon Sep 17 00:00:00 2001 From: Corollax Date: Wed, 3 Nov 2010 02:57:14 -0500 Subject: [PATCH 9/9] Refined the open/save dialog menus Just adding some consistency to UI convention. --- gui/mainFrame.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 380d6df96..0c5a6e268 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -172,7 +172,7 @@ class MainFrame(wx.Frame): sFit = service.Fit.getInstance() dlg=wx.FileDialog( self, - "Choose one or more fitting files to import", + "Open One Or More Fitting Files", wildcard = "EFT text fitting files (*.cfg)|*.cfg|EvE XML fitting files (*.xml)|*.xml|All Files (*)|*", style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE) if (dlg.ShowModal() == wx.ID_OK): @@ -193,7 +193,7 @@ class MainFrame(wx.Frame): def showExportDialog(self, event): dlg=wx.FileDialog( self, - "Choose a file to export the current fitting to", + "Save Fitting As...", wildcard = "EFT text fitting files (*.cfg)|*.cfg|EvE XML fitting files (*.xml)|*.xml", style = wx.FD_SAVE) if (dlg.ShowModal() == wx.ID_OK): @@ -327,7 +327,7 @@ class MainFrame(wx.Frame): sFit = service.Fit.getInstance() saveDialog = wx.FileDialog( self, - "Choose where to save the backup", + "Save Backup As...", wildcard = "EvE XML fitting file (*.xml)|*.xml", style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if (saveDialog.ShowModal() == wx.ID_OK):