Merge branch 'master' of http://www.iramuteq.org/git/iramuteq
[iramuteq] / dialog.py
index 64b993a..9d166c3 100755 (executable)
--- a/dialog.py
+++ b/dialog.py
@@ -1852,6 +1852,21 @@ class PrefDendro ( wx.Dialog ):
         
         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
         fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
+    
+        self.text_format_image = wx.StaticText( self, wx.ID_ANY, _(u"Image format").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
+        self.text_format_image.Wrap( -1 )
+        fgSizer1.Add( self.text_format_image, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        
+        self.choice_format = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ['png', 'svg'], 0 )
+        self.choice_format.SetSelection( 0 )
+        fgSizer1.Add( self.choice_format, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
+        
+        self.m_staticline31 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        fgSizer1.Add( self.m_staticline31, 0, wx.EXPAND |wx.ALL, 5 )
+        
+        self.m_staticline41 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        fgSizer1.Add( self.m_staticline41, 0, wx.EXPAND |wx.ALL, 5 )        
+        
         
         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Color or black and white").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText5.Wrap( -1 )
@@ -1916,6 +1931,7 @@ class PrefDendro ( wx.Dialog ):
         self.m_radioBox1.SetSelection(self.param['color_nb'])
         self.m_checkBox1.SetValue(self.param['taille_classe'])
         self.m_radioBox2.SetSelection(self.param['type_tclasse'])
+        self.choice_format.SetSelection(self.param['svg'])
     
     def __del__( self ):
         pass
@@ -2321,7 +2337,9 @@ class CorpusPref ( wx.Dialog ):
         fgSizer5.Add( self.radio_other_dict, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         
         self.otherdictpath = wx.FilePickerCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, _(u"Select a file").decode('utf8'), u"*.*", wx.DefaultPosition, wx.Size( 300,-1 ), wx.FLP_DEFAULT_STYLE )
+        self.otherdictpath.SetMinSize(wx.Size(300, -1))
         fgSizer5.Add( self.otherdictpath, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        self.otherdictpath.Enable( False )
         
         
         bSizer2.Add( fgSizer5, 1, wx.EXPAND, 5 )
@@ -2477,7 +2495,9 @@ class CorpusPref ( wx.Dialog ):
         # Connect Events
         self.Bind(wx.EVT_BUTTON, self.OnChangeDir, self.m_button1)
         self.lang_choices.Bind( wx.EVT_CHOICE, self.OnChangeLangage )
-        self.radio_other_dict.Bind( wx.EVT_RADIOBUTTON, self.changedictchoice )        
+        self.radio_other_dict.Bind( wx.EVT_RADIOBUTTON, self.changedictchoice )
+        self.radio_default_dict.Bind( wx.EVT_RADIOBUTTON, self.changedictchoice )
+        self.otherdictpath.Bind( wx.EVT_FILEPICKER_CHANGED, self.selectdict) 
 
         self.setparametres(parametres) 
         self.SetSizer( bSizer1 )
@@ -2518,6 +2538,7 @@ class CorpusPref ( wx.Dialog ):
         self.check_tirets.SetValue(parametres['tiret'])
         self.check_tolist.SetValue(parametres['tolist'])
         self.check_ponct.SetValue(parametres['keep_ponct'])
+        self.defaultdictpath.SetValue(self.langues[0])
 
     def doparametres(self) :
         parametres = {}
@@ -2537,6 +2558,8 @@ class CorpusPref ( wx.Dialog ):
         parametres['tiret'] = self.check_tirets.GetValue()
         parametres['tolist'] = self.check_tolist.GetValue()
         parametres['keep_ponct'] = self.check_ponct.GetValue()
+        if self.radio_other_dict.GetValue() :
+            parametres['dictionary'] = self.otherdictpath.GetPath()
         for val in parametres :
             if isinstance(parametres[val], bool) :
                 if parametres[val] :
@@ -2546,10 +2569,21 @@ class CorpusPref ( wx.Dialog ):
         return parametres
     
     def OnChangeLangage(self, evt):
-        pass
+        self.defaultdictpath.SetValue(self.langues[self.lang_choices.GetSelection()])
     
     def changedictchoice(self, evt):
-        pass
+        if self.radio_default_dict.GetValue() :
+            self.otherdictpath.Enable( False )
+            self.m_sdbSizer1OK.Enable( True )
+        else :
+            self.otherdictpath.Enable( True )
+            if self.otherdictpath.GetPath() == '' :
+                self.m_sdbSizer1OK.Enable( False )
+    
+    def selectdict(self, evt):
+        if self.otherdictpath.GetPath() != '' :
+            self.m_sdbSizer1OK.Enable( True )
+        
 
 
 class ConcordList(wx.HtmlListBox):
@@ -2571,7 +2605,7 @@ class message(wx.Frame):
         self.uceids = uceids
         self.ira = wx.GetApp().GetTopWindow() 
         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
-
+        self.items = items
         self.html = ""
         #self.HtmlPage=wx.html.HtmlWindow(self, -1)
         self.HtmlPage = ConcordList(self, items)
@@ -2615,6 +2649,7 @@ class message(wx.Frame):
             )
         dlg.SetFilterIndex(2)
         dlg.CenterOnParent()
+        self.html = '<br>'.join([self.items[i] for i in range(0,len(self.items))])
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             with open(path, 'w') as f :
@@ -2808,7 +2843,7 @@ class FreqDialog ( wx.Dialog ):
         bSizer1 = wx.BoxSizer( wx.VERTICAL )
         
         m_listBox1Choices = self.header
-        self.m_listBox1 = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_listBox1Choices, wx.LB_EXTENDED|wx.LB_HSCROLL|wx.LB_MULTIPLE )
+        self.m_listBox1 = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_listBox1Choices, wx.LB_EXTENDED|wx.LB_HSCROLL )
         self.m_listBox1.SetMinSize( wx.Size( 500,-1 ) )
         bSizer1.Add( self.m_listBox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )