summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Briano <sachieru@gmail.com>2010-12-03 17:09:08 +0000
committerIván Briano <sachieru@gmail.com>2010-12-03 17:09:08 +0000
commit1c4739ae1dc84c4064d726eecb44df7efaa31c45 (patch)
tree22fd0ce167370a80dda533d6af417d583d29ab6e
parent4d99e7dfdfc3236583e2ef67a870464e772958be (diff)
Compile script when saving, show message if it fails
By: Helen Fornazier <helen.fornazier@profusion.mobi> SVN revision: 55204
-rw-r--r--editje/editje.py20
-rw-r--r--editje/log_window.py2
2 files changed, 20 insertions, 2 deletions
diff --git a/editje/editje.py b/editje/editje.py
index 23d313d..74c4e0c 100644
--- a/editje/editje.py
+++ b/editje/editje.py
@@ -52,6 +52,8 @@ from rpc_handlers import QueriesHandler, ReportsHandler
52 52
53from misc import name_generate, accepted_filetype 53from misc import name_generate, accepted_filetype
54 54
55from log_window import LogWindow
56
55 57
56def debug_cb(obj, emission, source): 58def debug_cb(obj, emission, source):
57 print "%s: %s %s" % (obj, emission, source) 59 print "%s: %s %s" % (obj, emission, source)
@@ -217,6 +219,22 @@ class Editje(elementary.Window, OpenFileManager):
217 # Save 219 # Save
218 def save(self): 220 def save(self):
219 221
222 # Just call the compile, if it's not required it will return True
223 if not self.e.edje.script_compile():
224 # Oops, build failed and we don't yet have errors, so just
225 # say the build failed.
226 log_win = LogWindow(self)
227 message = "There was an error rebuilding the Embryo script.<br>" \
228 "This could be caused by referenced parts or programs" \
229 "that have been removed or renamed.<br>" \
230 "The object will be saved and the generated source will" \
231 "contain the script. For the time being, it requires" \
232 "the user to manually edit it. Use edje_decc to extract" \
233 "the edc source from a binary file, fix it by hand and" \
234 "build again with edje_cc.<br>"
235 log_win.message_set(message, title = "Script Error",
236 subtitle = "Could Not Compile, Got Fix Your Code")
237 log_win.open()
220 if not self.e.filename: 238 if not self.e.filename:
221 return self.save_as() 239 return self.save_as()
222 240
@@ -327,6 +345,8 @@ class Editje(elementary.Window, OpenFileManager):
327 def block(self, value=True, object_over=None): 345 def block(self, value=True, object_over=None):
328 346
329 def create_window_blocker(): 347 def create_window_blocker():
348 if self._window_blocker:
349 return
330 self._window_blocker = elementary.Layout(self) 350 self._window_blocker = elementary.Layout(self)
331 self._window_blocker.file_set(self.theme, "blocker") 351 self._window_blocker.file_set(self.theme, "blocker")
332 self._window_blocker.size_hint_weight_set( 352 self._window_blocker.size_hint_weight_set(
diff --git a/editje/log_window.py b/editje/log_window.py
index 0a4e299..fc91eca 100644
--- a/editje/log_window.py
+++ b/editje/log_window.py
@@ -79,8 +79,6 @@ class LogWindow(InnerWindow):
79 self.__sc.show() 79 self.__sc.show()
80 content.pack_end(self.__sc) 80 content.pack_end(self.__sc)
81 81
82 #self._action_add("Close", self.close, key="Escape")
83
84 def _subtitle_text_set(self, value): 82 def _subtitle_text_set(self, value):
85 if not value: 83 if not value:
86 self.__edje.signal_emit("wizard,subtitle,hide", "") 84 self.__edje.signal_emit("wizard,subtitle,hide", "")