def adv_search(self, changed): # parent is an instance of NodeBrowser adv = AdvSearch(self) self.parent.parent.addSearchTab(adv) adv.setCurrentNode(self.parent.model.rootItem) adv.path.setText(adv.search_in_node.absolute()) return ret = self.adv.show() return ret = self.adv.exec_() if ret == QDialog.Accepted: all_word = str(self.adv.allWords.text()) none_word = str(self.adv.noneWord.text()) one_word = str(self.adv.oneWord.text()) if all_word == "t": all_word = "" if none_word == "t": none_word = "" if one_word == "t": one_word = "" if all_word == "" and none_word == "" and one_word == "": return query = "" query += one_word none_word = none_word.lstrip() l = none_word.split() if len(l): for i in l: query += " -" + i elif none_word != "": query += " -" + none_word all_word = all_word.lstrip() l = all_word.split() if len(l): for i in l: query += " AND " + i elif all_word != "": if self.adv.allWordTitle.isChecked(): query += all_word if self.adv.allWordContent.isChecked(): query += all_word # prepare stuff to fo the query conf = Conf() index_path = conf.index_path # get path to the index search_engine = IndexSearch(index_path) search_engine.exec_query(query, "")
def searchActivated(self): adv = AdvSearch(self) self.parent.parent.addSearchTab(adv) adv.setCurrentNode(self.parent.model.rootItem) adv.path.setText(adv.search_in_node.absolute())