← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 511: Made a change to ensure the audio/video clip menu items are in sync with the clip button state.

 

------------------------------------------------------------
revno: 511
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2011-08-23 22:22:41 +0100
message:
  Made a change to ensure the audio/video clip menu items are in sync with the clip button state.
modified:
  openshot/windows/MainGTK.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/windows/MainGTK.py'
--- openshot/windows/MainGTK.py	2011-08-20 20:26:15 +0000
+++ openshot/windows/MainGTK.py	2011-08-23 21:22:41 +0000
@@ -3562,6 +3562,25 @@
 		else:
 			self.mnuClipEditTitle.hide()
 		
+		# temporarily block the callbacks otherwise they trigger when 
+		# setting the toggle menu state
+		self.mnuMuteAudio.handler_block_by_func(self.on_mnuMuteAudio_toggled)
+		self.mnuHideVideo.handler_block_by_func(self.on_mnuHideVideo_toggled)
+			
+		if self.selected_clip.play_audio == True:
+			self.mnuMuteAudio.set_active(False)
+		else:
+			self.mnuMuteAudio.set_active(True)
+			
+		if self.selected_clip.play_video == True:
+			self.mnuHideVideo.set_active(False)
+		else:
+			self.mnuHideVideo.set_active(True)
+			
+		# unblock the callbacks
+		self.mnuMuteAudio.handler_unblock_by_func(self.on_mnuMuteAudio_toggled)
+		self.mnuHideVideo.handler_unblock_by_func(self.on_mnuHideVideo_toggled)
+		
 	def on_mnuHideVideo_toggled(self, event, *args):
 		self.selected_clip.play_video = not self.selected_clip.play_video
 		
@@ -3572,6 +3591,7 @@
 		self.project.Render()
 		
 	def on_mnuMuteAudio_toggled(self, event, *args):
+		print "on_mnuMuteAudio_toggled"
 		self.selected_clip.play_audio = not self.selected_clip.play_audio
 		
 		# mark project as modified