diff options
author | Daniel Drake <dsd@laptop.org> | 2011-02-02 16:27:46 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2011-02-02 16:37:48 (GMT) |
commit | 3bc80c776f7ef2578a4b9fd26028574a12982ea3 (patch) | |
tree | 890aa0ee4a2b07d9c9704883d11f0385e03a2e70 /recorded.py | |
parent | ca2bbd6d74342247de97cffa150b577246c63107 (diff) |
UI rework
This is a rework of the UI that uses a more standard GTK+ principles
than previously. There is still a small amount of black magic, kept
away inside mediaview.py.
The UI/model separation was also refined in places, and a lot of code
was simplified.
Overall the functionality remains identical, and I tried to keep the UI
the same as before (but it is not pixel perfect).
As this was quite big there may be some bugs to shake out.
Diffstat (limited to 'recorded.py')
-rw-r--r-- | recorded.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/recorded.py b/recorded.py index 8639a70..27250d3 100644 --- a/recorded.py +++ b/recorded.py @@ -20,16 +20,13 @@ import os import gtk -from gtk import gdk -from constants import Constants +import constants from instance import Instance import utils import serialize -import record class Recorded: - def __init__( self ): self.type = -1 self.time = None @@ -78,6 +75,8 @@ class Recorded: def setTitle( self, newTitle ): + if self.title == newTitle: + return self.title = newTitle self.metaChange = True @@ -106,11 +105,11 @@ class Recorded: #relaunch, their old media -- datastoreObject->file (hold onto the datastore object, delete if deleted) | ([request->]) Journal/session/buddy def getThumbPixbuf( self ): - thumbPixbuf = None thumbFilepath = self.getThumbFilepath() - if ( os.path.isfile(thumbFilepath) ): - thumbPixbuf = gtk.gdk.pixbuf_new_from_file(thumbFilepath) - return thumbPixbuf + if os.path.isfile(thumbFilepath): + return gtk.gdk.pixbuf_new_from_file(thumbFilepath) + else: + return None def getThumbFilepath( self ): @@ -152,7 +151,7 @@ class Recorded: else: if self.mediaFilename == None: #creating a new filepath, probably just got here from the mesh - ext = Constants.mediaTypes[self.type][Constants.keyExt] + ext = constants.MEDIA_INFO[self.type]['ext'] recdPath = os.path.join(Instance.instancePath, "recdFile_"+self.mediaMd5+"."+ext) recdPath = utils.getUniqueFilepath(recdPath, 0) self.mediaFilename = os.path.basename(recdPath) @@ -170,4 +169,4 @@ class Recorded: print("RecordActivity error -- unable to get datastore object in getMediaFilepath") return None - return self.datastoreOb.file_path
\ No newline at end of file + return self.datastoreOb.file_path |