コード例 #1
0
ファイル: uiactions.py プロジェクト: robla/zim-desktop-wiki
	def show_search(self, query=None):
		'''Menu action to show the L{SearchDialog}
		@param query: the search query to show
		'''
		from zim.gui.searchdialog import SearchDialog
		if query is None and hasattr(self.widget, 'pageview'):
			query = self.widget.pageview.get_selection() # XXX unauthorized access to pageview

		dialog = SearchDialog(self.widget, self.notebook, self.page, self.navigation)
		dialog.present()

		if query is not None:
			dialog.search(query)
コード例 #2
0
	def show_search(self, query=None, focus_results=False):
		'''Menu action to show the L{SearchDialog}
		@param query: the search query to show
		'''
		from zim.gui.searchdialog import SearchDialog
		if query is None and hasattr(self.widget, 'pageview'):
			query = self.widget.pageview.get_selection() # XXX unauthorized access to pageview

		dialog = SearchDialog(self.widget, self.notebook, self.page, self.navigation)
		dialog.present()

		if query is not None:
			dialog.search(query)

		if focus_results:
			dialog.results_treeview.grab_focus()
		else:
			dialog.query_entry.grab_focus()
			dialog.query_entry.set_position(-1)