def __init__(self, parent=None):
   super(SearchMenu, self).__init__(parent)
   
   self.ui = Ui_SearchMenu()
   self.ui.setupUi(self)
   #self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
   
   # Feels herpy.
   #self.ui.buttonBox.accepted.connect(self.open_clicked.emit)
   
   self.ui.shortcutFind = QShortcut(QKeySequence("Ctrl+F"), self)
   self.ui.shortcutFind.activated.connect(self.highlight_query)
   
   self.ui.btnFilterSelAll.clicked.connect(lambda: self.filterSetAll(True))
   self.ui.btnFilterSelNone.clicked.connect(lambda: self.filterSetAll(False))
   
   # Unchecked is easier to work with,
   # since it searches everything if nothing's given.
   self.filterSetAll(False)
   
   self.ui.treeResults.setHeaderLabel("Results (0)")
   
   self.ui.actionCopyPath = QtGui.QAction("Copy path", None, triggered = self.copyPath)
   self.ui.treeResults.addAction(self.ui.actionCopyPath)
   
   self.transHighlighter = KeywordHighlighter(self.ui.txtTranslated.document())
   self.origHighlighter = KeywordHighlighter(self.ui.txtOriginal.document())
   self.commHighlighter = KeywordHighlighter(self.ui.txtComments.document())
   
   self.re_flags = re.UNICODE | re.MULTILINE
    def __init__(self, parent):
        super(KeywordEdit, self).__init__(parent)
        self.setAcceptRichText(False)
        self.highlighter = KeywordHighlighter(self.document())
        self.setMouseTracking(True)

        self.last_edited = None