diff options
author | SAMdroid <sam.parkinson3@gmail.com> | 2013-12-02 09:06:34 (GMT) |
---|---|---|
committer | SAMdroid <sam.parkinson3@gmail.com> | 2013-12-02 09:06:34 (GMT) |
commit | 57594be87bb3ad4d5cb0eefd9c2a74eb7ac46e10 (patch) | |
tree | 1c2d8d31ed90f627244f4444a554972949e7b234 | |
parent | 798006b4986ff6fef24d55aa68e09b4959702e3b (diff) |
Made the icon change to the devices icon and made output file names more readable
-rwxr-xr-x[-rw-r--r--] | constants.py | 0 | ||||
-rwxr-xr-x | model.py | 6 | ||||
-rwxr-xr-x | record.py | 6 | ||||
-rwxr-xr-x | recorded.py | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | serialize.py | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | utils.py | 0 |
6 files changed, 16 insertions, 8 deletions
diff --git a/constants.py b/constants.py index 2e0f54c..2e0f54c 100644..100755 --- a/constants.py +++ b/constants.py @@ -27,6 +27,7 @@ import os import time import json import shutil +import datetime import gobject import gst @@ -88,7 +89,7 @@ class Model: logger.error('read_file: %s' % e) return - serialize.fillMediaHash(dom, self.mediaHashs) + serialize.fillMediaHash(dom, self.mediaHashs, self.activity) for i in dom.documentElement.getElementsByTagName('ui'): for ui_el in i.childNodes: self.activity.deserialize(json.loads(ui_el.data)) @@ -374,7 +375,8 @@ class Model: recd.time = nowtime recd.type = type - mediaThumbFilename = str(recd.recorderHash) + "_" + str(recd.time) + readable = constants.MEDIA_INFO[type]['istr'] + '_' + str(datetime.datetime.now()).replace(' ', '_') + mediaThumbFilename = readable + str(recd.recorderHash) + "_" + str(recd.time) mediaFilename = mediaThumbFilename mediaFilename = mediaFilename + "." + constants.MEDIA_INFO[type]['ext'] mediaFilepath = os.path.join( self.activity.Instance.get_path(), mediaFilename ) @@ -897,7 +897,8 @@ class RecordControl(): def _setup_output_palette(self, notFirst): if notFirst: self.toolbar.remove(self._output_button) - self._output_button = ToolButton('user-documents') + self._output_button = ToolButton() + self._output_button.set_icon_name('user-documents') self._output_button.set_tooltip(_('Select output device')) self._output_button.connect('clicked', self._output_selection_cb) self._output_button.show() @@ -947,8 +948,11 @@ class RecordControl(): def _output_selected_cb(self, button, mount): if mount: self.activity.Instance.savePath = mount.get_root().get_path() + self._output_button.set_icon_name(self._get_mount_icon_name(mount, + gtk.ICON_SIZE_LARGE_TOOLBAR)) else: self.activity.Instance.savePath = None + self._output_button.set_icon_name('activity-journal') def _timer_selection_cb(self, widget): if self._timer_palette: diff --git a/recorded.py b/recorded.py index 8ee8e3d..03523fd 100755 --- a/recorded.py +++ b/recorded.py @@ -24,6 +24,7 @@ import gtk import constants from instance import Instance import utils +import datetime import serialize class Recorded: @@ -161,7 +162,8 @@ class Recorded: if self.mediaFilename == None: #creating a new filepath, probably just got here from the mesh ext = constants.MEDIA_INFO[self.type]['ext'] - recdPath = os.path.join(self.activity.Instance.get_path(), "recdFile_"+self.mediaMd5+"."+ext) + readable = constants.MEDIA_INFO[type]['istr'] + '_' + str(datetime.datetime.now()).replace(' ', '_') + recdPath = os.path.join(self.activity.Instance.get_path(), readable+"_recdFile_"+self.mediaMd5+"."+ext) recdPath = utils.getUniqueFilepath(recdPath, 0) self.mediaFilename = os.path.basename(recdPath) mediaFilepath = os.path.join(self.activity.Instance.get_path(), self.mediaFilename) diff --git a/serialize.py b/serialize.py index 74e3a3c..32b5db7 100644..100755 --- a/serialize.py +++ b/serialize.py @@ -14,15 +14,15 @@ import utils logger = logging.getLogger('serialize') -def fillMediaHash(doc, mediaHashs): +def fillMediaHash(doc, mediaHashs, activity): for key, value in constants.MEDIA_INFO.items(): recdElements = doc.documentElement.getElementsByTagName(value['name']) for el in recdElements: - _loadMediaIntoHash( el, mediaHashs[key] ) + _loadMediaIntoHash( el, mediaHashs[key], activity ) -def _loadMediaIntoHash(el, hash): +def _loadMediaIntoHash(el, hash, activity): addToHash = True - recd = recorded.Recorded() + recd = recorded.Recorded(activity) recd = fillRecdFromNode(recd, el) if recd: if recd.datastoreId: |