MessageBreakPlugin.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:urh 作者: jopohl 项目源码 文件源码
def get_action(self, parent, undo_stack: QUndoStack, sel_range, protocol: ProtocolAnalyzer, view: int):
        """
        :type parent: QTableView
        :type undo_stack: QUndoStack
        :type protocol_analyzers: list of ProtocolAnalyzer
        """
        min_row, max_row, start, end = sel_range
        if min_row == -1 or max_row == -1 or start == -1 or end == -1:
            return None

        if max_row != min_row:
            QMessageBox.critical(parent, self.tr("Error in MessageBreak"),
                                 self.tr("You can only break one line per action."))
            return None

        end = protocol.convert_index(end, view, 0, True, message_indx=min_row)[0]
        # factor = 1 if view == 0 else 4 if view == 1 else 8

        self.command = MessageBreakAction(protocol, max_row, end)
        action = QAction(self.command.text(), parent)
        action.triggered.connect(self.action_triggered)
        self.undo_stack = undo_stack
        return action
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号