← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 660: Make the Length field in the project files tree show a rounded value. For example, 14.887 will no...

 

------------------------------------------------------------
revno: 660
fixes bug: https://launchpad.net/bugs/992860
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2012-05-01 22:07:11 +0100
message:
  Make the Length field in the project files tree show a rounded value. For example, 14.887 will now show as 15, rather than 14.
  
  Also modified the File Properties dialog to show the full length of the clip including milliseconds. So now a rounded value is shown in the tree, with the full value in the File Properties. Also capitalised the file type displayed in the File properties dialog.
modified:
  openshot/windows/FileProperties.py
  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/FileProperties.py'
--- openshot/windows/FileProperties.py	2011-09-02 06:41:59 +0000
+++ openshot/windows/FileProperties.py	2012-05-01 21:07:11 +0000
@@ -43,7 +43,7 @@
 		self.imgPreview.set_from_pixbuf(pixbuf)
 		
 		#set the file type	
-		self.lblMimeType.set_label(file.file_type)
+		self.lblMimeType.set_label(str(file.file_type).title())
 		
 		#if the file name is too long to fit the space, add ellipses and a tooltip.
 		self.lblLocation1.set_text(file.name)
@@ -57,8 +57,8 @@
 		mins = time[3]
 		secs = time[4]
 		milli = time[5]
-	
-		time_str =  "%02d:%02d:%02d" % (time[2], time[3], time[4])
+		
+		time_str =  "%02d:%02d:%02d:%02d" % (hours, mins, secs, milli)
 		self.lblLengthValue.set_label(time_str)
 		#project label
 		self.txtLabel.set_text(file.label)

=== modified file 'openshot/windows/MainGTK.py'
--- openshot/windows/MainGTK.py	2012-04-29 21:26:55 +0000
+++ openshot/windows/MainGTK.py	2012-05-01 21:07:11 +0000
@@ -1027,8 +1027,11 @@
 					mins = time[3]
 					secs = time[4]
 					milli = time[5]
-		
-					time_str =  "%02d:%02d:%02d" % (time[2], time[3], time[4])
+					
+					if milli > 500:
+						secs += 1
+					time_str =  "%02d:%02d:%02d" % (hours, mins, secs)
+					
 		
 					# get the thumbnail (or load default)
 					pbThumb = item.get_thumbnail(51, 38)