From b06ee336adfe53b77572c045fe3ebe730e843e96 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 1 Aug 2013 09:58:30 +0100 Subject: [PATCH] Time is reset only when a sound is played #355 --- src/bitmessageqt/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 033ce61f..86d48f0f 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1006,7 +1006,6 @@ class MyForm(QtGui.QMainWindow): category is not self.SOUND_DISCONNECTED and category is not self.SOUND_CONNECTION_GREEN): dt = datetime.datetime.now() - self.lastSoundTime - self.lastSoundTime = datetime.datetime.now() if dt.total_seconds() < self.maxSoundFrequencySec: play = False @@ -1023,6 +1022,9 @@ class MyForm(QtGui.QMainWindow): soundFilename = shared.appdata + 'sounds/green' if soundFilename is not None and play is True: + # record the last time that a sound was played + self.lastSoundTime = datetime.datetime.now() + # if not wav then try mp3 format if not os.path.isfile(soundFilename + '.wav'): soundFilename = soundFilename + '.mp3'