Commit 3ff0883e authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

RunSolver: Fix #15 and minor change.

Showing with 14 additions and 2 deletions
+14 -2
......@@ -182,21 +182,30 @@ class SolverLogWindow(PamhyrWindow):
self._alarm.timeout.connect(self.update)
def _log(self, msg, color=None):
if msg is str:
if type(msg) is str:
logger.info(f"solver: {msg}")
msg = msg.rsplit('\n')[0]
if color is not None:
msg = f"<font color=\"{color}\">" + msg + "</font>"
self.find(QTextEdit, "textEdit").append(msg)
elif type(msg) is int:
logger.info(f"solver: Returns {msg}")
elif msg is int:
color = "blue" if msg == 0 else "red"
self.find(QTextEdit, "textEdit")\
.append(f"<font color=\"{color}\">" +
f" *** Finished with code {msg}" +
"</font>")
self.statusbar.showMessage(
"Done" if msg == 0 else "Failed",
3000
)
def update(self):
if self._solver.is_stoped():
self.find(QAction, "action_start").setEnabled(True)
......
......@@ -22,6 +22,9 @@
<family>Monospace</family>
</font>
</property>
<property name="locale">
<locale language="English" country="Europe"/>
</property>
<property name="documentTitle">
<string notr="true"/>
</property>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment