From 2301a2078704ef01f55f731554af2a13d4a733c2 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Thu, 23 Mar 2006 06:10:45 +0000 Subject: [PATCH] Filter double drag and drops in Windows. svn: r6197 --- ChangeLog | 3 +++ src/ScratchPad.py | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cce938cc7..52f5bb514 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-03-22 Brian Matherly + * src/ScratchPad.py: Filter double drops in Windows. + 2006-03-22 Don Allingham * src/ScratchPad.py: handle repositories * diff --git a/src/ScratchPad.py b/src/ScratchPad.py index 41915734d..acd1f09b0 100644 --- a/src/ScratchPad.py +++ b/src/ScratchPad.py @@ -31,6 +31,7 @@ from xml.sax.saxutils import escape from TransUtils import sgettext as _ import Utils import RelLib +from time import strftime as strftime #------------------------------------------------------------------------- # @@ -819,10 +820,14 @@ class ScratchPadListView: model = widget.get_model() sel_data = selection.data + # In Windows time is always zero. Until that is fixed, use the seconds + # of the local time to filter out double drops. + realTime = strftime("%S") + # There is a strange bug that means that if there is a selection # in the list we get multiple drops of the same object. Luckily # the time values are the same so we can drop all but the first. - if time == self._previous_drop_time: + if realTime == self._previous_drop_time: return # Find a wrapper class @@ -865,7 +870,7 @@ class ScratchPadListView: # remember time for double drop workaround. - self._previous_drop_time = time + self._previous_drop_time = realTime # proxy methods to provide access to the real widget functions.