From c862a04b37a8763edffe32faacbf3ae9a49f657e Mon Sep 17 00:00:00 2001 From: Lucas Thode Date: Mon, 25 Oct 2010 02:45:47 -0500 Subject: [PATCH 1/2] Added Close item to File menu to close current fit We should remove the silly MMB support now that File->Close is in place (also, that gives us Ctrl/Cmd-W support "for free") --- gui/mainFrame.py | 8 ++++++++ gui/mainMenuBar.py | 1 + 2 files changed, 9 insertions(+) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index a935dc2a1..c98218c43 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -114,6 +114,12 @@ class MainFrame(wx.Frame): tab, _ = self.notebookBrowsers.HitTest(event.Position) if tab != -1: self.notebookBrowsers.SetSelection(tab) + + def CloseCurrentFit(self, evt): + self.fitMultiSwitch.removeTab(self.fitMultiSwitch.GetSelection()) + #Deleting a tab might have put us on the "+" tab, make sure we don't stay there + if self.fitMultiSwitch.GetSelection() == self.fitMultiSwitch.GetPageCount() - 1: + self.fitMultiSwitch.SetSelection(self.fitMultiSwitch.GetPageCount() - 2) def ExitApp(self, evt): try: @@ -163,6 +169,8 @@ class MainFrame(wx.Frame): menuBar = self.GetMenuBar() # Quit self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT) + # Close Tab + self.Bind(wx.EVT_MENU, self.CloseCurrentFit, id=wx.ID_CLOSE) # Widgets Inspector self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911) # About diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 129944ab8..5c827a310 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -32,6 +32,7 @@ class MainMenuBar(wx.MenuBar): # File menu fileMenu = wx.Menu() self.Append(fileMenu, "&File") + fileMenu.Append(wx.ID_CLOSE) fileMenu.Append(wx.ID_EXIT) From 200acf40ea3f18e3a0db3793cad828cb7167eeab Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Mon, 25 Oct 2010 09:47:27 +0200 Subject: [PATCH 2/2] TYPO ALERT --- service/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/settings.py b/service/settings.py index cf9ef5c14..813985ade 100644 --- a/service/settings.py +++ b/service/settings.py @@ -28,7 +28,7 @@ class SettingsProvider(): @classmethod def getInstance(cls): if cls._instance == None: - cls.instance = Settings() + cls.instance = SettingsProvider() return cls.instance