Disable 'Transfer' button when build failed
authorlaurent
Thu, 02 Feb 2012 00:28:27 +0100
changeset 676 04cd443cd18d
parent 675 44b35c27e9ff
child 677 607731b33026
Disable 'Transfer' button when build failed
plugger.py
--- a/plugger.py	Tue Jan 31 23:28:03 2012 +0100
+++ b/plugger.py	Thu Feb 02 00:28:27 2012 +0100
@@ -1467,6 +1467,7 @@
         # If IEC code gen fail, bail out.
         if not IECGenRes:
             self.logger.write_error(_("IEC-61131-3 code generation failed !\n"))
+            self.EnableMethod("_Transfer", False)
             return False
 
         # Reset variable and program list that are parsed from
@@ -1482,6 +1483,7 @@
         except Exception, exc:
             self.logger.write_error(_("Plugins code generation failed !\n"))
             self.logger.write_error(traceback.format_exc())
+            self.EnableMethod("_Transfer", False)
             return False
 
         # Get temporary directory path
@@ -1517,6 +1519,7 @@
             except Exception, exc:
                 self.logger.write_error(name+_(" generation failed !\n"))
                 self.logger.write_error(traceback.format_exc())
+                self.EnableMethod("_Transfer", False)
                 return False
 
         self.logger.write(_("C code generated successfully.\n"))
@@ -1525,6 +1528,7 @@
         builder = self.GetBuilder()
         if builder is None:
             self.logger.write_error(_("Fatal : cannot get builder.\n"))
+            self.EnableMethod("_Transfer", False)
             return False
 
         # Build
@@ -1535,6 +1539,7 @@
         except Exception, exc:
             self.logger.write_error(_("C Build crashed !\n"))
             self.logger.write_error(traceback.format_exc())
+            self.EnableMethod("_Transfer", False)
             return False
 
         self.logger.write(_("Successfully built.\n"))