...
[iramuteq] / guifunct.py
index 1641795..b3b0782 100644 (file)
@@ -58,6 +58,7 @@ def get_table_param(self, filename) :
             if self.tableau.parametres['colsep'] == 'tabulation' :
                 self.tableau.parametres['colsep'] = '\t'
             self.tableau.parametres['filetype'] = 'csv'
+            self.tableau.parametres['encodage'] = dlg.le[dlg.list_encodages.GetSelection()]
     elif  getfileextension(filename) == '.xls' :
         dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=False, sheet = True, size=(350, 200),
                      style=wx.DEFAULT_DIALOG_STYLE)
@@ -322,6 +323,19 @@ class PrefSimi ( wx.Dialog ):
         self.check_elab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
         fgSizer3.Add( self.check_elab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
         
+        self.m_staticline39 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        fgSizer3.Add( self.m_staticline39, 0, wx.EXPAND |wx.ALL, 5 )
+        
+        self.m_staticline40 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        fgSizer3.Add( self.m_staticline40, 0, wx.EXPAND |wx.ALL, 5 )
+        
+        self.m_staticText321 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Edge curved"), wx.DefaultPosition, wx.DefaultSize, 0 )
+        self.m_staticText321.Wrap( -1 )
+        fgSizer3.Add( self.m_staticText321, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        
+        self.check_curved = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
+        fgSizer3.Add( self.check_curved, 0, wx.ALL, 5 )        
+        
         self.m_staticline2914 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
         fgSizer3.Add( self.m_staticline2914, 0, wx.EXPAND, 5 )
         
@@ -714,16 +728,6 @@ class PrefSimi ( wx.Dialog ):
         self.__set_properties()
  
         # Connect Events
-       # if not self.paramsimi['first'] :
-       #     self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
-       # self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
-       # self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
-       # self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
-       # self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
-       # self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
-       # self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
-        
-        # Connect Events
         if not self.paramsimi['first'] :
             self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
         self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
@@ -786,6 +790,7 @@ class PrefSimi ( wx.Dialog ):
         self.comcheck.SetValue(self.paramsimi['com'])
         self.choix_com.SetSelection(self.paramsimi['communities'])
         self.halo.SetValue(self.paramsimi['halo'])
+        self.check_curved.SetValue(self.paramsimi.get('edgecurved', True))
     
     def ChangeCount(self, evt) :
         self.textcount.SetValue('%i' % self.listcol.GetSelectedItemCount())
@@ -908,19 +913,22 @@ class PrepSimi :
                         self.parametres['listet'] = self.etline
                     else:
                         vardial.Destroy()
-            last = self.dial.listcol.GetFirstSelected()
-            lastl = [self.dial.listcol.GetFirstSelected()]
-            indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
-            while self.dial.listcol.GetNextSelected(last) != -1:
-                last = self.dial.listcol.GetNextSelected(last)
-                lastl.append(last)
-                indexes.append(self.dial.listcol.getColumnText(last,0))
-            column = [actives.index(val) for val in indexes]
-            column.sort()
-            with open(pathout, 'w') as f :
-                f.write('\n'.join([`val` for val in column]))
-            self.make_param()
-            self.dial.Destroy()
+                        self.val = False
+                        self.dial.Destroy()
+            if self.val :
+                last = self.dial.listcol.GetFirstSelected()
+                lastl = [self.dial.listcol.GetFirstSelected()]
+                indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
+                while self.dial.listcol.GetNextSelected(last) != -1:
+                    last = self.dial.listcol.GetNextSelected(last)
+                    lastl.append(last)
+                    indexes.append(self.dial.listcol.getColumnText(last,0))
+                column = [actives.index(val) for val in indexes]
+                column.sort()
+                with open(pathout, 'w') as f :
+                    f.write('\n'.join([`val` for val in column]))
+                self.make_param()
+                self.dial.Destroy()
         else :
             self.dial.Destroy()
 
@@ -962,12 +970,12 @@ class PrepSimi :
                           'com'  :self.dial.comcheck.GetValue(),
                           'communities' : self.dial.choix_com.GetSelection(),
                           'halo' : self.dial.halo.GetValue(),
+                          'edgecurved' : self.dial.check_curved.GetValue(),
                           }
         if 'cexfromchi' in self.parametres :
             param['cexfromchi'] = self.dial.checkit.GetValue()
         if 'sfromchi' in self.parametres :
             param['sfromchi'] = self.dial.checki.GetValue()
-            print param
         if 'vlabcolor' in self.parametres :
             param['vlabcolor'] = self.parametres['vlabcolor']
         if 'check_bystar' in dir(self.dial) :