コード例 #1
0
    def prepend_actions(self, menu):
        """Prepends find specific actions to menu"""

        toggle_case = Action(self,
                             "Match &case",
                             self.on_toggle_case,
                             checkable=True,
                             statustip='Match case in search')

        toggle_results = Action(self,
                                "Code and results",
                                self.on_toggle_results,
                                checkable=True,
                                statustip='Search also considers string '
                                'representations of result objects.')

        toggle_up = Action(self,
                           "Search &backward",
                           self.on_toggle_up,
                           checkable=True,
                           statustip='Search fore-/backwards')

        toggle_word = Action(self,
                             "&Whole words",
                             self.on_toggle_word,
                             checkable=True,
                             statustip='Whole word search')

        toggle_regexp = Action(self,
                               "Regular expression",
                               self.on_toggle_regexp,
                               checkable=True,
                               statustip='Regular expression search')

        toggle_case.setChecked(self.case)
        toggle_results.setChecked(self.results)
        toggle_up.setChecked(self.up)
        toggle_word.setChecked(self.word)
        toggle_regexp.setChecked(self.regexp)

        actions = (toggle_case, toggle_results, toggle_up, toggle_word,
                   toggle_regexp)
        menu.insertActions(menu.actions()[0], actions)