multiple frequencies on matrix
[iramuteq] / tree.py
diff --git a/tree.py b/tree.py
index d1df2d6..532457f 100644 (file)
--- a/tree.py
+++ b/tree.py
@@ -11,7 +11,7 @@ import logging
 from openanalyse import OpenAnalyse
 from corpus import Corpus, copycorpus
 from tableau import Tableau, copymatrix
-from functions import DoConf, GetTxtProfile, TGen
+from functions import DoConf, GetTxtProfile, TGen, BugReport
 from profile_segment import ProfileSegment, ProfilType
 from search_tools import SearchFrame
 from dialog import PrefSimpleFile, PrefExport
@@ -123,6 +123,7 @@ class LeftTree(CT.CustomTreeCtrl):
         imgmatroot = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'matroot.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
         self.ild['matrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'matrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
         self.ild['freq'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'frequences.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
+        self.ild['freqmulti'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'frequences.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
         self.ild['chi2'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'chi2.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
         self.ild['reinertmatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'reinertmatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
         self.ild['simimatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simimatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
@@ -383,8 +384,8 @@ class LeftTree(CT.CustomTreeCtrl):
         
         if not item in [self.textroot, self.matroot] :
             menu = wx.Menu()
-            info = menu.Append(wx.ID_ANY, _(u"Informations").encode('utf8'))
-            rename = menu.Append(wx.ID_ANY, _(u"Rename").encode('utf8'))
+            info = menu.Append(wx.ID_ANY, _(u"Informations").decode('utf8'))
+            rename = menu.Append(wx.ID_ANY, _(u"Rename").decode('utf8'))
             menu.AppendSeparator()
     
             if 'corpus_name' in pydata :
@@ -1030,12 +1031,19 @@ class LeftTree(CT.CustomTreeCtrl):
             elif pydata['uuid'] in ['textroot', 'matroot'] :
                 pass
             else :
-                busy = wx.BusyInfo(_("Please wait..."), self.parent)
-                wx.SafeYield()
-                OpenAnalyse(self.parent, pydata)
-                del busy
-                self.SetItemBold(item, True)
-                self.OnSelChanged(pydata = pydata)
+                if os.path.exists(pydata['ira']) :
+                    busy = wx.BusyInfo(_("Please wait..."), self.parent)
+                    wx.SafeYield()
+                    try :
+                        OpenAnalyse(self.parent, pydata)
+                        del busy
+                        self.SetItemBold(item, True)
+                        self.OnSelChanged(pydata = pydata)
+                    except :
+                        del busy
+                        BugReport(self.ira)
+                else :
+                    wx.MessageBox(_(u"This file does not exist : %s" % pydata['ira']).decode('utf8'), 'Information', wx.ICON_EXCLAMATION | wx.STAY_ON_TOP )
         #if item and (flags & CT.TREE_HITTEST_ONITEMLABEL):
         #    if self.GetAGWWindowStyleFlag() & CT.TR_EDIT_LABELS:
         #        self.log.info("OnLeftDClick: %s (manually starting label edit)"% self.GetItemText(item) + "\n")