From ab4c9b7b0ac41c8a5e910caff895a5486f80188b Mon Sep 17 00:00:00 2001 From: pierre Date: Sun, 17 Feb 2013 14:55:16 +0100 Subject: [PATCH] search on mac --- Liste.py | 4 ++-- ProfList.py | 8 ++++---- dialog.py | 6 +++--- iramuteq.py | 6 ++++-- listlex.py | 4 ++-- search_tools.py | 4 ++-- setup.py | 3 ++- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Liste.py b/Liste.py index 791ff67..e0bc11a 100644 --- a/Liste.py +++ b/Liste.py @@ -141,8 +141,8 @@ class ListPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorte def onsearch(self, evt) : self.dial = SearchDial(self, self, 0, True) self.dial.CenterOnParent() - self.dial.ShowModal() - self.dial.Destroy() + self.dial.Show() + #self.dial.Destroy() def OnRightClick(self, event): diff --git a/ProfList.py b/ProfList.py index 7802dd8..6667995 100644 --- a/ProfList.py +++ b/ProfList.py @@ -237,16 +237,16 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col def onsearch(self, evt) : self.dial = SearchDial(self, self, 6, True) self.dial.CenterOnParent() - self.dial.ShowModal() - self.dial.Destroy() + self.dial.Show() + #self.dial.Destroy() def onsearchall(self, evt) : if 'FrameSearch' not in dir(self.Source) : self.Source.FrameSearch = SearchFrame(self.parent, -1, u"Rechercher...", self.Source.corpus) self.dial = SearchDial(self, self.Source.FrameSearch.liste, 1, False) self.dial.CenterOnParent() - self.dial.ShowModal() - self.dial.Destroy() + self.dial.Show() + #self.dial.Destroy() def OnRightClick(self, event): diff --git a/dialog.py b/dialog.py index 43aa2c2..86a3780 100755 --- a/dialog.py +++ b/dialog.py @@ -1467,7 +1467,7 @@ class FindInCluster(wx.Frame): # begin wxGlade: MyFrame.__init__ wx.Frame.__init__(self, parent, id) self.spanel = wx.ScrolledWindow(self, -1, style=wx.TAB_TRAVERSAL) - self.sizer1 = wx.FlexGridSizer(len(result)+1,4,0,0) + self.sizer1 = wx.FlexGridSizer(0,4,0,0) self.parent = parent self.formes = {} txt = [u'forme',u'classe',u'chi2',u'voir'] @@ -1553,10 +1553,10 @@ class FindInCluster(wx.Frame): def OnCloseWindow(self, evt): self.Destroy() -class SearchDial ( wx.Dialog ): +class SearchDial ( wx.Frame ): def __init__( self, parent, listctrl, col, shown): - wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) + wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE ) self.parent = parent self.listctrl = listctrl self.col = col diff --git a/iramuteq.py b/iramuteq.py index cf7088a..f33bc90 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -106,7 +106,10 @@ if sys.platform == 'darwin' : else : sys.setdefaultencoding(locale.getpreferredencoding()) #chemin de l'application -AppliPath = os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0]))) +try : + AppliPath = sys._MEIPASS +except : + AppliPath = os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0]))) #chemin des images ImagePath = os.path.join(AppliPath, 'images') #configuration generale @@ -148,7 +151,6 @@ sys.stdout = printer() ConfigPath = ConstructConfigPath(UserConfigPath) - langues = {'french' : wx.LANGUAGE_FRENCH, 'english' : wx.LANGUAGE_ENGLISH,} ##################################################################### diff --git a/listlex.py b/listlex.py index c3a7234..a70b988 100644 --- a/listlex.py +++ b/listlex.py @@ -143,8 +143,8 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor def onsearch(self, evt) : self.dial = SearchDial(self, self, 0, True) self.dial.CenterOnParent() - self.dial.ShowModal() - self.dial.Destroy() + self.dial.Show() + #self.dial.Destroy() def OnRightClick(self, event): if self.menu : diff --git a/search_tools.py b/search_tools.py index ae0776f..d9838a8 100644 --- a/search_tools.py +++ b/search_tools.py @@ -77,7 +77,7 @@ class SearchFrame(wx.Frame): def onsearch(self, evt) : if evt is not None : self.dial = SearchDial(self, self.liste, 1, True) - self.dial.ShowModal() - self.dial.Destroy() + self.dial.Show() + #self.dial.Destroy() else : self.dial = SearchDial(self, self.liste, 1, False) diff --git a/setup.py b/setup.py index b91f510..159d578 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,8 @@ import os DATA_FILES=['configuration','Rscripts','images','dictionnaires','locale', 'Rlib','son_fin.wav', 'gpl-2.0.txt', 'gpl-2.0-fr.txt'] APP = ['iramuteq.py'] OPTIONS = {'argv_emulation': True, - 'iconfile':('images/iraicone.icns')} + 'iconfile':('images/iraicone.icns'), + 'optimize': 1} setup( app=APP, -- 2.7.4