399 @param message command message (string) |
399 @param message command message (string) |
400 """ |
400 """ |
401 self.editorCommand.emit(hashStr, fileName, message) |
401 self.editorCommand.emit(hashStr, fileName, message) |
402 |
402 |
403 from QScintilla.Editor import Editor |
403 from QScintilla.Editor import Editor |
404 if message.startswith(Editor.StartEditToken + Editor.Separator) or \ |
404 if (message.startswith(Editor.StartEditToken + Editor.Separator) or |
405 message.startswith(Editor.EndEditToken + Editor.Separator): |
405 message.startswith(Editor.EndEditToken + Editor.Separator)): |
406 vm = e5App().getObject("ViewManager") |
406 vm = e5App().getObject("ViewManager") |
407 aw = vm.activeWindow() |
407 aw = vm.activeWindow() |
408 if aw: |
408 if aw: |
409 self.checkEditorActions(aw) |
409 self.checkEditorActions(aw) |
410 |
410 |
492 def __initChatMenu(self): |
492 def __initChatMenu(self): |
493 """ |
493 """ |
494 Private slot to initialize the chat edit context menu. |
494 Private slot to initialize the chat edit context menu. |
495 """ |
495 """ |
496 self.__chatMenu = QMenu(self) |
496 self.__chatMenu = QMenu(self) |
497 self.__copyChatAct = \ |
497 self.__copyChatAct = self.__chatMenu.addAction( |
498 self.__chatMenu.addAction( |
498 UI.PixmapCache.getIcon("editCopy.png"), |
499 UI.PixmapCache.getIcon("editCopy.png"), |
499 self.tr("Copy"), self.__copyChat) |
500 self.tr("Copy"), self.__copyChat) |
|
501 self.__chatMenu.addSeparator() |
500 self.__chatMenu.addSeparator() |
502 self.__cutAllChatAct = \ |
501 self.__cutAllChatAct = self.__chatMenu.addAction( |
503 self.__chatMenu.addAction( |
502 UI.PixmapCache.getIcon("editCut.png"), |
504 UI.PixmapCache.getIcon("editCut.png"), |
503 self.tr("Cut all"), self.__cutAllChat) |
505 self.tr("Cut all"), self.__cutAllChat) |
504 self.__copyAllChatAct = self.__chatMenu.addAction( |
506 self.__copyAllChatAct = \ |
505 UI.PixmapCache.getIcon("editCopy.png"), |
507 self.__chatMenu.addAction( |
506 self.tr("Copy all"), self.__copyAllChat) |
508 UI.PixmapCache.getIcon("editCopy.png"), |
|
509 self.tr("Copy all"), self.__copyAllChat) |
|
510 self.__chatMenu.addSeparator() |
507 self.__chatMenu.addSeparator() |
511 self.__clearChatAct = \ |
508 self.__clearChatAct = self.__chatMenu.addAction( |
512 self.__chatMenu.addAction( |
509 UI.PixmapCache.getIcon("editDelete.png"), |
513 UI.PixmapCache.getIcon("editDelete.png"), |
510 self.tr("Clear"), self.__clearChat) |
514 self.tr("Clear"), self.__clearChat) |
|
515 self.__chatMenu.addSeparator() |
511 self.__chatMenu.addSeparator() |
516 self.__saveChatAct = \ |
512 self.__saveChatAct = self.__chatMenu.addAction( |
517 self.__chatMenu.addAction( |
513 UI.PixmapCache.getIcon("fileSave.png"), |
518 UI.PixmapCache.getIcon("fileSave.png"), |
514 self.tr("Save"), self.__saveChat) |
519 self.tr("Save"), self.__saveChat) |
|
520 |
515 |
521 self.on_chatEdit_copyAvailable(False) |
516 self.on_chatEdit_copyAvailable(False) |
522 |
517 |
523 @pyqtSlot(bool) |
518 @pyqtSlot(bool) |
524 def on_chatEdit_copyAvailable(self, yes): |
519 def on_chatEdit_copyAvailable(self, yes): |
619 def __initUsersMenu(self): |
614 def __initUsersMenu(self): |
620 """ |
615 """ |
621 Private slot to initialize the users list context menu. |
616 Private slot to initialize the users list context menu. |
622 """ |
617 """ |
623 self.__usersMenu = QMenu(self) |
618 self.__usersMenu = QMenu(self) |
624 self.__kickUserAct = \ |
619 self.__kickUserAct = self.__usersMenu.addAction( |
625 self.__usersMenu.addAction( |
620 UI.PixmapCache.getIcon("chatKickUser.png"), |
626 UI.PixmapCache.getIcon("chatKickUser.png"), |
621 self.tr("Kick User"), self.__kickUser) |
627 self.tr("Kick User"), self.__kickUser) |
622 self.__banUserAct = self.__usersMenu.addAction( |
628 self.__banUserAct = \ |
623 UI.PixmapCache.getIcon("chatBanUser.png"), |
629 self.__usersMenu.addAction( |
624 self.tr("Ban User"), self.__banUser) |
630 UI.PixmapCache.getIcon("chatBanUser.png"), |
625 self.__banKickUserAct = self.__usersMenu.addAction( |
631 self.tr("Ban User"), self.__banUser) |
626 UI.PixmapCache.getIcon("chatBanKickUser.png"), |
632 self.__banKickUserAct = \ |
627 self.tr("Ban and Kick User"), self.__banKickUser) |
633 self.__usersMenu.addAction( |
|
634 UI.PixmapCache.getIcon("chatBanKickUser.png"), |
|
635 self.tr("Ban and Kick User"), self.__banKickUser) |
|
636 |
628 |
637 @pyqtSlot(QPoint) |
629 @pyqtSlot(QPoint) |
638 def on_usersList_customContextMenuRequested(self, pos): |
630 def on_usersList_customContextMenuRequested(self, pos): |
639 """ |
631 """ |
640 Private slot to show the context menu for the users list. |
632 Private slot to show the context menu for the users list. |