IconEditor/IconEditorWindow.py

changeset 454
d28d558f7484
parent 453
a81097a85889
child 456
d766de2ccbc7
equal deleted inserted replaced
453:a81097a85889 454:d28d558f7484
170 self.newAct.setStatusTip(self.trUtf8('Create a new icon')) 170 self.newAct.setStatusTip(self.trUtf8('Create a new icon'))
171 self.newAct.setWhatsThis(self.trUtf8( 171 self.newAct.setWhatsThis(self.trUtf8(
172 """<b>New</b>""" 172 """<b>New</b>"""
173 """<p>This creates a new icon.</p>""" 173 """<p>This creates a new icon.</p>"""
174 )) 174 ))
175 self.newAct.triggered.connect(self.__newIcon) 175 self.newAct.triggered[()].connect(self.__newIcon)
176 self.__actions.append(self.newAct) 176 self.__actions.append(self.newAct)
177 177
178 self.newWindowAct = E5Action(self.trUtf8('New Window'), 178 self.newWindowAct = E5Action(self.trUtf8('New Window'),
179 UI.PixmapCache.getIcon("newWindow.png"), 179 UI.PixmapCache.getIcon("newWindow.png"),
180 self.trUtf8('New &Window'), 180 self.trUtf8('New &Window'),
182 self.newWindowAct.setStatusTip(self.trUtf8('Open a new icon editor window')) 182 self.newWindowAct.setStatusTip(self.trUtf8('Open a new icon editor window'))
183 self.newWindowAct.setWhatsThis(self.trUtf8( 183 self.newWindowAct.setWhatsThis(self.trUtf8(
184 """<b>New Window</b>""" 184 """<b>New Window</b>"""
185 """<p>This opens a new icon editor window.</p>""" 185 """<p>This opens a new icon editor window.</p>"""
186 )) 186 ))
187 self.newWindowAct.triggered.connect(self.__newWindow) 187 self.newWindowAct.triggered[()].connect(self.__newWindow)
188 self.__actions.append(self.newWindowAct) 188 self.__actions.append(self.newWindowAct)
189 189
190 self.openAct = E5Action(self.trUtf8('Open'), 190 self.openAct = E5Action(self.trUtf8('Open'),
191 UI.PixmapCache.getIcon("open.png"), 191 UI.PixmapCache.getIcon("open.png"),
192 self.trUtf8('&Open...'), 192 self.trUtf8('&Open...'),
196 self.openAct.setWhatsThis(self.trUtf8( 196 self.openAct.setWhatsThis(self.trUtf8(
197 """<b>Open File</b>""" 197 """<b>Open File</b>"""
198 """<p>This opens a new icon file for editing.""" 198 """<p>This opens a new icon file for editing."""
199 """ It pops up a file selection dialog.</p>""" 199 """ It pops up a file selection dialog.</p>"""
200 )) 200 ))
201 self.openAct.triggered.connect(self.__openIcon) 201 self.openAct.triggered[()].connect(self.__openIcon)
202 self.__actions.append(self.openAct) 202 self.__actions.append(self.openAct)
203 203
204 self.saveAct = E5Action(self.trUtf8('Save'), 204 self.saveAct = E5Action(self.trUtf8('Save'),
205 UI.PixmapCache.getIcon("fileSave.png"), 205 UI.PixmapCache.getIcon("fileSave.png"),
206 self.trUtf8('&Save'), 206 self.trUtf8('&Save'),
209 self.saveAct.setStatusTip(self.trUtf8('Save the current icon')) 209 self.saveAct.setStatusTip(self.trUtf8('Save the current icon'))
210 self.saveAct.setWhatsThis(self.trUtf8( 210 self.saveAct.setWhatsThis(self.trUtf8(
211 """<b>Save File</b>""" 211 """<b>Save File</b>"""
212 """<p>Save the contents of the icon editor window.</p>""" 212 """<p>Save the contents of the icon editor window.</p>"""
213 )) 213 ))
214 self.saveAct.triggered.connect(self.__saveIcon) 214 self.saveAct.triggered[()].connect(self.__saveIcon)
215 self.__actions.append(self.saveAct) 215 self.__actions.append(self.saveAct)
216 216
217 self.saveAsAct = E5Action(self.trUtf8('Save As'), 217 self.saveAsAct = E5Action(self.trUtf8('Save As'),
218 UI.PixmapCache.getIcon("fileSaveAs.png"), 218 UI.PixmapCache.getIcon("fileSaveAs.png"),
219 self.trUtf8('Save &As...'), 219 self.trUtf8('Save &As...'),
223 self.trUtf8('Save the current icon to a new file')) 223 self.trUtf8('Save the current icon to a new file'))
224 self.saveAsAct.setWhatsThis(self.trUtf8( 224 self.saveAsAct.setWhatsThis(self.trUtf8(
225 """<b>Save As...</b>""" 225 """<b>Save As...</b>"""
226 """<p>Saves the current icon to a new file.</p>""" 226 """<p>Saves the current icon to a new file.</p>"""
227 )) 227 ))
228 self.saveAsAct.triggered.connect(self.__saveIconAs) 228 self.saveAsAct.triggered[()].connect(self.__saveIconAs)
229 self.__actions.append(self.saveAsAct) 229 self.__actions.append(self.saveAsAct)
230 230
231 self.closeAct = E5Action(self.trUtf8('Close'), 231 self.closeAct = E5Action(self.trUtf8('Close'),
232 UI.PixmapCache.getIcon("close.png"), 232 UI.PixmapCache.getIcon("close.png"),
233 self.trUtf8('&Close'), 233 self.trUtf8('&Close'),
236 self.closeAct.setStatusTip(self.trUtf8('Close the current icon editor window')) 236 self.closeAct.setStatusTip(self.trUtf8('Close the current icon editor window'))
237 self.closeAct.setWhatsThis(self.trUtf8( 237 self.closeAct.setWhatsThis(self.trUtf8(
238 """<b>Close</b>""" 238 """<b>Close</b>"""
239 """<p>Closes the current icon editor window.</p>""" 239 """<p>Closes the current icon editor window.</p>"""
240 )) 240 ))
241 self.closeAct.triggered.connect(self.close) 241 self.closeAct.triggered[()].connect(self.close)
242 self.__actions.append(self.closeAct) 242 self.__actions.append(self.closeAct)
243 243
244 self.closeAllAct = E5Action(self.trUtf8('Close All'), 244 self.closeAllAct = E5Action(self.trUtf8('Close All'),
245 self.trUtf8('Close &All'), 245 self.trUtf8('Close &All'),
246 0, 0, self, 'iconEditor_file_close_all') 246 0, 0, self, 'iconEditor_file_close_all')
247 self.closeAllAct.setStatusTip(self.trUtf8('Close all icon editor windows')) 247 self.closeAllAct.setStatusTip(self.trUtf8('Close all icon editor windows'))
248 self.closeAllAct.setWhatsThis(self.trUtf8( 248 self.closeAllAct.setWhatsThis(self.trUtf8(
249 """<b>Close All</b>""" 249 """<b>Close All</b>"""
250 """<p>Closes all icon editor windows except the first one.</p>""" 250 """<p>Closes all icon editor windows except the first one.</p>"""
251 )) 251 ))
252 self.closeAllAct.triggered.connect(self.__closeAll) 252 self.closeAllAct.triggered[()].connect(self.__closeAll)
253 self.__actions.append(self.closeAllAct) 253 self.__actions.append(self.closeAllAct)
254 254
255 self.exitAct = E5Action(self.trUtf8('Quit'), 255 self.exitAct = E5Action(self.trUtf8('Quit'),
256 UI.PixmapCache.getIcon("exit.png"), 256 UI.PixmapCache.getIcon("exit.png"),
257 self.trUtf8('&Quit'), 257 self.trUtf8('&Quit'),
261 self.exitAct.setWhatsThis(self.trUtf8( 261 self.exitAct.setWhatsThis(self.trUtf8(
262 """<b>Quit</b>""" 262 """<b>Quit</b>"""
263 """<p>Quit the icon editor.</p>""" 263 """<p>Quit the icon editor.</p>"""
264 )) 264 ))
265 if self.fromEric: 265 if self.fromEric:
266 self.exitAct.triggered.connect(self.close) 266 self.exitAct.triggered[()].connect(self.close)
267 else: 267 else:
268 self.connect(self.exitAct, SIGNAL('triggered()'), 268 self.connect(self.exitAct, SIGNAL('triggered()'),
269 qApp, SLOT('closeAllWindows()')) 269 qApp, SLOT('closeAllWindows()'))
270 self.__actions.append(self.exitAct) 270 self.__actions.append(self.exitAct)
271 271
282 self.undoAct.setStatusTip(self.trUtf8('Undo the last change')) 282 self.undoAct.setStatusTip(self.trUtf8('Undo the last change'))
283 self.undoAct.setWhatsThis(self.trUtf8(\ 283 self.undoAct.setWhatsThis(self.trUtf8(\
284 """<b>Undo</b>""" 284 """<b>Undo</b>"""
285 """<p>Undo the last change done.</p>""" 285 """<p>Undo the last change done.</p>"""
286 )) 286 ))
287 self.undoAct.triggered.connect(self.__editor.editUndo) 287 self.undoAct.triggered[()].connect(self.__editor.editUndo)
288 self.__actions.append(self.undoAct) 288 self.__actions.append(self.undoAct)
289 289
290 self.redoAct = E5Action(self.trUtf8('Redo'), 290 self.redoAct = E5Action(self.trUtf8('Redo'),
291 UI.PixmapCache.getIcon("editRedo.png"), 291 UI.PixmapCache.getIcon("editRedo.png"),
292 self.trUtf8('&Redo'), 292 self.trUtf8('&Redo'),
295 self.redoAct.setStatusTip(self.trUtf8('Redo the last change')) 295 self.redoAct.setStatusTip(self.trUtf8('Redo the last change'))
296 self.redoAct.setWhatsThis(self.trUtf8(\ 296 self.redoAct.setWhatsThis(self.trUtf8(\
297 """<b>Redo</b>""" 297 """<b>Redo</b>"""
298 """<p>Redo the last change done.</p>""" 298 """<p>Redo the last change done.</p>"""
299 )) 299 ))
300 self.redoAct.triggered.connect(self.__editor.editRedo) 300 self.redoAct.triggered[()].connect(self.__editor.editRedo)
301 self.__actions.append(self.redoAct) 301 self.__actions.append(self.redoAct)
302 302
303 self.cutAct = E5Action(self.trUtf8('Cut'), 303 self.cutAct = E5Action(self.trUtf8('Cut'),
304 UI.PixmapCache.getIcon("editCut.png"), 304 UI.PixmapCache.getIcon("editCut.png"),
305 self.trUtf8('Cu&t'), 305 self.trUtf8('Cu&t'),
309 self.cutAct.setStatusTip(self.trUtf8('Cut the selection')) 309 self.cutAct.setStatusTip(self.trUtf8('Cut the selection'))
310 self.cutAct.setWhatsThis(self.trUtf8(\ 310 self.cutAct.setWhatsThis(self.trUtf8(\
311 """<b>Cut</b>""" 311 """<b>Cut</b>"""
312 """<p>Cut the selected image area to the clipboard.</p>""" 312 """<p>Cut the selected image area to the clipboard.</p>"""
313 )) 313 ))
314 self.cutAct.triggered.connect(self.__editor.editCut) 314 self.cutAct.triggered[()].connect(self.__editor.editCut)
315 self.__actions.append(self.cutAct) 315 self.__actions.append(self.cutAct)
316 316
317 self.copyAct = E5Action(self.trUtf8('Copy'), 317 self.copyAct = E5Action(self.trUtf8('Copy'),
318 UI.PixmapCache.getIcon("editCopy.png"), 318 UI.PixmapCache.getIcon("editCopy.png"),
319 self.trUtf8('&Copy'), 319 self.trUtf8('&Copy'),
323 self.copyAct.setStatusTip(self.trUtf8('Copy the selection')) 323 self.copyAct.setStatusTip(self.trUtf8('Copy the selection'))
324 self.copyAct.setWhatsThis(self.trUtf8(\ 324 self.copyAct.setWhatsThis(self.trUtf8(\
325 """<b>Copy</b>""" 325 """<b>Copy</b>"""
326 """<p>Copy the selected image area to the clipboard.</p>""" 326 """<p>Copy the selected image area to the clipboard.</p>"""
327 )) 327 ))
328 self.copyAct.triggered.connect(self.__editor.editCopy) 328 self.copyAct.triggered[()].connect(self.__editor.editCopy)
329 self.__actions.append(self.copyAct) 329 self.__actions.append(self.copyAct)
330 330
331 self.pasteAct = E5Action(self.trUtf8('Paste'), 331 self.pasteAct = E5Action(self.trUtf8('Paste'),
332 UI.PixmapCache.getIcon("editPaste.png"), 332 UI.PixmapCache.getIcon("editPaste.png"),
333 self.trUtf8('&Paste'), 333 self.trUtf8('&Paste'),
337 self.pasteAct.setStatusTip(self.trUtf8('Paste the clipboard image')) 337 self.pasteAct.setStatusTip(self.trUtf8('Paste the clipboard image'))
338 self.pasteAct.setWhatsThis(self.trUtf8(\ 338 self.pasteAct.setWhatsThis(self.trUtf8(\
339 """<b>Paste</b>""" 339 """<b>Paste</b>"""
340 """<p>Paste the clipboard image.</p>""" 340 """<p>Paste the clipboard image.</p>"""
341 )) 341 ))
342 self.pasteAct.triggered.connect(self.__editor.editPaste) 342 self.pasteAct.triggered[()].connect(self.__editor.editPaste)
343 self.__actions.append(self.pasteAct) 343 self.__actions.append(self.pasteAct)
344 344
345 self.pasteNewAct = E5Action(self.trUtf8('Paste as New'), 345 self.pasteNewAct = E5Action(self.trUtf8('Paste as New'),
346 self.trUtf8('Paste as &New'), 346 self.trUtf8('Paste as &New'),
347 0, 0, self, 'iconEditor_edit_paste_as_new') 347 0, 0, self, 'iconEditor_edit_paste_as_new')
349 'Paste the clipboard image replacing the current one')) 349 'Paste the clipboard image replacing the current one'))
350 self.pasteNewAct.setWhatsThis(self.trUtf8(\ 350 self.pasteNewAct.setWhatsThis(self.trUtf8(\
351 """<b>Paste as New</b>""" 351 """<b>Paste as New</b>"""
352 """<p>Paste the clipboard image replacing the current one.</p>""" 352 """<p>Paste the clipboard image replacing the current one.</p>"""
353 )) 353 ))
354 self.pasteNewAct.triggered.connect(self.__editor.editPasteAsNew) 354 self.pasteNewAct.triggered[()].connect(self.__editor.editPasteAsNew)
355 self.__actions.append(self.pasteNewAct) 355 self.__actions.append(self.pasteNewAct)
356 356
357 self.deleteAct = E5Action(self.trUtf8('Clear'), 357 self.deleteAct = E5Action(self.trUtf8('Clear'),
358 UI.PixmapCache.getIcon("editDelete.png"), 358 UI.PixmapCache.getIcon("editDelete.png"),
359 self.trUtf8('Cl&ear'), 359 self.trUtf8('Cl&ear'),
363 self.deleteAct.setStatusTip(self.trUtf8('Clear the icon image')) 363 self.deleteAct.setStatusTip(self.trUtf8('Clear the icon image'))
364 self.deleteAct.setWhatsThis(self.trUtf8(\ 364 self.deleteAct.setWhatsThis(self.trUtf8(\
365 """<b>Clear</b>""" 365 """<b>Clear</b>"""
366 """<p>Clear the icon image and set it to be completely transparent.</p>""" 366 """<p>Clear the icon image and set it to be completely transparent.</p>"""
367 )) 367 ))
368 self.deleteAct.triggered.connect(self.__editor.editClear) 368 self.deleteAct.triggered[()].connect(self.__editor.editClear)
369 self.__actions.append(self.deleteAct) 369 self.__actions.append(self.deleteAct)
370 370
371 self.selectAllAct = E5Action(self.trUtf8('Select All'), 371 self.selectAllAct = E5Action(self.trUtf8('Select All'),
372 self.trUtf8('&Select All'), 372 self.trUtf8('&Select All'),
373 QKeySequence(self.trUtf8("Ctrl+A", "Edit|Select All")), 373 QKeySequence(self.trUtf8("Ctrl+A", "Edit|Select All")),
376 self.selectAllAct.setStatusTip(self.trUtf8('Select the complete icon image')) 376 self.selectAllAct.setStatusTip(self.trUtf8('Select the complete icon image'))
377 self.selectAllAct.setWhatsThis(self.trUtf8(\ 377 self.selectAllAct.setWhatsThis(self.trUtf8(\
378 """<b>Select All</b>""" 378 """<b>Select All</b>"""
379 """<p>Selects the complete icon image.</p>""" 379 """<p>Selects the complete icon image.</p>"""
380 )) 380 ))
381 self.selectAllAct.triggered.connect(self.__editor.editSelectAll) 381 self.selectAllAct.triggered[()].connect(self.__editor.editSelectAll)
382 self.__actions.append(self.selectAllAct) 382 self.__actions.append(self.selectAllAct)
383 383
384 self.resizeAct = E5Action(self.trUtf8('Change Size'), 384 self.resizeAct = E5Action(self.trUtf8('Change Size'),
385 UI.PixmapCache.getIcon("transformResize.png"), 385 UI.PixmapCache.getIcon("transformResize.png"),
386 self.trUtf8('Change Si&ze...'), 386 self.trUtf8('Change Si&ze...'),
389 self.resizeAct.setStatusTip(self.trUtf8('Change the icon size')) 389 self.resizeAct.setStatusTip(self.trUtf8('Change the icon size'))
390 self.resizeAct.setWhatsThis(self.trUtf8(\ 390 self.resizeAct.setWhatsThis(self.trUtf8(\
391 """<b>Change Size...</b>""" 391 """<b>Change Size...</b>"""
392 """<p>Changes the icon size.</p>""" 392 """<p>Changes the icon size.</p>"""
393 )) 393 ))
394 self.resizeAct.triggered.connect(self.__editor.editResize) 394 self.resizeAct.triggered[()].connect(self.__editor.editResize)
395 self.__actions.append(self.resizeAct) 395 self.__actions.append(self.resizeAct)
396 396
397 self.grayscaleAct = E5Action(self.trUtf8('Grayscale'), 397 self.grayscaleAct = E5Action(self.trUtf8('Grayscale'),
398 UI.PixmapCache.getIcon("grayscale.png"), 398 UI.PixmapCache.getIcon("grayscale.png"),
399 self.trUtf8('&Grayscale'), 399 self.trUtf8('&Grayscale'),
402 self.grayscaleAct.setStatusTip(self.trUtf8('Change the icon to grayscale')) 402 self.grayscaleAct.setStatusTip(self.trUtf8('Change the icon to grayscale'))
403 self.grayscaleAct.setWhatsThis(self.trUtf8(\ 403 self.grayscaleAct.setWhatsThis(self.trUtf8(\
404 """<b>Grayscale</b>""" 404 """<b>Grayscale</b>"""
405 """<p>Changes the icon to grayscale.</p>""" 405 """<p>Changes the icon to grayscale.</p>"""
406 )) 406 ))
407 self.grayscaleAct.triggered.connect(self.__editor.grayScale) 407 self.grayscaleAct.triggered[()].connect(self.__editor.grayScale)
408 self.__actions.append(self.grayscaleAct) 408 self.__actions.append(self.grayscaleAct)
409 409
410 self.redoAct.setEnabled(False) 410 self.redoAct.setEnabled(False)
411 self.connect(self.__editor, SIGNAL("canRedoChanged(bool)"), 411 self.connect(self.__editor, SIGNAL("canRedoChanged(bool)"),
412 self.redoAct, SLOT("setEnabled(bool)")) 412 self.redoAct, SLOT("setEnabled(bool)"))
441 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the icon')) 441 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the icon'))
442 self.zoomInAct.setWhatsThis(self.trUtf8( 442 self.zoomInAct.setWhatsThis(self.trUtf8(
443 """<b>Zoom in</b>""" 443 """<b>Zoom in</b>"""
444 """<p>Zoom in on the icon. This makes the grid bigger.</p>""" 444 """<p>Zoom in on the icon. This makes the grid bigger.</p>"""
445 )) 445 ))
446 self.zoomInAct.triggered.connect(self.__zoomIn) 446 self.zoomInAct.triggered[()].connect(self.__zoomIn)
447 self.__actions.append(self.zoomInAct) 447 self.__actions.append(self.zoomInAct)
448 448
449 self.zoomOutAct = E5Action(self.trUtf8('Zoom out'), 449 self.zoomOutAct = E5Action(self.trUtf8('Zoom out'),
450 UI.PixmapCache.getIcon("zoomOut.png"), 450 UI.PixmapCache.getIcon("zoomOut.png"),
451 self.trUtf8('Zoom &out'), 451 self.trUtf8('Zoom &out'),
454 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the icon')) 454 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the icon'))
455 self.zoomOutAct.setWhatsThis(self.trUtf8( 455 self.zoomOutAct.setWhatsThis(self.trUtf8(
456 """<b>Zoom out</b>""" 456 """<b>Zoom out</b>"""
457 """<p>Zoom out on the icon. This makes the grid smaller.</p>""" 457 """<p>Zoom out on the icon. This makes the grid smaller.</p>"""
458 )) 458 ))
459 self.zoomOutAct.triggered.connect(self.__zoomOut) 459 self.zoomOutAct.triggered[()].connect(self.__zoomOut)
460 self.__actions.append(self.zoomOutAct) 460 self.__actions.append(self.zoomOutAct)
461 461
462 self.zoomResetAct = E5Action(self.trUtf8('Zoom reset'), 462 self.zoomResetAct = E5Action(self.trUtf8('Zoom reset'),
463 UI.PixmapCache.getIcon("zoomReset.png"), 463 UI.PixmapCache.getIcon("zoomReset.png"),
464 self.trUtf8('Zoom &reset'), 464 self.trUtf8('Zoom &reset'),
468 self.zoomResetAct.setWhatsThis(self.trUtf8( 468 self.zoomResetAct.setWhatsThis(self.trUtf8(
469 """<b>Zoom reset</b>""" 469 """<b>Zoom reset</b>"""
470 """<p>Reset the zoom of the icon. """ 470 """<p>Reset the zoom of the icon. """
471 """This sets the zoom factor to 100%.</p>""" 471 """This sets the zoom factor to 100%.</p>"""
472 )) 472 ))
473 self.zoomResetAct.triggered.connect(self.__zoomReset) 473 self.zoomResetAct.triggered[()].connect(self.__zoomReset)
474 self.__actions.append(self.zoomResetAct) 474 self.__actions.append(self.zoomResetAct)
475 475
476 self.zoomToAct = E5Action(self.trUtf8('Zoom'), 476 self.zoomToAct = E5Action(self.trUtf8('Zoom'),
477 UI.PixmapCache.getIcon("zoomTo.png"), 477 UI.PixmapCache.getIcon("zoomTo.png"),
478 self.trUtf8('&Zoom...'), 478 self.trUtf8('&Zoom...'),
483 self.zoomToAct.setWhatsThis(self.trUtf8( 483 self.zoomToAct.setWhatsThis(self.trUtf8(
484 """<b>Zoom</b>""" 484 """<b>Zoom</b>"""
485 """<p>Zoom the icon. This opens a dialog where the""" 485 """<p>Zoom the icon. This opens a dialog where the"""
486 """ desired zoom factor can be entered.</p>""" 486 """ desired zoom factor can be entered.</p>"""
487 )) 487 ))
488 self.zoomToAct.triggered.connect(self.__zoom) 488 self.zoomToAct.triggered[()].connect(self.__zoom)
489 self.__actions.append(self.zoomToAct) 489 self.__actions.append(self.zoomToAct)
490 490
491 self.showGridAct = E5Action(self.trUtf8('Show Grid'), 491 self.showGridAct = E5Action(self.trUtf8('Show Grid'),
492 UI.PixmapCache.getIcon("grid.png"), 492 UI.PixmapCache.getIcon("grid.png"),
493 self.trUtf8('Show &Grid'), 493 self.trUtf8('Show &Grid'),
523 """<b>Free hand</b>""" 523 """<b>Free hand</b>"""
524 """<p>Draws non linear lines.</p>""" 524 """<p>Draws non linear lines.</p>"""
525 )) 525 ))
526 self.drawPencilAct.setCheckable(True) 526 self.drawPencilAct.setCheckable(True)
527 self.esm.setMapping(self.drawPencilAct, IconEditorGrid.Pencil) 527 self.esm.setMapping(self.drawPencilAct, IconEditorGrid.Pencil)
528 self.drawPencilAct.triggered.connect(self.esm.map) 528 self.drawPencilAct.triggered[()].connect(self.esm.map)
529 self.__actions.append(self.drawPencilAct) 529 self.__actions.append(self.drawPencilAct)
530 530
531 self.drawColorPickerAct = E5Action(self.trUtf8('Color Picker'), 531 self.drawColorPickerAct = E5Action(self.trUtf8('Color Picker'),
532 UI.PixmapCache.getIcon("colorPicker.png"), 532 UI.PixmapCache.getIcon("colorPicker.png"),
533 self.trUtf8('&Color Picker'), 533 self.trUtf8('&Color Picker'),
538 """<p>The color of the pixel clicked on will become """ 538 """<p>The color of the pixel clicked on will become """
539 """the current draw color.</p>""" 539 """the current draw color.</p>"""
540 )) 540 ))
541 self.drawColorPickerAct.setCheckable(True) 541 self.drawColorPickerAct.setCheckable(True)
542 self.esm.setMapping(self.drawColorPickerAct, IconEditorGrid.ColorPicker) 542 self.esm.setMapping(self.drawColorPickerAct, IconEditorGrid.ColorPicker)
543 self.drawColorPickerAct.triggered.connect(self.esm.map) 543 self.drawColorPickerAct.triggered[()].connect(self.esm.map)
544 self.__actions.append(self.drawColorPickerAct) 544 self.__actions.append(self.drawColorPickerAct)
545 545
546 self.drawRectangleAct = E5Action(self.trUtf8('Rectangle'), 546 self.drawRectangleAct = E5Action(self.trUtf8('Rectangle'),
547 UI.PixmapCache.getIcon("drawRectangle.png"), 547 UI.PixmapCache.getIcon("drawRectangle.png"),
548 self.trUtf8('&Rectangle'), 548 self.trUtf8('&Rectangle'),
552 """<b>Rectangle</b>""" 552 """<b>Rectangle</b>"""
553 """<p>Draw a rectangle.</p>""" 553 """<p>Draw a rectangle.</p>"""
554 )) 554 ))
555 self.drawRectangleAct.setCheckable(True) 555 self.drawRectangleAct.setCheckable(True)
556 self.esm.setMapping(self.drawRectangleAct, IconEditorGrid.Rectangle) 556 self.esm.setMapping(self.drawRectangleAct, IconEditorGrid.Rectangle)
557 self.drawRectangleAct.triggered.connect(self.esm.map) 557 self.drawRectangleAct.triggered[()].connect(self.esm.map)
558 self.__actions.append(self.drawRectangleAct) 558 self.__actions.append(self.drawRectangleAct)
559 559
560 self.drawFilledRectangleAct = E5Action(self.trUtf8('Filled Rectangle'), 560 self.drawFilledRectangleAct = E5Action(self.trUtf8('Filled Rectangle'),
561 UI.PixmapCache.getIcon("drawRectangleFilled.png"), 561 UI.PixmapCache.getIcon("drawRectangleFilled.png"),
562 self.trUtf8('F&illed Rectangle'), 562 self.trUtf8('F&illed Rectangle'),
566 """<b>Filled Rectangle</b>""" 566 """<b>Filled Rectangle</b>"""
567 """<p>Draw a filled rectangle.</p>""" 567 """<p>Draw a filled rectangle.</p>"""
568 )) 568 ))
569 self.drawFilledRectangleAct.setCheckable(True) 569 self.drawFilledRectangleAct.setCheckable(True)
570 self.esm.setMapping(self.drawFilledRectangleAct, IconEditorGrid.FilledRectangle) 570 self.esm.setMapping(self.drawFilledRectangleAct, IconEditorGrid.FilledRectangle)
571 self.drawFilledRectangleAct.triggered.connect(self.esm.map) 571 self.drawFilledRectangleAct.triggered[()].connect(self.esm.map)
572 self.__actions.append(self.drawFilledRectangleAct) 572 self.__actions.append(self.drawFilledRectangleAct)
573 573
574 self.drawCircleAct = E5Action(self.trUtf8('Circle'), 574 self.drawCircleAct = E5Action(self.trUtf8('Circle'),
575 UI.PixmapCache.getIcon("drawCircle.png"), 575 UI.PixmapCache.getIcon("drawCircle.png"),
576 self.trUtf8('Circle'), 576 self.trUtf8('Circle'),
580 """<b>Circle</b>""" 580 """<b>Circle</b>"""
581 """<p>Draw a circle.</p>""" 581 """<p>Draw a circle.</p>"""
582 )) 582 ))
583 self.drawCircleAct.setCheckable(True) 583 self.drawCircleAct.setCheckable(True)
584 self.esm.setMapping(self.drawCircleAct, IconEditorGrid.Circle) 584 self.esm.setMapping(self.drawCircleAct, IconEditorGrid.Circle)
585 self.drawCircleAct.triggered.connect(self.esm.map) 585 self.drawCircleAct.triggered[()].connect(self.esm.map)
586 self.__actions.append(self.drawCircleAct) 586 self.__actions.append(self.drawCircleAct)
587 587
588 self.drawFilledCircleAct = E5Action(self.trUtf8('Filled Circle'), 588 self.drawFilledCircleAct = E5Action(self.trUtf8('Filled Circle'),
589 UI.PixmapCache.getIcon("drawCircleFilled.png"), 589 UI.PixmapCache.getIcon("drawCircleFilled.png"),
590 self.trUtf8('Fille&d Circle'), 590 self.trUtf8('Fille&d Circle'),
594 """<b>Filled Circle</b>""" 594 """<b>Filled Circle</b>"""
595 """<p>Draw a filled circle.</p>""" 595 """<p>Draw a filled circle.</p>"""
596 )) 596 ))
597 self.drawFilledCircleAct.setCheckable(True) 597 self.drawFilledCircleAct.setCheckable(True)
598 self.esm.setMapping(self.drawFilledCircleAct, IconEditorGrid.FilledCircle) 598 self.esm.setMapping(self.drawFilledCircleAct, IconEditorGrid.FilledCircle)
599 self.drawFilledCircleAct.triggered.connect(self.esm.map) 599 self.drawFilledCircleAct.triggered[()].connect(self.esm.map)
600 self.__actions.append(self.drawFilledCircleAct) 600 self.__actions.append(self.drawFilledCircleAct)
601 601
602 self.drawEllipseAct = E5Action(self.trUtf8('Ellipse'), 602 self.drawEllipseAct = E5Action(self.trUtf8('Ellipse'),
603 UI.PixmapCache.getIcon("drawEllipse.png"), 603 UI.PixmapCache.getIcon("drawEllipse.png"),
604 self.trUtf8('&Ellipse'), 604 self.trUtf8('&Ellipse'),
608 """<b>Ellipse</b>""" 608 """<b>Ellipse</b>"""
609 """<p>Draw an ellipse.</p>""" 609 """<p>Draw an ellipse.</p>"""
610 )) 610 ))
611 self.drawEllipseAct.setCheckable(True) 611 self.drawEllipseAct.setCheckable(True)
612 self.esm.setMapping(self.drawEllipseAct, IconEditorGrid.Ellipse) 612 self.esm.setMapping(self.drawEllipseAct, IconEditorGrid.Ellipse)
613 self.drawEllipseAct.triggered.connect(self.esm.map) 613 self.drawEllipseAct.triggered[()].connect(self.esm.map)
614 self.__actions.append(self.drawEllipseAct) 614 self.__actions.append(self.drawEllipseAct)
615 615
616 self.drawFilledEllipseAct = E5Action(self.trUtf8('Filled Ellipse'), 616 self.drawFilledEllipseAct = E5Action(self.trUtf8('Filled Ellipse'),
617 UI.PixmapCache.getIcon("drawEllipseFilled.png"), 617 UI.PixmapCache.getIcon("drawEllipseFilled.png"),
618 self.trUtf8('Fille&d Elli&pse'), 618 self.trUtf8('Fille&d Elli&pse'),
622 """<b>Filled Ellipse</b>""" 622 """<b>Filled Ellipse</b>"""
623 """<p>Draw a filled ellipse.</p>""" 623 """<p>Draw a filled ellipse.</p>"""
624 )) 624 ))
625 self.drawFilledEllipseAct.setCheckable(True) 625 self.drawFilledEllipseAct.setCheckable(True)
626 self.esm.setMapping(self.drawFilledEllipseAct, IconEditorGrid.FilledEllipse) 626 self.esm.setMapping(self.drawFilledEllipseAct, IconEditorGrid.FilledEllipse)
627 self.drawFilledEllipseAct.triggered.connect(self.esm.map) 627 self.drawFilledEllipseAct.triggered[()].connect(self.esm.map)
628 self.__actions.append(self.drawFilledEllipseAct) 628 self.__actions.append(self.drawFilledEllipseAct)
629 629
630 self.drawFloodFillAct = E5Action(self.trUtf8('Flood Fill'), 630 self.drawFloodFillAct = E5Action(self.trUtf8('Flood Fill'),
631 UI.PixmapCache.getIcon("drawFill.png"), 631 UI.PixmapCache.getIcon("drawFill.png"),
632 self.trUtf8('Fl&ood Fill'), 632 self.trUtf8('Fl&ood Fill'),
637 """<p>Fill adjoining pixels with the same color with """ 637 """<p>Fill adjoining pixels with the same color with """
638 """the current color.</p>""" 638 """the current color.</p>"""
639 )) 639 ))
640 self.drawFloodFillAct.setCheckable(True) 640 self.drawFloodFillAct.setCheckable(True)
641 self.esm.setMapping(self.drawFloodFillAct, IconEditorGrid.Fill) 641 self.esm.setMapping(self.drawFloodFillAct, IconEditorGrid.Fill)
642 self.drawFloodFillAct.triggered.connect(self.esm.map) 642 self.drawFloodFillAct.triggered[()].connect(self.esm.map)
643 self.__actions.append(self.drawFloodFillAct) 643 self.__actions.append(self.drawFloodFillAct)
644 644
645 self.drawLineAct = E5Action(self.trUtf8('Line'), 645 self.drawLineAct = E5Action(self.trUtf8('Line'),
646 UI.PixmapCache.getIcon("drawLine.png"), 646 UI.PixmapCache.getIcon("drawLine.png"),
647 self.trUtf8('&Line'), 647 self.trUtf8('&Line'),
651 """<b>Line</b>""" 651 """<b>Line</b>"""
652 """<p>Draw a line.</p>""" 652 """<p>Draw a line.</p>"""
653 )) 653 ))
654 self.drawLineAct.setCheckable(True) 654 self.drawLineAct.setCheckable(True)
655 self.esm.setMapping(self.drawLineAct, IconEditorGrid.Line) 655 self.esm.setMapping(self.drawLineAct, IconEditorGrid.Line)
656 self.drawLineAct.triggered.connect(self.esm.map) 656 self.drawLineAct.triggered[()].connect(self.esm.map)
657 self.__actions.append(self.drawLineAct) 657 self.__actions.append(self.drawLineAct)
658 658
659 self.drawEraserAct = E5Action(self.trUtf8('Eraser (Transparent)'), 659 self.drawEraserAct = E5Action(self.trUtf8('Eraser (Transparent)'),
660 UI.PixmapCache.getIcon("drawEraser.png"), 660 UI.PixmapCache.getIcon("drawEraser.png"),
661 self.trUtf8('Eraser (&Transparent)'), 661 self.trUtf8('Eraser (&Transparent)'),
665 """<b>Eraser (Transparent)</b>""" 665 """<b>Eraser (Transparent)</b>"""
666 """<p>Erase pixels by setting them to transparent.</p>""" 666 """<p>Erase pixels by setting them to transparent.</p>"""
667 )) 667 ))
668 self.drawEraserAct.setCheckable(True) 668 self.drawEraserAct.setCheckable(True)
669 self.esm.setMapping(self.drawEraserAct, IconEditorGrid.Rubber) 669 self.esm.setMapping(self.drawEraserAct, IconEditorGrid.Rubber)
670 self.drawEraserAct.triggered.connect(self.esm.map) 670 self.drawEraserAct.triggered[()].connect(self.esm.map)
671 self.__actions.append(self.drawEraserAct) 671 self.__actions.append(self.drawEraserAct)
672 672
673 self.drawRectangleSelectionAct = E5Action(self.trUtf8('Rectangular Selection'), 673 self.drawRectangleSelectionAct = E5Action(self.trUtf8('Rectangular Selection'),
674 UI.PixmapCache.getIcon("selectRectangle.png"), 674 UI.PixmapCache.getIcon("selectRectangle.png"),
675 self.trUtf8('Rect&angular Selection'), 675 self.trUtf8('Rect&angular Selection'),
680 """<p>Select a rectangular section of the icon using the mouse.</p>""" 680 """<p>Select a rectangular section of the icon using the mouse.</p>"""
681 )) 681 ))
682 self.drawRectangleSelectionAct.setCheckable(True) 682 self.drawRectangleSelectionAct.setCheckable(True)
683 self.esm.setMapping(self.drawRectangleSelectionAct, 683 self.esm.setMapping(self.drawRectangleSelectionAct,
684 IconEditorGrid.RectangleSelection) 684 IconEditorGrid.RectangleSelection)
685 self.drawRectangleSelectionAct.triggered.connect(self.esm.map) 685 self.drawRectangleSelectionAct.triggered[()].connect(self.esm.map)
686 self.__actions.append(self.drawRectangleSelectionAct) 686 self.__actions.append(self.drawRectangleSelectionAct)
687 687
688 self.drawCircleSelectionAct = E5Action(self.trUtf8('Circular Selection'), 688 self.drawCircleSelectionAct = E5Action(self.trUtf8('Circular Selection'),
689 UI.PixmapCache.getIcon("selectCircle.png"), 689 UI.PixmapCache.getIcon("selectCircle.png"),
690 self.trUtf8('Rect&angular Selection'), 690 self.trUtf8('Rect&angular Selection'),
695 """<p>Select a circular section of the icon using the mouse.</p>""" 695 """<p>Select a circular section of the icon using the mouse.</p>"""
696 )) 696 ))
697 self.drawCircleSelectionAct.setCheckable(True) 697 self.drawCircleSelectionAct.setCheckable(True)
698 self.esm.setMapping(self.drawCircleSelectionAct, 698 self.esm.setMapping(self.drawCircleSelectionAct,
699 IconEditorGrid.CircleSelection) 699 IconEditorGrid.CircleSelection)
700 self.drawCircleSelectionAct.triggered.connect(self.esm.map) 700 self.drawCircleSelectionAct.triggered[()].connect(self.esm.map)
701 self.__actions.append(self.drawCircleSelectionAct) 701 self.__actions.append(self.drawCircleSelectionAct)
702 702
703 self.drawPencilAct.setChecked(True) 703 self.drawPencilAct.setChecked(True)
704 704
705 def __initHelpActions(self): 705 def __initHelpActions(self):
711 0, 0, self, 'iconEditor_help_about') 711 0, 0, self, 'iconEditor_help_about')
712 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) 712 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software'))
713 self.aboutAct.setWhatsThis(self.trUtf8( 713 self.aboutAct.setWhatsThis(self.trUtf8(
714 """<b>About</b>""" 714 """<b>About</b>"""
715 """<p>Display some information about this software.</p>""")) 715 """<p>Display some information about this software.</p>"""))
716 self.aboutAct.triggered.connect(self.__about) 716 self.aboutAct.triggered[()].connect(self.__about)
717 self.__actions.append(self.aboutAct) 717 self.__actions.append(self.aboutAct)
718 718
719 self.aboutQtAct = E5Action(self.trUtf8('About Qt'), 719 self.aboutQtAct = E5Action(self.trUtf8('About Qt'),
720 self.trUtf8('About &Qt'), 720 self.trUtf8('About &Qt'),
721 0, 0, self, 'iconEditor_help_about_qt') 721 0, 0, self, 'iconEditor_help_about_qt')
723 self.trUtf8('Display information about the Qt toolkit')) 723 self.trUtf8('Display information about the Qt toolkit'))
724 self.aboutQtAct.setWhatsThis(self.trUtf8( 724 self.aboutQtAct.setWhatsThis(self.trUtf8(
725 """<b>About Qt</b>""" 725 """<b>About Qt</b>"""
726 """<p>Display some information about the Qt toolkit.</p>""" 726 """<p>Display some information about the Qt toolkit.</p>"""
727 )) 727 ))
728 self.aboutQtAct.triggered.connect(self.__aboutQt) 728 self.aboutQtAct.triggered[()].connect(self.__aboutQt)
729 self.__actions.append(self.aboutQtAct) 729 self.__actions.append(self.aboutQtAct)
730 730
731 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), 731 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'),
732 UI.PixmapCache.getIcon("whatsThis.png"), 732 UI.PixmapCache.getIcon("whatsThis.png"),
733 self.trUtf8('&What\'s This?'), 733 self.trUtf8('&What\'s This?'),
740 """ question mark, and you can click on the interface elements to get""" 740 """ question mark, and you can click on the interface elements to get"""
741 """ a short description of what they do and how to use them. In""" 741 """ a short description of what they do and how to use them. In"""
742 """ dialogs, this feature can be accessed using the context help button""" 742 """ dialogs, this feature can be accessed using the context help button"""
743 """ in the titlebar.</p>""" 743 """ in the titlebar.</p>"""
744 )) 744 ))
745 self.whatsThisAct.triggered.connect(self.__whatsThis) 745 self.whatsThisAct.triggered[()].connect(self.__whatsThis)
746 self.__actions.append(self.whatsThisAct) 746 self.__actions.append(self.whatsThisAct)
747 747
748 def __initMenus(self): 748 def __initMenus(self):
749 """ 749 """
750 Private method to create the menus. 750 Private method to create the menus.

eric ide

mercurial