← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 682: Applied a patch from battmanux to change the play icon to a paused icon while the video is playin...

 

------------------------------------------------------------
revno: 682
fixes bug: https://launchpad.net/bugs/440802
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Thu 2012-08-23 22:54:29 +0100
message:
  Applied a patch from battmanux to change the play icon to a paused icon while the video is playing. This always used to create problems updating the SDL window, but it seems to be ok now.
modified:
  openshot/classes/video.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/classes/video.py'
--- openshot/classes/video.py	2012-05-09 19:56:51 +0000
+++ openshot/classes/video.py	2012-08-23 21:54:29 +0000
@@ -20,10 +20,14 @@
 import threading
 import gobject
 from classes import profiles
+from gtk import STOCK_MEDIA_PAUSE
+from gtk import STOCK_MEDIA_PLAY
+import gtk
 
 # init the foreign language
 from language import Language_Init
 
+
 try:
 	import mlt
 except ImportError:
@@ -330,6 +334,21 @@
 		
 
 	def pause(self):
+		if self.main_form.settings.general["use_stock_icons"] == "No" or None != self.main_form.tlbPlay.get_icon_widget():
+			theme_img = gtk.Image()
+			theme_img.set_from_file(os.path.join(self.project.THEMES_DIR, self.project.theme, "icons", "play.png"))
+			theme_img.show()
+			
+			# set new icon image
+			self.main_form.tlbPlay.set_icon_widget(theme_img)
+			
+		else:
+			# set stock id
+			
+			self.main_form.tlbPlay.set_icon_widget(None)
+			self.main_form.tlbPlay.set_tooltip_text(self.main_form._('Play'))
+			self.main_form.tlbPlay.set_stock_id(STOCK_MEDIA_PLAY)
+				
 		# pause the video
 		self.isPlaying = False
 		
@@ -342,6 +361,21 @@
 		
 			
 	def play(self):
+		if self.main_form.settings.general["use_stock_icons"] == "No" or None != self.main_form.tlbPlay.get_icon_widget():
+			theme_img = gtk.Image()
+			theme_img.set_from_file(os.path.join(self.project.THEMES_DIR, self.project.theme, "icons", "pause.png"))
+			theme_img.show()
+			
+			# set new icon image
+			self.main_form.tlbPlay.set_icon_widget(theme_img)
+			
+		else:
+			# set stock id
+			
+			self.main_form.tlbPlay.set_icon_widget(None)
+			self.main_form.tlbPlay.set_stock_id(STOCK_MEDIA_PAUSE)
+			self.main_form.tlbPlay.set_tooltip_text(self.main_form._('Pause'))		
+		
 		# play the video
 		self.isPlaying = True
 		self.p.set_speed(1)
@@ -449,4 +483,4 @@
 		
 		
 		
-	
\ No newline at end of file
+