Changeset 78

Show
Ignore:
Timestamp:
Mon Jul 25 10:20:37 2005
Author:
fredrikc
Message:

Added Tag protection option to the Tags menu.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/transolution/xliffeditor/gtk_main.py

    r76 r78  
    133 133         g = self.wTree.get_widget  
    134 134         self.tb_tagprotection = g("tb_tagprotection")  
      135         self.menu_tagprotection = g("menu_tagprotection")  
    135 136         self.cb_tu_constraint = g("tu_constraint")  
    136 137  
     
    408 409         # automatic tm lookup  
    409 410         self.cb_tm_automatic_lookup.set_active(settings.tm.automatic_lookup)  
      411  
      412         # tag protection  
      413         model = self.docpane.target_control.getModel()  
      414         self.tb_tagprotection.set_active(model.protect_tags)  
      415         self.menu_tagprotection.set_active(model.protect_tags)  
      416 ##        model.protect_tags = self.tb_tagprotection.get_active()  
      417         self.onTuConstraintChanged()  
    410 418          
    411 419         self.interactive = True  
     
    420 428  
    421 429         print "Current Docpane",self.docpane  
    422           model = self.docpane.target_control.getModel()  
    423           model.protect_tags = self.tb_tagprotection.get_active()  
    424           self.onTuConstraintChanged()  
    425           # setup the TU toolbars  
    426           for w in self.widgets_to_disable_when_tu_open:  
    427               w.set_sensitive(self.docpane.open_seg is None)  
    428           for w in self.widgets_to_disable_when_tu_closed:  
    429               w.set_sensitive(self.docpane.open_seg is not None)  
    430    
      430 ##        # setup the TU toolbars  
      431 ##        for w in self.widgets_to_disable_when_tu_open:  
      432 ##            w.set_sensitive(self.docpane.open_seg is None)  
      433 ##        for w in self.widgets_to_disable_when_tu_closed:  
      434 ##            w.set_sensitive(self.docpane.open_seg is not None)  
      435 ##  
    431 436         self._updateGui()  
    432 437  
     
    830 835  
    831 836  
    832       def onToggleProtectTags(self,*args):  
      837     def onToggleProtectTags(self,w,*args):  
    832 837         print "onToggle"  
    833 838         model = self.docpane.target_control.getModel()  
    834           model.protect_tags = self.tb_tagprotection.get_active()  
      839         model.protect_tags = w.get_active()  
    834 839         print "TagProtection:%s"%(('off','on')[model.protect_tags],)  
    835 840         model.xnotify()  
    836            
      841         self._updateGui()  
    836 841  
    837 842 def main():  
  • trunk/transolution/xliffeditor/glade/xliffeditor.glade

    r75 r78  
    216 216                       <property name="label" translatable="yes">Source</property>  
    217 217                       <property name="use_underline">True</property>  
    218                         <property name="active">True</property>  
      218                       <property name="active">False</property>  
    218 218                       <signal name="activate" handler="onShowSource" last_modification_time="Wed, 18 May 2005 08:42:02 GMT"/>  
    219 219                     </widget>  
     
    226 226                       <property name="label" translatable="yes">Target</property>  
    227 227                       <property name="use_underline">True</property>  
    228                         <property name="active">True</property>  
      228                       <property name="active">False</property>  
    228 228                       <property name="group">mb_show_source</property>  
    229 229                       <signal name="activate" handler="onShowTarget" last_modification_time="Wed, 18 May 2005 08:42:02 GMT"/>  
     
    272 272                                       <property name="label" translatable="yes">Full+tagid</property>  
    273 273                                       <property name="use_underline">True</property>  
    274                                         <property name="active">True</property>  
      274                                       <property name="active">False</property>  
    274 274                                       <signal name="activate" handler="onEditorFormatterFull" last_modification_time="Sat, 05 Feb 2005 00:51:06 GMT"/>  
    275 275                                       <accelerator key="F1" modifiers="GDK_CONTROL_MASK" signal="activate"/>  
     
    283 283                                       <property name="label" translatable="yes">Full</property>  
    284 284                                       <property name="use_underline">True</property>  
    285                                         <property name="active">True</property>  
      285                                       <property name="active">False</property>  
    285 285                                       <property name="group">mb_editor_formatter_full</property>  
    286 286                                       <signal name="activate" handler="onEditorFormatterMedium" last_modification_time="Sat, 05 Feb 2005 00:51:06 GMT"/>  
     
    343 343                                       <property name="label" translatable="yes">Full</property>  
    344 344                                       <property name="use_underline">True</property>  
    345                                         <property name="active">True</property>  
      345                                       <property name="active">False</property>  
    345 345                                       <signal name="activate" handler="onSkeletonFull" last_modification_time="Tue, 17 May 2005 21:21:08 GMT"/>  
    346 346                                     </widget>  
     
    353 353                                       <property name="label" translatable="yes">Minimal</property>  
    354 354                                       <property name="use_underline">True</property>  
    355                                         <property name="active">True</property>  
      355                                       <property name="active">False</property>  
    355 355                                       <property name="group">mb_skeleton_full</property>  
    356 356                                       <signal name="activate" handler="onSkeletonMinimal" last_modification_time="Tue, 17 May 2005 21:21:08 GMT"/>  
     
    388 388                                       <property name="label" translatable="yes">Full</property>  
    389 389                                       <property name="use_underline">True</property>  
    390                                         <property name="active">True</property>  
      390                                       <property name="active">False</property>  
    390 390                                       <signal name="activate" handler="onDocumentFormatterFull" last_modification_time="Sat, 05 Feb 2005 00:51:06 GMT"/>  
    391 391                                       <accelerator key="F5" modifiers="GDK_CONTROL_MASK" signal="activate"/>  
     
    399 399                                       <property name="label" translatable="yes">Medium</property>  
    400 400                                       <property name="use_underline">True</property>  
    401                                         <property name="active">True</property>  
      401                                       <property name="active">False</property>  
    401 401                                       <property name="group">mb_formatter_full</property>  
    402 402                                       <signal name="activate" handler="onDocumentFormatterMedium" last_modification_time="Sat, 05 Feb 2005 00:51:06 GMT"/>  
     
    495 495  
    496 496                       <child internal-child="image">  
    497                           <widget class="GtkImage" id="image69">  
      497                         <widget class="GtkImage" id="image73">  
    497 497                           <property name="visible">True</property>  
    498 498                           <property name="stock">gtk-media-forward</property>  
     
    517 517  
    518 518                       <child internal-child="image">  
    519                           <widget class="GtkImage" id="image70">  
      519                         <widget class="GtkImage" id="image74">  
    519 519                           <property name="visible">True</property>  
    520 520                           <property name="stock">gtk-go-back</property>  
     
    799 799                     </widget>  
    800 800                   </child>  
      801  
      802                   <child>  
      803                     <widget class="GtkSeparatorMenuItem" id="avskiljare15">  
      804                       <property name="visible">True</property>  
      805                     </widget>  
      806                   </child>  
      807  
      808                   <child>  
      809                     <widget class="GtkCheckMenuItem" id="menu_tagprotection">  
      810                       <property name="visible">True</property>  
      811                       <property name="label" translatable="yes">Tag protection</property>  
      812                       <property name="use_underline">True</property>  
      813                       <property name="active">True</property>  
      814                       <signal name="activate" handler="onToggleProtectTags" last_modification_time="Mon, 25 Jul 2005 11:45:55 GMT"/>  
      815                     </widget>  
      816                   </child>  
    801 817                 </widget>  
    802 818               </child>