Esempio n. 1
0
	def _get_name(self):
		superName = super(TorrentContentsListItem, self).name
		if superName:
			return superName

		# We need to use the display model to retrieve the Name column.
		try:
			# We don't want to just use displayText because it also contains the size, which is exposed correctly in the value property.
			# Therefore, use the left and right of the Name column as obtained from the column header.
			nameHdrLoc = Window._get_firstChild(self).firstChild.firstChild.location
			left = nameHdrLoc[0]
			right = left + nameHdrLoc[2]
			# Use the top and bottom of the list item.
			selfLoc = self.location
			top = selfLoc[1]
			bottom = top + selfLoc[3]
			return displayModel.getWindowTextInRect(self.appModule.helperLocalBindingHandle, self.windowHandle,
				left, top, right, bottom,
				displayModel.DisplayModelTextInfo.minHorizontalWhitespace, displayModel.DisplayModelTextInfo.minVerticalWhitespace)[0]
		except:
			log.debugWarning("Error retrieving name using display model", exc_info=True)
			return superName