Update upstream source from tag 'upstream/100'
Update to upstream version '100'
with Debian dir c3232ece7d65b695558b6d78fb8eb4d674f9a6fc
Jonas Smedegaard
5 years ago
0 | [flake8] | |
1 | ||
2 | # E402 module level import not at top of file | |
3 | # gi.require_version() is required before later imports | |
4 | ||
5 | ignore = E402 |
25 | 25 | |
26 | 26 | import gi |
27 | 27 | gi.require_version('Gtk', '3.0') |
28 | gi.require_version('TelepathyGLib', '0.12') | |
29 | ||
28 | 30 | from gi.repository import Gtk |
29 | import telepathy | |
30 | import telepathy.client | |
31 | from gi.repository import TelepathyGLib | |
31 | 32 | |
32 | 33 | from sugar3.activity import activity |
33 | 34 | from sugar3.activity.widgets import StopButton |
186 | 187 | |
187 | 188 | if self.shared_activity: |
188 | 189 | # we are joining the activity |
189 | logger.error('We are joining an activity') | |
190 | logger.debug('We are joining an activity') | |
190 | 191 | # display a icon while joining |
191 | 192 | self._connecting_box.show() |
192 | 193 | # disable the abi widget |
200 | 201 | self._joined_cb(self) |
201 | 202 | else: |
202 | 203 | # we are creating the activity |
203 | logger.error("We are creating an activity") | |
204 | logger.debug("We are creating an activity") | |
204 | 205 | |
205 | 206 | self.abiword_canvas.zoom_width() |
206 | 207 | self.abiword_canvas.show() |
222 | 223 | def __map_activity_event_cb(self, event, activity): |
223 | 224 | # set custom keybindings for Write |
224 | 225 | # we do it later because have problems if done before - OLPC #11049 |
225 | logger.error('Loading keybindings') | |
226 | logger.debug('Loading keybindings') | |
226 | 227 | keybindings_file = os.path.join(get_bundle_path(), 'keybindings.xml') |
227 | 228 | self.abiword_canvas.invoke_ex( |
228 | 229 | 'com.abisource.abiword.loadbindings.fromURI', |
230 | 231 | # set default font |
231 | 232 | if self._new_instance: |
232 | 233 | self.abiword_canvas.select_all() |
233 | logging.error('Setting default font to %s %d in new documents', | |
234 | logging.debug('Setting default font to %s %d in new documents', | |
234 | 235 | self._default_font_face, self._default_font_size) |
235 | 236 | self.abiword_canvas.set_font_name(self._default_font_face) |
236 | 237 | self.abiword_canvas.set_font_size(str(self._default_font_size)) |
265 | 266 | return preview_data |
266 | 267 | |
267 | 268 | def _shared_cb(self, activity): |
268 | logger.error('My Write activity was shared') | |
269 | logger.debug('My Write activity was shared') | |
269 | 270 | self._sharing_setup() |
270 | 271 | |
271 | 272 | self.shared_activity.connect('buddy-joined', self._buddy_joined_cb) |
272 | 273 | self.shared_activity.connect('buddy-left', self._buddy_left_cb) |
273 | 274 | |
274 | channel = self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES] | |
275 | logger.error('This is my activity: offering a tube...') | |
275 | channel = self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES] | |
276 | logger.debug('This is my activity: offering a tube...') | |
276 | 277 | id = channel.OfferDBusTube('com.abisource.abiword.abicollab', {}) |
277 | logger.error('Tube address: %s', channel.GetDBusTubeAddress(id)) | |
278 | logger.debug('Tube address: %s', channel.GetDBusTubeAddress(id)) | |
278 | 279 | |
279 | 280 | def _sharing_setup(self): |
280 | 281 | logger.debug("_sharing_setup()") |
287 | 288 | self.tubes_chan = self.shared_activity.telepathy_tubes_chan |
288 | 289 | self.text_chan = self.shared_activity.telepathy_text_chan |
289 | 290 | self.tube_id = None |
290 | self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal( | |
291 | self.tubes_chan[ | |
292 | TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].connect_to_signal( | |
291 | 293 | 'NewTube', self._new_tube_cb) |
292 | 294 | |
293 | 295 | def _list_tubes_reply_cb(self, tubes): |
298 | 300 | logger.error('ListTubes() failed: %s', e) |
299 | 301 | |
300 | 302 | def _joined_cb(self, activity): |
301 | logger.error("_joined_cb()") | |
303 | logger.debug("_joined_cb()") | |
302 | 304 | if not self.shared_activity: |
303 | 305 | self._enable_collaboration() |
304 | 306 | return |
305 | 307 | |
306 | 308 | self.joined = True |
307 | logger.error('Joined an existing Write session') | |
309 | logger.debug('Joined an existing Write session') | |
308 | 310 | self._sharing_setup() |
309 | 311 | |
310 | logger.error('This is not my activity: waiting for a tube...') | |
311 | self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].ListTubes( | |
312 | logger.debug('This is not my activity: waiting for a tube...') | |
313 | self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].ListTubes( | |
312 | 314 | reply_handler=self._list_tubes_reply_cb, |
313 | 315 | error_handler=self._list_tubes_error_cb) |
314 | 316 | self._enable_collaboration() |
323 | 325 | self._connecting_box.hide() |
324 | 326 | |
325 | 327 | def _new_tube_cb(self, id, initiator, type, service, params, state): |
326 | logger.error('New tube: ID=%d initiator=%d type=%d service=%s ' | |
328 | logger.debug('New tube: ID=%d initiator=%d type=%d service=%s ' | |
327 | 329 | 'params=%r state=%d', id, initiator, type, service, |
328 | 330 | params, state) |
329 | 331 | |
331 | 333 | # We are already using a tube |
332 | 334 | return |
333 | 335 | |
334 | if type != telepathy.TUBE_TYPE_DBUS or \ | |
336 | if type != TelepathyGLib.TubeType.DBUS or \ | |
335 | 337 | service != "com.abisource.abiword.abicollab": |
336 | 338 | return |
337 | 339 | |
338 | channel = self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES] | |
339 | ||
340 | if state == telepathy.TUBE_STATE_LOCAL_PENDING: | |
340 | channel = self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES] | |
341 | ||
342 | if state == TelepathyGLib.TubeState.LOCAL_PENDING: | |
341 | 343 | channel.AcceptDBusTube(id) |
342 | 344 | |
343 | 345 | # look for the initiator's D-Bus unique name |
345 | 347 | dbus_names = channel.GetDBusNames(id) |
346 | 348 | for handle, name in dbus_names: |
347 | 349 | if handle == initiator: |
348 | logger.error('found initiator D-Bus name: %s', name) | |
350 | logger.debug('found initiator D-Bus name: %s', name) | |
349 | 351 | initiator_dbus_name = name |
350 | 352 | break |
351 | 353 | |
357 | 359 | # pass this tube to abicollab |
358 | 360 | address = channel.GetDBusTubeAddress(id) |
359 | 361 | if self.joined: |
360 | logger.error('Passing tube address to abicollab (join): %s', | |
362 | logger.debug('Passing tube address to abicollab (join): %s', | |
361 | 363 | address) |
362 | 364 | self.abiword_canvas.invoke_ex(cmd_prefix + 'joinTube', |
363 | 365 | address, 0, 0) |
364 | 366 | # The intiator of the session has to be the first passed |
365 | 367 | # to the Abicollab backend. |
366 | logger.error('Adding the initiator to the session: %s', | |
368 | logger.debug('Adding the initiator to the session: %s', | |
367 | 369 | initiator_dbus_name) |
368 | 370 | self.abiword_canvas.invoke_ex(cmd_prefix + 'buddyJoined', |
369 | 371 | initiator_dbus_name, 0, 0) |
370 | 372 | else: |
371 | logger.error('Passing tube address to abicollab (offer): %s', | |
373 | logger.debug('Passing tube address to abicollab (offer): %s', | |
372 | 374 | address) |
373 | 375 | self.abiword_canvas.invoke_ex(cmd_prefix + 'offerTube', address, |
374 | 376 | 0, 0) |
385 | 387 | according members of the D-Bus tube. That's why we don't add/remove |
386 | 388 | buddies in _buddy_{joined,left}_cb. |
387 | 389 | """ |
388 | logger.error('_on_dbus_names_changed') | |
390 | logger.debug('_on_dbus_names_changed') | |
389 | 391 | # if tube_id == self.tube_id: |
390 | 392 | cmd_prefix = 'com.abisource.abiword.abicollab.olpc' |
391 | 393 | for handle, bus_name in added: |
392 | logger.error('added handle: %s, with dbus_name: %s', | |
394 | logger.debug('added handle: %s, with dbus_name: %s', | |
393 | 395 | handle, bus_name) |
394 | 396 | self.abiword_canvas.invoke_ex(cmd_prefix + '.buddyJoined', |
395 | 397 | bus_name, 0, 0) |
397 | 399 | |
398 | 400 | def _on_members_changed(self, message, added, removed, local_pending, |
399 | 401 | remote_pending, actor, reason): |
400 | logger.error("_on_members_changed") | |
402 | logger.debug("_on_members_changed") | |
401 | 403 | for handle in removed: |
402 | 404 | bus_name = self.participants.pop(handle, None) |
403 | 405 | if bus_name is None: |
406 | 408 | continue |
407 | 409 | |
408 | 410 | cmd_prefix = 'com.abisource.abiword.abicollab.olpc' |
409 | logger.error('removed handle: %d, with dbus name: %s', handle, | |
411 | logger.debug('removed handle: %d, with dbus name: %s', handle, | |
410 | 412 | bus_name) |
411 | 413 | self.abiword_canvas.invoke_ex(cmd_prefix + '.buddyLeft', |
412 | 414 | bus_name, 0, 0) |
413 | 415 | |
414 | 416 | def _buddy_joined_cb(self, activity, buddy): |
415 | logger.error('buddy joined with object path: %s', buddy.object_path()) | |
417 | logger.debug('buddy joined with object path: %s', buddy.object_path()) | |
416 | 418 | |
417 | 419 | def _buddy_left_cb(self, activity, buddy): |
418 | logger.error('buddy left with object path: %s', buddy.object_path()) | |
420 | logger.debug('buddy left with object path: %s', buddy.object_path()) | |
419 | 421 | |
420 | 422 | def read_file(self, file_path): |
421 | 423 | logging.debug('AbiWordActivity.read_file: %s, mimetype: %s', |
437 | 439 | logger.debug('Writing file as type source (text/plain)') |
438 | 440 | self.abiword_canvas.save('file://' + file_path, 'text/plain', '') |
439 | 441 | else: |
440 | #if the file is new, save in .odt format | |
442 | # if the file is new, save in .odt format | |
441 | 443 | if self.metadata['mime_type'] == '': |
442 | 444 | self.metadata['mime_type'] = 'application/rtf' |
443 | 445 |
0 | 100 | |
1 | ||
2 | * Fix create table function (Swarup N), | |
3 | * Add merge and split table cells (Ezequiel Pereira López, Swarup N), | |
4 | * Update POT file (James Cameron), | |
5 | * New translations (Chris Leonard et al). | |
6 | ||
7 | 99.1 | |
8 | ||
9 | * Add paste unformatted option (Ezequiel Pereira), | |
10 | * Demote errors to debug (James Cameron), | |
11 | * Port to TelepathyGLib (Rahul Bothra), | |
12 | * Add screenshots and update metadata (Vipul Gupta), | |
13 | * Update POT file (James Cameron). | |
14 | ||
0 | 15 | 99 |
1 | 16 | |
2 | 17 | * Use menu item instead of checkbox for image palette (Sam Parkinson), |
2 | 2 | bundle_id = org.laptop.AbiWordActivity |
3 | 3 | exec = sugar-activity AbiWordActivity.AbiWordActivity |
4 | 4 | icon = activity-write |
5 | activity_version = 99 | |
5 | activity_version = 100 | |
6 | 6 | max_participants = 6 |
7 | 7 | show_launcher = 1 |
8 | 8 | mime_types = text/rtf;text/plain;application/x-abiword;text/x-xml-abiword;application/msword;application/rtf;application/xhtml+xml;text/html;application/vnd.oasis.opendocument.text |
9 | 9 | license = GPLv2+ |
10 | 10 | summary = Write provides a space to put your words. Write a story, poem, report, anything! Try changing the look, and size of your text; even insert an image! |
11 | repository = https://github.com/sugarlabs/write-activity.git | |
11 | repository = https://github.com/sugarlabs/write-activity | |
12 | url = https://help.sugarlabs.org/en/write.html | |
13 | tags = Language;Documents;Media |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2018-03-31 13:10+1100\n" | |
10 | "POT-Creation-Date: 2019-02-21 16:23+1100\n" | |
11 | 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
26 | 26 | "anything! Try changing the look, and size of your text; even insert an image!" |
27 | 27 | msgstr "" |
28 | 28 | |
29 | #: AbiWordActivity.py:72 | |
29 | #: AbiWordActivity.py:73 | |
30 | 30 | msgid "Connecting..." |
31 | 31 | msgstr "" |
32 | 32 | |
33 | #: AbiWordActivity.py:102 | |
33 | #: AbiWordActivity.py:103 | |
34 | 34 | msgid "Edit" |
35 | 35 | msgstr "" |
36 | 36 | |
37 | #: AbiWordActivity.py:108 | |
37 | #: AbiWordActivity.py:109 | |
38 | 38 | msgid "View" |
39 | 39 | msgstr "" |
40 | 40 | |
41 | #: AbiWordActivity.py:123 | |
41 | #: AbiWordActivity.py:124 | |
42 | 42 | msgid "Text" |
43 | 43 | msgstr "" |
44 | 44 | |
45 | #: AbiWordActivity.py:129 | |
45 | #: AbiWordActivity.py:130 | |
46 | 46 | msgid "Paragraph" |
47 | 47 | msgstr "" |
48 | 48 | |
49 | #: AbiWordActivity.py:135 | |
49 | #: AbiWordActivity.py:136 | |
50 | 50 | msgid "Table" |
51 | 51 | msgstr "" |
52 | 52 | |
53 | #: AbiWordActivity.py:139 | |
53 | #: AbiWordActivity.py:140 | |
54 | 54 | msgid "Insert Image" |
55 | 55 | msgstr "" |
56 | 56 | |
57 | #: AbiWordActivity.py:147 | |
57 | #: AbiWordActivity.py:148 | |
58 | 58 | msgid "Floating" |
59 | 59 | msgstr "" |
60 | 60 | |
70 | 70 | msgid "Stop" |
71 | 71 | msgstr "" |
72 | 72 | |
73 | #: toolbar.py:100 | |
73 | #: toolbar.py:76 | |
74 | msgid "Paste unformatted" | |
75 | msgstr "" | |
76 | ||
77 | #: toolbar.py:109 | |
74 | 78 | msgid "Search" |
75 | 79 | msgstr "" |
76 | 80 | |
77 | #: toolbar.py:117 | |
81 | #: toolbar.py:126 | |
78 | 82 | msgid "Find previous" |
79 | 83 | msgstr "" |
80 | 84 | |
81 | #: toolbar.py:123 | |
85 | #: toolbar.py:132 | |
82 | 86 | msgid "Find next" |
83 | 87 | msgstr "" |
84 | 88 | |
85 | #: toolbar.py:226 | |
89 | #: toolbar.py:238 | |
86 | 90 | msgid "Create table" |
87 | 91 | msgstr "" |
88 | 92 | |
89 | #: toolbar.py:236 | |
93 | #: toolbar.py:248 | |
90 | 94 | msgid "Insert Row" |
91 | 95 | msgstr "" |
92 | 96 | |
93 | #: toolbar.py:242 | |
97 | #: toolbar.py:254 | |
94 | 98 | msgid "Delete Row" |
95 | 99 | msgstr "" |
96 | 100 | |
97 | #: toolbar.py:248 | |
101 | #: toolbar.py:260 | |
98 | 102 | msgid "Insert Column" |
99 | 103 | msgstr "" |
100 | 104 | |
101 | #: toolbar.py:254 | |
105 | #: toolbar.py:266 | |
102 | 106 | msgid "Delete Column" |
103 | 107 | msgstr "" |
104 | 108 | |
105 | #: toolbar.py:299 | |
109 | #: toolbar.py:272 | |
110 | msgid "Merge Cells" | |
111 | msgstr "" | |
112 | ||
113 | #: toolbar.py:278 | |
114 | msgid "Split Cells" | |
115 | msgstr "" | |
116 | ||
117 | #: toolbar.py:330 | |
106 | 118 | msgid "Zoom Out" |
107 | 119 | msgstr "" |
108 | 120 | |
109 | #: toolbar.py:306 | |
121 | #: toolbar.py:337 | |
110 | 122 | msgid "Zoom In" |
111 | 123 | msgstr "" |
112 | 124 | |
113 | #: toolbar.py:313 | |
125 | #: toolbar.py:344 | |
114 | 126 | msgid "Zoom to width" |
115 | 127 | msgstr "" |
116 | 128 | |
117 | #: toolbar.py:330 | |
129 | #: toolbar.py:361 | |
118 | 130 | msgid "%" |
119 | 131 | msgstr "" |
120 | 132 | |
121 | #: toolbar.py:342 | |
133 | #: toolbar.py:373 | |
122 | 134 | msgid "Page: " |
123 | 135 | msgstr "" |
124 | 136 | |
125 | #: toolbar.py:441 | |
137 | #: toolbar.py:472 | |
126 | 138 | msgid "Bold" |
127 | 139 | msgstr "" |
128 | 140 | |
129 | #: toolbar.py:450 | |
141 | #: toolbar.py:481 | |
130 | 142 | msgid "Italic" |
131 | 143 | msgstr "" |
132 | 144 | |
133 | #: toolbar.py:460 | |
145 | #: toolbar.py:491 | |
134 | 146 | msgid "Underline" |
135 | 147 | msgstr "" |
136 | 148 | |
137 | #: toolbar.py:490 | |
149 | #: toolbar.py:521 | |
138 | 150 | msgid "Choose alignment" |
139 | 151 | msgstr "" |
140 | 152 | |
141 | #: toolbar.py:498 | |
153 | #: toolbar.py:529 | |
142 | 154 | msgid "Left justify" |
143 | 155 | msgstr "" |
144 | 156 | |
145 | #: toolbar.py:502 | |
157 | #: toolbar.py:533 | |
146 | 158 | msgid "Center justify" |
147 | 159 | msgstr "" |
148 | 160 | |
149 | #: toolbar.py:506 | |
161 | #: toolbar.py:537 | |
150 | 162 | msgid "Right justify" |
151 | 163 | msgstr "" |
152 | 164 | |
153 | #: toolbar.py:510 | |
165 | #: toolbar.py:541 | |
154 | 166 | msgid "Fill justify" |
155 | 167 | msgstr "" |
156 | 168 | |
157 | #: toolbar.py:571 toolbar.py:620 | |
169 | #: toolbar.py:602 toolbar.py:651 | |
158 | 170 | msgid "Normal" |
159 | 171 | msgstr "" |
160 | 172 | |
161 | #: toolbar.py:577 | |
173 | #: toolbar.py:608 | |
162 | 174 | msgid "Heading 1" |
163 | 175 | msgstr "" |
164 | 176 | |
165 | #: toolbar.py:581 | |
177 | #: toolbar.py:612 | |
166 | 178 | msgid "Heading 2" |
167 | 179 | msgstr "" |
168 | 180 | |
169 | #: toolbar.py:585 | |
181 | #: toolbar.py:616 | |
170 | 182 | msgid "Heading 3" |
171 | 183 | msgstr "" |
172 | 184 | |
173 | #: toolbar.py:589 | |
185 | #: toolbar.py:620 | |
174 | 186 | msgid "Heading 4" |
175 | 187 | msgstr "" |
176 | 188 | |
177 | #: toolbar.py:593 | |
189 | #: toolbar.py:624 | |
178 | 190 | msgid "Block Text" |
179 | 191 | msgstr "" |
180 | 192 | |
181 | #: toolbar.py:597 | |
193 | #: toolbar.py:628 | |
182 | 194 | msgid "Plain Text" |
183 | 195 | msgstr "" |
184 | 196 | |
185 | #: toolbar.py:612 | |
197 | #: toolbar.py:643 | |
186 | 198 | msgid "Select list" |
187 | 199 | msgstr "" |
188 | 200 | |
189 | #: toolbar.py:630 | |
201 | #: toolbar.py:661 | |
190 | 202 | msgid "Bullet List" |
191 | 203 | msgstr "" |
192 | 204 | |
193 | #: toolbar.py:635 | |
205 | #: toolbar.py:666 | |
194 | 206 | msgid "Dashed List" |
195 | 207 | msgstr "" |
196 | 208 | |
197 | #: toolbar.py:640 | |
209 | #: toolbar.py:671 | |
198 | 210 | msgid "Numbered List" |
199 | 211 | msgstr "" |
200 | 212 | |
201 | #: toolbar.py:645 | |
213 | #: toolbar.py:676 | |
202 | 214 | msgid "Lower Case List" |
203 | 215 | msgstr "" |
204 | 216 | |
205 | #: toolbar.py:650 | |
217 | #: toolbar.py:681 | |
206 | 218 | msgid "Upper Case List" |
207 | 219 | msgstr "" |
208 | 220 |
6 | 6 | "Project-Id-Version: pt_BR\n" |
7 | 7 | "Report-Msgid-Bugs-To: \n" |
8 | 8 | "POT-Creation-Date: 2017-03-24 17:39+1100\n" |
9 | "PO-Revision-Date: 2014-12-21 15:37+0000\n" | |
10 | "Last-Translator: joaoeliakin <joaoeliakin@gmail.com>\n" | |
9 | "PO-Revision-Date: 2018-09-03 20:02+0000\n" | |
10 | "Last-Translator: Paulo Francisco <slomp@ufrgs.br>\n" | |
11 | 11 | "Language-Team: Brazilian Portuguese <fedora-docs-br@redhat.com>\n" |
12 | 12 | "Language: pt_BR\n" |
13 | 13 | "MIME-Version: 1.0\n" |
15 | 15 | "Content-Transfer-Encoding: 8bit\n" |
16 | 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" |
17 | 17 | "X-Generator: Pootle 2.5.1.1\n" |
18 | "X-POOTLE-MTIME: 1419176240.000000\n" | |
18 | "X-POOTLE-MTIME: 1536004978.000000\n" | |
19 | 19 | |
20 | 20 | #: activity/activity.info:2 |
21 | 21 | msgid "Write" |
28 | 28 | msgstr "" |
29 | 29 | "Write provê um espaço para colocar suas palavras. Escreva uma história, " |
30 | 30 | "poema ou reportagem, qualquer coisa! Tente modificar a aparência e o tamanho " |
31 | "do seu texto; até mesmo insira uma imagem!" | |
31 | "do seu texto; é possível inserir imagens!" | |
32 | 32 | |
33 | 33 | #: widgets.py:118 |
34 | 34 | msgid "Rich Text (RTF)" |
56 | 56 | |
57 | 57 | #: widgets.py:137 |
58 | 58 | msgid "Portable Document Format (PDF)" |
59 | msgstr "Formato de documento portável (PDF)" | |
59 | msgstr "Formato de Documento Portável (PDF)" | |
60 | 60 | |
61 | 61 | #: widgets.py:139 |
62 | 62 | msgid "PDF" |
88 | 88 | |
89 | 89 | #: toolbar.py:236 |
90 | 90 | msgid "Insert Row" |
91 | msgstr "Inserir Linha" | |
91 | msgstr "Inserir linha" | |
92 | 92 | |
93 | 93 | #: toolbar.py:242 |
94 | 94 | msgid "Delete Row" |
95 | msgstr "Remover Linha" | |
95 | msgstr "Excluir linha" | |
96 | 96 | |
97 | 97 | #: toolbar.py:248 |
98 | 98 | msgid "Insert Column" |
99 | msgstr "Inserir Coluna" | |
99 | msgstr "Inserir coluna" | |
100 | 100 | |
101 | 101 | #: toolbar.py:254 |
102 | 102 | msgid "Delete Column" |
103 | msgstr "Remover Coluna" | |
103 | msgstr "Excluir Coluna" | |
104 | 104 | |
105 | 105 | #: toolbar.py:299 |
106 | 106 | msgid "Zoom Out" |
137 | 137 | |
138 | 138 | #: toolbar.py:490 |
139 | 139 | msgid "Choose alignment" |
140 | msgstr "Alterar alinhamento" | |
140 | msgstr "Escolher alinhamento" | |
141 | 141 | |
142 | 142 | #: toolbar.py:498 |
143 | 143 | msgid "Left justify" |
144 | msgstr "Ajustado à esquerda" | |
144 | msgstr "Justificado à esquerda" | |
145 | 145 | |
146 | 146 | #: toolbar.py:502 |
147 | 147 | msgid "Center justify" |
148 | msgstr "Ajustado ao Centro" | |
148 | msgstr "Justificar ao centro" | |
149 | 149 | |
150 | 150 | #: toolbar.py:506 |
151 | 151 | msgid "Right justify" |
152 | msgstr "Ajustado à direita" | |
152 | msgstr "Justificar à direita" | |
153 | 153 | |
154 | 154 | #: toolbar.py:510 |
155 | 155 | msgid "Fill justify" |
156 | msgstr "Ajustado para preenchimento" | |
156 | msgstr "Justificar ambos os lados" | |
157 | 157 | |
158 | 158 | #: toolbar.py:571 toolbar.py:620 |
159 | 159 | msgid "Normal" |
190 | 190 | # I think it's better not to translate the term "bullet" |
191 | 191 | #: toolbar.py:630 |
192 | 192 | msgid "Bullet List" |
193 | msgstr "Lista" | |
193 | msgstr "Lista demarcada" | |
194 | 194 | |
195 | 195 | #: toolbar.py:635 |
196 | 196 | msgid "Dashed List" |
213 | 213 | |
214 | 214 | #: fontcombobox.py:90 |
215 | 215 | msgid "Select font" |
216 | msgstr "Selecione a fonte" | |
216 | msgstr "Selecionar fonte" | |
217 | 217 | |
218 | 218 | #: AbiWordActivity.py:69 |
219 | 219 | msgid "Connecting..." |
Binary diff not shown
Binary diff not shown
31 | 31 | from sugar3.graphics.colorbutton import ColorToolButton |
32 | 32 | from sugar3.graphics.toggletoolbutton import ToggleToolButton |
33 | 33 | from sugar3.graphics.palettemenu import PaletteMenuBox |
34 | from sugar3.graphics.palettemenu import PaletteMenuItem | |
34 | 35 | from sugar3.graphics import iconentry |
35 | 36 | from sugar3.graphics import style |
36 | 37 | from sugar3.activity.widgets import CopyButton |
66 | 67 | paste.connect('clicked', self.__paste_button_cb) |
67 | 68 | self.insert(paste, -1) |
68 | 69 | paste.show() |
70 | ||
71 | menu_box = PaletteMenuBox() | |
72 | paste.props.palette.set_content(menu_box) | |
73 | menu_box.show() | |
74 | menu_item = PaletteMenuItem() | |
75 | menu_item.set_label(_('Paste unformatted')) | |
76 | menu_item.connect('activate', self.__paste_special_button_cb) | |
77 | menu_box.append_item(menu_item) | |
69 | 78 | |
70 | 79 | separator = Gtk.SeparatorToolItem() |
71 | 80 | self.insert(separator, -1) |
160 | 169 | else: |
161 | 170 | self._abiword_canvas.paste() |
162 | 171 | |
172 | def __paste_special_button_cb(self, button): | |
173 | self._abiword_canvas.paste_special() | |
174 | ||
163 | 175 | def _search_entry_activated_cb(self, entry): |
164 | 176 | logger.debug('_search_entry_activated_cb') |
165 | 177 | if not self._search_entry.props.text: |
223 | 235 | |
224 | 236 | self._table_btn = ToolButton('create-table') |
225 | 237 | self._table_btn.set_tooltip(_('Create table')) |
226 | self.insert(self._table_btn, -1) | |
227 | 238 | self._grid_create = GridCreateWidget() |
228 | 239 | self._grid_create.show() |
229 | 240 | self._grid_create.connect('create-table', self._create_table_cb) |
230 | 241 | palette = self._table_btn.get_palette() |
231 | 242 | palette.set_content(self._grid_create) |
232 | 243 | self._table_btn.connect('clicked', self._table_btn_clicked_cb) |
244 | self.insert(self._table_btn, -1) | |
233 | 245 | |
234 | 246 | self._table_rows_after = ToolButton('row-insert') |
235 | 247 | self._table_rows_after.set_tooltip(_('Insert Row')) |
255 | 267 | 'clicked', self._table_delete_cols_cb) |
256 | 268 | self.insert(self._table_delete_cols, -1) |
257 | 269 | |
270 | self._merge_cells = ToolButton('format-columns-single') | |
271 | self._merge_cells.set_tooltip(_('Merge Cells')) | |
272 | self._merge_cells_id = self._merge_cells.connect( | |
273 | 'clicked', self._merge_cells_cb) | |
274 | self.insert(self._merge_cells, -1) | |
275 | ||
276 | self._split_cells = ToolButton('format-columns-double') | |
277 | self._split_cells.set_tooltip(_('Split Cells')) | |
278 | self._split_cells_id = self._split_cells.connect( | |
279 | 'clicked', self._split_cells_cb) | |
280 | self.insert(self._split_cells, -1) | |
281 | ||
258 | 282 | self.show_all() |
259 | 283 | |
260 | 284 | self._abiword_canvas.connect('table-state', self._isTable_cb) |
261 | #self._abiword_canvas.connect('image-selected', | |
285 | # self._abiword_canvas.connect('image-selected', | |
262 | 286 | # self._image_selected_cb) |
263 | 287 | |
264 | 288 | def _table_btn_clicked_cb(self, button): |
265 | button.get_palette().popup(True, button.get_palette().SECONDARY) | |
289 | button.get_palette().popup(True) | |
266 | 290 | |
267 | 291 | def _create_table_cb(self, abi, rows, cols): |
268 | 292 | self._abiword_canvas.insert_table(rows, cols) |
278 | 302 | |
279 | 303 | def _table_delete_cols_cb(self, button): |
280 | 304 | self._abiword_canvas.invoke_ex('deleteColumns', '', 0, 0) |
305 | ||
306 | def _merge_cells_cb(self, button): | |
307 | self._abiword_canvas.invoke('mergeCells') | |
308 | ||
309 | def _split_cells_cb(self, button): | |
310 | self._abiword_canvas.invoke('splitCells') | |
281 | 311 | |
282 | 312 | def _isTable_cb(self, abi, b): |
283 | 313 | self._table_rows_after.set_sensitive(b) |
284 | 314 | self._table_delete_rows.set_sensitive(b) |
285 | 315 | self._table_cols_after.set_sensitive(b) |
286 | 316 | self._table_delete_cols.set_sensitive(b) |
317 | self._merge_cells.set_sensitive(b) | |
318 | self._split_cells.set_sensitive(b) | |
287 | 319 | |
288 | 320 | |
289 | 321 | class ViewToolbar(Gtk.Toolbar): |
214 | 214 | try: |
215 | 215 | self.connect('request-clear-area', self.__request_clear_area_cb) |
216 | 216 | except: |
217 | logging.error('EXCEPTION: request-clear-area signal not available') | |
217 | logging.debug('EXCEPTION: request-clear-area signal not available') | |
218 | 218 | |
219 | 219 | try: |
220 | 220 | self.connect('unset-clear-area', self.__unset_clear_area_cb) |
221 | 221 | except: |
222 | logging.error('EXCEPTION: unset-clear-area signal not available') | |
222 | logging.debug('EXCEPTION: unset-clear-area signal not available') | |
223 | 223 | |
224 | 224 | self.osk_changed = False |
225 | 225 | self.dy = 0 |
272 | 272 | |
273 | 273 | def get_version(self): |
274 | 274 | version = Abi._version |
275 | logging.error('Abiword version %s', version) | |
275 | logging.debug('Abiword version %s', version) | |
276 | 276 | return version |