1 #!/bin/sh 2 3 # Test of Glade 2 support. 4 5 tmpfiles="" 6 trap 'rm -fr $tmpfiles' 1 2 3 15 7 8 tmpfiles="$tmpfiles empty.glade" 9 cat <<EOF > empty.glade 10 <?xml version="1.0"?> 11 <GTK-Interface/> 12 EOF 13 14 tmpfiles="$tmpfiles xg-gl-3.pot" 15 : ${XGETTEXT=xgettext} 16 ${XGETTEXT} -o xg-gl-3.pot empty.glade 2>/dev/null 17 test $? = 0 || { 18 echo "Skipping test: xgettext was built without Glade support" 19 rm -fr $tmpfiles; exit 77 20 } 21 22 tmpfiles="$tmpfiles asciitable.glade2" 23 cat <<EOF > asciitable.glade2 24 <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> 25 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd" > 26 27 <glade-interface> 28 <widget class="GtkDialog" id="dialog"> 29 <property name="visible">no</property> 30 <property name="title" translatable="yes">gedit: ASCII table</property> 31 <property name="type">GTK_WINDOW_TOPLEVEL</property> 32 <property name="modal">no</property> 33 <property name="allow_shrink">yes</property> 34 <property name="allow_grow">yes</property> 35 <property name="window-position">GTK_WIN_POS_NONE</property> 36 37 <child internal-child="vbox"> 38 <widget class="GtkVBox" id="dialog-vbox1"> 39 <property name="homogeneous">no</property> 40 <property name="spacing">8</property> 41 <property name="visible">yes</property> 42 43 <child internal-child="action_area"> 44 <widget class="GtkHButtonBox" id="dialog-action_area1"> 45 <property name="layout_style">GTK_BUTTONBOX_END</property> 46 <property name="spacing">8</property> 47 <property name="visible">yes</property> 48 49 <child> 50 <widget class="GtkButton" id="insert_char_button"> 51 <property name="can_default">yes</property> 52 <property name="can_focus">yes</property> 53 <property name="label" translatable="yes">Insert char</property> 54 <property name="visible">yes</property> 55 </widget> 56 </child> 57 58 <child> 59 <widget class="GtkButton" id="close_button"> 60 <property name="can_default">yes</property> 61 <property name="can_focus">yes</property> 62 <property name="visible">yes</property> 63 <property name="label">gtk-close</property> 64 <property name="use_stock">yes</property> 65 <property name="use_underline">yes</property> 66 </widget> 67 </child> 68 69 <child> 70 <widget class="GtkButton" id="help_button"> 71 <property name="can_default">yes</property> 72 <property name="can_focus">yes</property> 73 <property name="visible">yes</property> 74 <property name="label">gtk-help</property> 75 <property name="use_stock">yes</property> 76 <property name="use_underline">yes</property> 77 </widget> 78 </child> 79 </widget> 80 <packing> 81 <property name="padding">0</property> 82 <property name="expand">no</property> 83 <property name="fill">yes</property> 84 <property name="pack_type">GTK_PACK_END</property> 85 </packing> 86 </child> 87 88 <child> 89 <widget class="GtkVBox" id="asciitable_dialog_content"> 90 <property name="border_width">6</property> 91 <property name="homogeneous">no</property> 92 <property name="spacing">8</property> 93 <property name="visible">yes</property> 94 95 <child> 96 <widget class="GtkLabel" id="label1"> 97 <property name="label" translatable="yes">If you wish to insert any of the characters in to the active 98 document, select the character and click the "Insert Char" 99 button or double click the character in the table.</property> 100 <property name="justify">GTK_JUSTIFY_LEFT</property> 101 <property name="wrap">no</property> 102 <property name="xalign">0.0</property> 103 <property name="yalign">0.5</property> 104 <property name="xpad">0</property> 105 <property name="ypad">0</property> 106 <property name="visible">yes</property> 107 </widget> 108 <packing> 109 <property name="padding">0</property> 110 <property name="expand">no</property> 111 <property name="fill">no</property> 112 </packing> 113 </child> 114 115 <child> 116 <widget class="GtkScrolledWindow" id="scrolledwindow1"> 117 <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> 118 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> 119 <property name="shadow_type">GTK_SHADOW_IN</property> 120 <property name="height-request">350</property> 121 <property name="visible">yes</property> 122 123 <child> 124 <widget class="GtkTreeView" id="ascii_table"> 125 <property name="can_focus">yes</property> 126 <property name="headers-visible">yes</property> 127 <property name="visible">yes</property> 128 </widget> 129 </child> 130 131 <child internal-child="hscrollbar"> 132 <widget class="GtkHScrollbar" id="convertwidget1"> 133 <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> 134 <property name="visible">yes</property> 135 </widget> 136 </child> 137 138 <child internal-child="vscrollbar"> 139 <widget class="GtkVScrollbar" id="convertwidget2"> 140 <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> 141 <property name="visible">yes</property> 142 </widget> 143 </child> 144 </widget> 145 <packing> 146 <property name="padding">0</property> 147 <property name="expand">yes</property> 148 <property name="fill">yes</property> 149 </packing> 150 </child> 151 </widget> 152 <packing> 153 <property name="padding">0</property> 154 <property name="expand">yes</property> 155 <property name="fill">yes</property> 156 </packing> 157 </child> 158 </widget> 159 <packing> 160 <property name="padding">4</property> 161 <property name="expand">yes</property> 162 <property name="fill">yes</property> 163 </packing> 164 </child> 165 </widget> 166 </glade-interface> 167 EOF 168 169 tmpfiles="$tmpfiles xg-gl-3.tmp xg-gl-3.pot" 170 : ${XGETTEXT=xgettext} 171 ${XGETTEXT} -o xg-gl-3.tmp asciitable.glade2 172 test $? = 0 || { rm -fr $tmpfiles; exit 1; } 173 grep -v 'POT-Creation-Date' < xg-gl-3.tmp > xg-gl-3.pot 174 175 tmpfiles="$tmpfiles xg-gl-3.ok" 176 cat <<\EOF > xg-gl-3.ok 177 # SOME DESCRIPTIVE TITLE. 178 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 179 # This file is distributed under the same license as the PACKAGE package. 180 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 181 # 182 #, fuzzy 183 msgid "" 184 msgstr "" 185 "Project-Id-Version: PACKAGE VERSION\n" 186 "Report-Msgid-Bugs-To: \n" 187 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 188 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 189 "Language-Team: LANGUAGE <LL (at] li.org>\n" 190 "MIME-Version: 1.0\n" 191 "Content-Type: text/plain; charset=CHARSET\n" 192 "Content-Transfer-Encoding: 8bit\n" 193 194 #: asciitable.glade2:7 195 msgid "gedit: ASCII table" 196 msgstr "" 197 198 #: asciitable.glade2:30 199 msgid "Insert char" 200 msgstr "" 201 202 #: asciitable.glade2:74 203 msgid "" 204 "If you wish to insert any of the characters in to the active \n" 205 "document, select the character and click the \"Insert Char\" \n" 206 "button or double click the character in the table." 207 msgstr "" 208 EOF 209 210 : ${DIFF=diff} 211 ${DIFF} xg-gl-3.ok xg-gl-3.pot 212 result=$? 213 214 rm -fr $tmpfiles 215 216 exit $result 217