475 def __initChatMenu(self): |
475 def __initChatMenu(self): |
476 """ |
476 """ |
477 Private slot to initialize the chat edit context menu. |
477 Private slot to initialize the chat edit context menu. |
478 """ |
478 """ |
479 self.__chatMenu = QMenu(self) |
479 self.__chatMenu = QMenu(self) |
480 self.__cutChatAct = \ |
|
481 self.__chatMenu.addAction( |
|
482 UI.PixmapCache.getIcon("editCut.png"), |
|
483 self.trUtf8("Cut"), self.__cutChat) |
|
484 self.__copyChatAct = \ |
480 self.__copyChatAct = \ |
485 self.__chatMenu.addAction( |
481 self.__chatMenu.addAction( |
486 UI.PixmapCache.getIcon("editCopy.png"), |
482 UI.PixmapCache.getIcon("editCopy.png"), |
487 self.trUtf8("Copy"), self.__copyChat) |
483 self.trUtf8("Copy"), self.__copyChat) |
488 self.__chatMenu.addSeparator() |
484 self.__chatMenu.addSeparator() |
513 Private slot to react to text selection/deselection of the chat edit. |
509 Private slot to react to text selection/deselection of the chat edit. |
514 |
510 |
515 @param yes flag signaling the availability of selected text (boolean) |
511 @param yes flag signaling the availability of selected text (boolean) |
516 """ |
512 """ |
517 self.__copyChatAct.setEnabled(yes) |
513 self.__copyChatAct.setEnabled(yes) |
518 self.__cutChatAct.setEnabled(yes) |
|
519 |
514 |
520 @pyqtSlot(QPoint) |
515 @pyqtSlot(QPoint) |
521 def on_chatEdit_customContextMenuRequested(self, pos): |
516 def on_chatEdit_customContextMenuRequested(self, pos): |
522 """ |
517 """ |
523 Private slot to show the context menu for the chat. |
518 Private slot to show the context menu for the chat. |
580 """ |
575 """ |
581 Private slot to copy the contents of the chat display to the clipboard. |
576 Private slot to copy the contents of the chat display to the clipboard. |
582 """ |
577 """ |
583 self.chatEdit.copy() |
578 self.chatEdit.copy() |
584 |
579 |
585 def __cutChat(self): |
|
586 """ |
|
587 Private slot to cut the contents of the chat display to the clipboard. |
|
588 """ |
|
589 self.chatEdit.cut() |
|
590 |
|
591 def __copyAllChat(self): |
580 def __copyAllChat(self): |
592 """ |
581 """ |
593 Private slot to copy the contents of the chat display to the clipboard. |
582 Private slot to copy the contents of the chat display to the clipboard. |
594 """ |
583 """ |
595 txt = self.chatEdit.toPlainText() |
584 txt = self.chatEdit.toPlainText() |