X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=dialog.py;h=78352eceae218d500ec4aae4632f5cf5fd4e7a8f;hp=56183ff5e3aba8ad6df143382bf802f50cbcdbbe;hb=adc24190c47d42d5fa02f074516fc331950d8c5c;hpb=2162fc860e2814549d728c8884caaaa7a52bcb56 diff --git a/dialog.py b/dialog.py index 56183ff..78352ec 100755 --- a/dialog.py +++ b/dialog.py @@ -152,7 +152,6 @@ class ClusterNbDialog(wx.Dialog): LIST_CLASSE_OK.append(str(i)) else : LIST_CLASSE_OK.append(str(LIST_CLASSE)) - print str(LIST_CLASSE_OK) self.list_box_1 = wx.ListBox(self, -1, choices=LIST_CLASSE_OK, style=wx.LB_SINGLE | wx.LB_HSCROLL) self.list_box_1.SetHelpText("Here's some help text for field #1") box.Add(self.list_box_1, 1, wx.ALIGN_CENTRE | wx.ALL, 5) @@ -410,6 +409,20 @@ nouvelle version est disponible""" self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS ) self.m_radioBox2.SetSelection( 0 ) fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) + + msg = u"""Langue de l'interface""" + self.m_staticText45 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText45.Wrap( -1 ) + fgSizer1.Add( self.m_staticText45, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + + self.m_staticText46 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText46.Wrap( -1 ) + fgSizer1.Add( self.m_staticText46, 0, wx.ALL, 5 ) + + self.listlangues = [ u"french", u"english" ] + self.langues = wx.Choice( self, wx.ID_ANY, (200, -1), choices = self.listlangues) + #self.langues.SetSelection( 0 ) + fgSizer1.Add( self.langues, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) msg = u"""Vérifier l'installation des bibliothèques de R""" @@ -504,6 +517,7 @@ bibliothèques de R""" if self.parent.pref.getboolean('iramuteq', 'checkupdate') : val2 = 0 else : val2 = 1 self.m_radioBox2.SetSelection(val2) + self.langues.SetSelection(self.listlangues.index(self.parent.pref.get('iramuteq', 'guilanguage'))) if sys.platform == 'win32' : if self.parent.pref.getboolean('iramuteq', 'R_mem') : self.m_checkBox1.SetValue(True) @@ -542,6 +556,7 @@ bibliothèques de R""" if self.m_radioBox2.GetSelection() == 0 : valcheck = 'true' else : valcheck = 'false' parent.pref.set('iramuteq', 'checkupdate', valcheck) + parent.pref.set('iramuteq', 'guilanguage', self.listlangues[self.langues.GetSelection()]) if sys.platform == 'win32' : if self.m_checkBox1.GetValue() : parent.pref.set('iramuteq', 'R_mem', 'true') @@ -1670,7 +1685,6 @@ class SearchDial ( wx.Dialog ): self.search.Clear() def UnSelectList(liste) : - print liste if liste.GetFirstSelected() != -1 : last = liste.GetFirstSelected() liste.Select(liste.GetFirstSelected(), False) @@ -1684,6 +1698,7 @@ class OptLexi(wx.Dialog): # begin wxGlade: MyDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) + self.param = kwds self.listet = None self.variables = None #self.labellem = wx.StaticText(self, -1, u"Lemmatisation : ") @@ -1694,10 +1709,15 @@ class OptLexi(wx.Dialog): self.list_box_1 = wx.ListBox(self, -1, choices=[], size = wx.Size( 150,200 ), style=wx.LB_EXTENDED | wx.LB_HSCROLL) self.button_2 = wx.Button(self, wx.ID_CANCEL, "") self.button_1 = wx.Button(self, wx.ID_OK, "") + if not kwds.get('force_chi', False) : + indices = [u'loi hypergéométique', u'chi2'] + else : + indices = [u'chi2'] self.label_indice = wx.StaticText(self, -1, u"indice") - self.choice_indice = wx.Choice(self, -1, (100,50), choices = [u'loi hypergéométique', u'chi2']) - self.label = wx.StaticText(self, -1, u"effectif minimum") - self.spin = wx.SpinCtrl(self, -1, min = 1, max = 10000) + self.choice_indice = wx.Choice(self, -1, (100,50), choices = indices) + if not kwds.get('force_chi', False) : + self.label = wx.StaticText(self, -1, u"effectif minimum") + self.spin = wx.SpinCtrl(self, -1, min = 1, max = 10000) self.Bind(wx.EVT_CHOICE, self.onselect, self.choice) self.__set_properties() self.__do_layout() @@ -1726,8 +1746,9 @@ class OptLexi(wx.Dialog): sizer_3.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3) sizer_2.Add(self.label_indice, 0, wx.ALIGN_CENTER_VERTICAL, 3) sizer_2.Add(self.choice_indice, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3) - sizer_2.Add(self.label, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3) - sizer_2.Add(self.spin, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 3) + if not self.param.get('force_chi', False) : + sizer_2.Add(self.label, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3) + sizer_2.Add(self.spin, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 3) sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 3) sizer_1.Add(sizer_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_RIGHT, 3) self.SetSizer(sizer_1) @@ -2172,12 +2193,12 @@ class CorpusPref ( wx.Dialog ): def __init__( self, parent, parametres ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Préférences", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) self.parent = parent - langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)', 'greek', 'other...'] + langues_n = [u'français', u'english', u'german (expérimentale)', u'italian', u'swedish (expérimentale)', u'portuguese (expérimentale)', u'greek (expériementale)', u'autre...'] self.langues = [u'french', u'english', u'german', 'italian', 'swedish', u'portuguese', 'greek', 'other'] self.encodages = [enc[0].lower() for enc in encodages] ucimark = [u'****', u'0000'] - ucemethod = [u'charactères', u'occurrences', u'paragraphe'] + ucemethod = [u'charactères', u'occurrences', u'paragraphes'] self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -2571,7 +2592,6 @@ class ExtractDialog ( wx.Dialog ): else : parametres['onefile'] = False parametres['encodeout'] = locale.getpreferredencoding() - print parametres return parametres def __del__( self ):