Changeset 51
- Timestamp:
- Wed Jun 29 16:38:53 2005
- Files:
-
- trunk/transolution/xliffeditor/gtk_documentviewpanel.py (modified) (diff)
- trunk/transolution/xliffeditor/gtk_status_change_dialog.py (modified) (diff)
- trunk/transolution/xliffeditor/glade/xliffeditor.glade (modified) (diff)
- trunk/transolution/xliffeditor/document/creators.py (modified) (diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
trunk/transolution/xliffeditor/gtk_documentviewpanel.py
r50 r51 768 768 from_state = s['from_state'] 769 769 to_state = s['to_state'] 770 from_state_q = s['from_state_q'] 771 to_state_q = s['to_state_q'] 770 772 771 773 approvemap = {None:None, True:'yes', False:'no'} … … 785 787 if from_state != tu.state and (from_state or tu.state): 786 788 continue 789 if not (from_state_q is None): 790 if from_state_q != tu.state_qualifier and (from_state_q or tu.state_qualifier): 791 continue 787 792 # do the changes 788 793 if not (to_state is None) and seg.tu.state != to_state: 789 794 seg.tu.state = to_state 790 795 changed = True 796 if not (to_state_q is None) and seg.tu.state_qualifier != to_state_q: 797 seg.tu.state_qualifier = to_state_q 798 changed = True 791 799 if not (to_approved is None) and tu.approved != to_approved: 792 800 tu.approved = to_approved -
trunk/transolution/xliffeditor/gtk_status_change_dialog.py
r50 r51 1 1 import gtk 2 2 import gtk.glade 3 from gtk_utils import askOk,messageDialog 3 from gtk_utils import askOk,messageDialog,CustomHandler 3 3 4 4 from general import EditorException … … 7 7 import transolution 8 8 9 class StatusChangeDialog( object):9 class StatusChangeDialog(CustomHandler): 9 9 def __init__(self, parent=None): 10 CustomHandler.__init__(self) 10 11 self.parent = parent 11 12 # Load Glade GUI … … 23 24 self.from_state = w("from_state") 24 25 self.to_state = w("to_state") 26 self.from_state_q = w("from_state_q") 27 self.to_state_q = w("to_state_q") 25 28 self.from_approved = w("from_approved") 26 29 self.to_approved = w("to_approved") … … 28 31 self.use_from_state = w("use_from_state") 29 32 self.use_to_state = w("use_to_state") 33 self.use_from_state_q = w("use_from_state_q") 34 self.use_to_state_q = w("use_to_state_q") 30 35 31 36 self.use_from_approved = w("use_from_approved") 32 37 self.use_to_approved = w("use_to_approved") 33 38 import document 39 # setup combobox state TU constraint 40 for v in document.tu.state_maps.getTuStates(): 41 self.from_state.append_text(v) 42 self.to_state.append_text(v) 43 for v in document.tu.state_maps.getTuStatesQualifiers(): 44 self.from_state_q.append_text(v) 45 self.to_state_q.append_text(v) 34 46 35 47 # connect … … 40 52 self._update() 41 53 54 #------- custom widget creator functions ---------------------- 55 def getComboBox(self,str1, str2, int1, int2): 56 'custom widget provider' 57 comboboxentry = gtk.combo_box_entry_new_text() 58 return comboboxentry 59 #----------------------------- 60 42 61 def onButtonToggled(self,*args): 43 62 self.guiUpdate() 44 63 45 64 def guiUpdate(self): 46 self.from_state.set_sensitive(self.use_from_state.get_active()) 47 self.to_state.set_sensitive(self.use_to_state.get_active()) 48 self.from_approved.set_sensitive(self.use_from_approved.get_active()) 49 self.to_approved.set_sensitive(self.use_to_approved.get_active()) 65 s = self 66 conditions = { 67 s.from_state: s.use_from_state, 68 s.to_state: s.use_to_state, 69 s.from_state_q: s.use_from_state_q, 70 s.to_state_q: s.use_to_state_q, 71 s.from_approved:s.use_from_approved, 72 s.to_approved: s.use_to_approved 73 } 74 for w,c in conditions.items(): 75 w.set_sensitive(c.get_active()) 50 76 51 77 … … 56 82 self.guiUpdate() 57 83 'update search settings dict' 58 d = {'from_state':None,'to_state':None,'to_approved':None,'from_approved':None} 84 d = {'from_state':None,'to_state':None,'from_state_q':None,'to_state_q':None,'to_approved':None,'from_approved':None} 58 84 if self.use_from_state.get_active(): 59 85 d['from_state'] = self.from_state.child.get_text() 60 86 if self.use_to_state.get_active(): 61 87 d['to_state'] = self.to_state.child.get_text() 88 if self.use_from_state_q.get_active(): 89 d['from_state_q'] = self.from_state_q.child.get_text() 90 if self.use_to_state_q.get_active(): 91 d['to_state_q'] = self.to_state_q.child.get_text() 62 92 if self.use_to_approved.get_active(): 63 93 d['to_approved'] = self.to_approved.get_active() -
trunk/transolution/xliffeditor/glade/xliffeditor.glade
r49 r51 2479 2479 <widget class="GtkLabel" id="label14"> 2480 2480 <property name="visible">True</property> 2481 <property name="label" translatable="yes"> Change From</property>2481 <property name="label" translatable="yes"><b>Change From</b></property> 2481 2481 <property name="use_underline">False</property> 2482 <property name="use_markup"> False</property>2482 <property name="use_markup">True</property> 2482 2482 <property name="justify">GTK_JUSTIFY_LEFT</property> 2483 2483 <property name="wrap">False</property> … … 2501 2501 <property name="border_width">1</property> 2502 2502 <property name="visible">True</property> 2503 <property name="n_rows"> 2</property>2503 <property name="n_rows">3</property> 2503 2503 <property name="n_columns">2</property> 2504 2504 <property name="homogeneous">False</property> … … 2514 2514 2515 2515 <child> 2516 <widget class=" GtkComboBoxEntry" id="from_state">2516 <widget class="Custom" id="from_state"> 2516 2516 <property name="visible">True</property> 2517 <property name="creation_function">getComboBox</property> 2518 <property name="int1">0</property> 2519 <property name="int2">0</property> 2520 <property name="last_modification_time">Wed, 29 Jun 2005 20:48:49 GMT</property> 2517 2521 </widget> 2518 2522 <packing> … … 2538 2542 <property name="visible">True</property> 2539 2543 <property name="can_focus">True</property> 2540 <property name="label" translatable="yes"> TUState</property>2544 <property name="label" translatable="yes">State</property> 2540 2544 <property name="use_underline">True</property> 2541 2545 <property name="relief">GTK_RELIEF_NORMAL</property> … … 2571 2575 <property name="left_attach">0</property> 2572 2576 <property name="right_attach">1</property> 2573 <property name="top_attach">1</property> 2574 <property name="bottom_attach">2</property> 2577 <property name="top_attach">2</property> 2578 <property name="bottom_attach">3</property> 2575 2579 <property name="x_options">fill</property> 2576 2580 <property name="y_options"></property> … … 2593 2597 <property name="left_attach">1</property> 2594 2598 <property name="right_attach">2</property> 2599 <property name="top_attach">2</property> 2600 <property name="bottom_attach">3</property> 2601 <property name="x_options">fill</property> 2602 <property name="y_options"></property> 2603 </packing> 2604 </child> 2605 2606 <child> 2607 <widget class="GtkToggleButton" id="use_from_state_q"> 2608 <property name="visible">True</property> 2609 <property name="can_focus">True</property> 2610 <property name="label" translatable="yes">State Qualifiers</property> 2611 <property name="use_underline">True</property> 2612 <property name="relief">GTK_RELIEF_NORMAL</property> 2613 <property name="focus_on_click">True</property> 2614 <property name="active">False</property> 2615 <property name="inconsistent">False</property> 2616 <signal name="toggled" handler="onButtonToggled" last_modification_time="Wed, 29 Jun 2005 14:06:21 GMT"/> 2617 </widget> 2618 <packing> 2619 <property name="left_attach">0</property> 2620 <property name="right_attach">1</property> 2595 2621 <property name="top_attach">1</property> 2596 2622 <property name="bottom_attach">2</property> … … 2599 2625 </packing> 2600 2626 </child> 2627 2628 <child> 2629 <widget class="Custom" id="from_state_q"> 2630 <property name="visible">True</property> 2631 <property name="creation_function">getComboBox</property> 2632 <property name="int1">0</property> 2633 <property name="int2">0</property> 2634 <property name="last_modification_time">Wed, 29 Jun 2005 21:13:32 GMT</property> 2635 </widget> 2636 <packing> 2637 <property name="left_attach">1</property> 2638 <property name="right_attach">2</property> 2639 <property name="top_attach">1</property> 2640 <property name="bottom_attach">2</property> 2641 <property name="x_options">fill</property> 2642 <property name="y_options">fill</property> 2643 </packing> 2644 </child> 2601 2645 </widget> 2602 2646 <packing> … … 2623 2667 <widget class="GtkLabel" id="label16"> 2624 2668 <property name="visible">True</property> 2625 <property name="label" translatable="yes"> Change To</property>2669 <property name="label" translatable="yes"><b>Change To</b></property> 2625 2669 <property name="use_underline">False</property> 2626 <property name="use_markup"> False</property>2670 <property name="use_markup">True</property> 2626 2670 <property name="justify">GTK_JUSTIFY_LEFT</property> 2627 2671 <property name="wrap">False</property> … … 2645 2689 <property name="border_width">1</property> 2646 2690 <property name="visible">True</property> 2647 <property name="n_rows"> 2</property>2691 <property name="n_rows">3</property> 2647 2691 <property name="n_columns">2</property> 2648 2692 <property name="homogeneous">False</property> … … 2652 2696 2653 2697 <child> 2654 <widget class="GtkComboBoxEntry" id="to_state">2655 <property name="visible">True</property>2656 </widget>2657 <packing>2658 <property name="left_attach">1</property>2659 <property name="right_attach">2</property>2660 <property name="top_attach">0</property>2661 <property name="bottom_attach">1</property>2662 <property name="y_options">fill</property>2663 </packing>2664 </child>2665 2666 <child>2667 2698 <widget class="GtkToggleButton" id="use_to_state"> 2668 2699 <property name="visible">True</property> 2669 2700 <property name="can_focus">True</property> 2670 <property name="label" translatable="yes"> TUState</property>2701 <property name="label" translatable="yes">State</property> 2670 2701 <property name="use_underline">True</property> 2671 2702 <property name="relief">GTK_RELIEF_NORMAL</property> … … 2701 2732 <property name="left_attach">0</property> 2702 2733 <property name="right_attach">1</property> 2703 <property name="top_attach">1</property> 2704 <property name="bottom_attach">2</property> 2734 <property name="top_attach">2</property> 2735 <property name="bottom_attach">3</property> 2705 2736 <property name="x_options">fill</property> 2706 2737 <property name="y_options"></property> … … 2723 2754 <property name="left_attach">1</property> 2724 2755 <property name="right_attach">2</property> 2756 <property name="top_attach">2</property> 2757 <property name="bottom_attach">3</property> 2758 <property name="x_options">fill</property> 2759 <property name="y_options"></property> 2760 </packing> 2761 </child> 2762 2763 <child> 2764 <widget class="Custom" id="to_state"> 2765 <property name="visible">True</property> 2766 <property name="creation_function">getComboBox</property> 2767 <property name="int1">0</property> 2768 <property name="int2">0</property> 2769 <property name="last_modification_time">Wed, 29 Jun 2005 20:49:10 GMT</property> 2770 </widget> 2771 <packing> 2772 <property name="left_attach">1</property> 2773 <property name="right_attach">2</property> 2774 <property name="top_attach">0</property> 2775 <property name="bottom_attach">1</property> 2776 <property name="x_options">fill</property> 2777 <property name="y_options">fill</property> 2778 </packing> 2779 </child> 2780 2781 <child> 2782 <widget class="GtkToggleButton" id="use_to_state_q"> 2783 <property name="visible">True</property> 2784 <property name="can_focus">True</property> 2785 <property name="label" translatable="yes">State Qualifiers</property> 2786 <property name="use_underline">True</property> 2787 <property name="relief">GTK_RELIEF_NORMAL</property> 2788 <property name="focus_on_click">True</property> 2789 <property name="active">False</property> 2790 <property name="inconsistent">False</property> 2791 <signal name="toggled" handler="onButtonToggled" last_modification_time="Wed, 29 Jun 2005 14:06:21 GMT"/> 2792 </widget> 2793 <packing> 2794 <property name="left_attach">0</property> 2795 <property name="right_attach">1</property> 2725 2796 <property name="top_attach">1</property> 2726 2797 <property name="bottom_attach">2</property> … … 2729 2800 </packing> 2730 2801 </child> 2802 2803 <child> 2804 <widget class="Custom" id="to_state_q"> 2805 <property name="visible">True</property> 2806 <property name="creation_function">getComboBox</property> 2807 <property name="int1">0</property> 2808 <property name="int2">0</property> 2809 <property name="last_modification_time">Wed, 29 Jun 2005 21:14:29 GMT</property> 2810 </widget> 2811 <packing> 2812 <property name="left_attach">1</property> 2813 <property name="right_attach">2</property> 2814 <property name="top_attach">1</property> 2815 <property name="bottom_attach">2</property> 2816 <property name="x_options">fill</property> 2817 <property name="y_options">fill</property> 2818 </packing> 2819 </child> 2731 2820 </widget> 2732 2821 <packing> -
trunk/transolution/xliffeditor/document/creators.py
r2 r51 64 64 'needs-translation':('bg_lightblue',), 65 65 'needs-review-translation':('bg_lightblue',), 66 'new':('bg_yellow',), 66 'new':('bg_lightyellow',), 66 66 'nostate':('bg_khaki',), 67 67 'unknown':('bg_white',),
