From cdae0d634d1cb7831b1677c9a0b1a63160d81f62 Mon Sep 17 00:00:00 2001 From: Lucas Thode Date: Wed, 27 Oct 2010 18:01:58 -0500 Subject: [PATCH 1/4] Fixed bug with file-extension handling in export. --- gui/mainFrame.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 64f78ac75..33b5fec46 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -183,10 +183,12 @@ class MainFrame(wx.Frame): path = dlg.GetPath() if (format == 0): output = sFit.exportFit(self.getActiveFit()) - path += ".cfg" + if not path.endswith(".cfg"): + path += ".cfg" elif (format == 1): output = sFit.exportXml(self.getActiveFit()) - path += ".xml" + if not path.endswith(".xml"): + path += ".xml" else: print "oops, invalid fit format %d" % format dlg.Destroy() @@ -279,7 +281,9 @@ class MainFrame(wx.Frame): style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if (saveDialog.ShowModal() == wx.ID_OK): filePath = saveDialog.GetPath() - sFit.backupFits(filePath) + if not filePath.endswith(".xml"): + filePath += ".xml" + sFit.backupFits(filePath ) saveDialog.Destroy() def toggleShipBrowser(self, event): From 9f4f081ea08d0dfb931b3d2d9679eaabbff9817e Mon Sep 17 00:00:00 2001 From: Lucas Thode Date: Thu, 28 Oct 2010 08:26:06 -0500 Subject: [PATCH 2/4] Improved file-extension handling. --- gui/mainFrame.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 33b5fec46..c85514d32 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -34,6 +34,7 @@ from gui.preferenceDialog import PreferenceDialog import aboutData import gui.fittingView as fv from wx._core import PyDeadObjectError +import os.path class MainFrame(wx.Frame): __instance = None @@ -183,11 +184,11 @@ class MainFrame(wx.Frame): path = dlg.GetPath() if (format == 0): output = sFit.exportFit(self.getActiveFit()) - if not path.endswith(".cfg"): + if '.' not in os.path.basename(path): path += ".cfg" elif (format == 1): output = sFit.exportXml(self.getActiveFit()) - if not path.endswith(".xml"): + if '.' not in os.path.basename(path): path += ".xml" else: print "oops, invalid fit format %d" % format @@ -281,7 +282,7 @@ class MainFrame(wx.Frame): style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if (saveDialog.ShowModal() == wx.ID_OK): filePath = saveDialog.GetPath() - if not filePath.endswith(".xml"): + if '.' not in os.path.basename(filePath): filePath += ".xml" sFit.backupFits(filePath ) saveDialog.Destroy() From fd63a83a87cc4dfa9becaaf1c13c20568fd44a2e Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 28 Oct 2010 17:54:01 +0300 Subject: [PATCH 3/4] Fixed header status static text not shown properly on wxgtk --- gui/shipBrowser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 983e26fea..3c106438d 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -305,7 +305,7 @@ class HeaderPane (wx.Panel): self.sbSearch.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) self.Layout() -# self.spanel.Hide() + self.spanel.Hide() self.search.Hide() def OnLeftDown(self, event): @@ -318,7 +318,7 @@ class HeaderPane (wx.Panel): def scheduleSearch(self, event): if self.inPopup: - return + return search = self.search.GetValue() if len(search) < 3 and len(search) >0: if self.inSearch == True: @@ -383,6 +383,7 @@ class HeaderPane (wx.Panel): return if self.toggleSearch == 1: self.search.Show(False) + self.spanel.Show(False) self.toggleSearch = -1 # if self.menu: @@ -400,6 +401,7 @@ class HeaderPane (wx.Panel): def editCheckEsc(self, event): if event.GetKeyCode() == wx.WXK_ESCAPE: self.search.Show(False) + self.spanel.Show(False) self.toggleSearch = -1 else: event.Skip() @@ -508,6 +510,7 @@ class HeaderPane (wx.Panel): self.toggleSearch = -1 return if not self.search.IsShown(): + self.spanel.Show(True) self.search.Show(True) self.search.SetFocus() self.toggleSearch = 1 @@ -516,6 +519,7 @@ class HeaderPane (wx.Panel): else: self.search.Show(False) + self.spanel.Show(False) self.toggleSearch = -1 self.Layout() event.Skip() From 218701be4719b18038c1e44b4dea50ecda3b1cd1 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 28 Oct 2010 18:12:43 +0300 Subject: [PATCH 4/4] Fixed ticket #194 , wx.DOUBLE_BORDER style applies only on wxMSW and wxMAC; using wx.SIMPLE_BORDER for wxMAC and wxGTK --- gui/builtinStatsViews/resistancesViewFull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/builtinStatsViews/resistancesViewFull.py b/gui/builtinStatsViews/resistancesViewFull.py index 4d68a12b0..629087ed9 100644 --- a/gui/builtinStatsViews/resistancesViewFull.py +++ b/gui/builtinStatsViews/resistancesViewFull.py @@ -89,7 +89,7 @@ class ResistancesViewFull(StatsView): bitmap.SetToolTip(tooltip) sizerResistances.Add(bitmap, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER) col+=1 - self.stEHPs = wx.StaticText(contentPanel, wx.ID_ANY, "EHP", style = wx.DOUBLE_BORDER) + self.stEHPs = wx.StaticText(contentPanel, wx.ID_ANY, "EHP", style = wx.SIMPLE_BORDER if 'wxGTK' in wx.PlatformInfo else wx.DOUBLE_BORDER) self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP")) self.stEHPs.Bind(wx.EVT_LEFT_UP, self.toggleEHP)