Commit d603e917 authored by sumpfralle's avatar sumpfralle

show a "warning" icon whenever a new warning or error was issued

the icon is hidden again after any kind of activity in the log window


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@994 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 0cc5946a
...@@ -4425,10 +4425,26 @@ Usually you will want to use the cutter radius here to cut around the outline.</ ...@@ -4425,10 +4425,26 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<object class="GtkEventBox" id="StatusBarEventBox"> <object class="GtkEventBox" id="StatusBarEventBox">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<object class="GtkStatusbar" id="StatusBar"> <object class="GtkHBox" id="hbox37">
<property name="visible">True</property> <property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Click to open the log window.</property> <child>
<property name="spacing">2</property> <object class="GtkImage" id="StatusBarWarning">
<property name="stock">gtk-dialog-warning</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="StatusBar">
<property name="visible">True</property>
<property name="spacing">2</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>
......
...@@ -2009,6 +2009,9 @@ class ProjectGui: ...@@ -2009,6 +2009,9 @@ class ProjectGui:
except TypeError: except TypeError:
new_message = re.sub("[^\w\s]", "", message) new_message = re.sub("[^\w\s]", "", message)
self.status_bar.push(0, new_message) self.status_bar.push(0, new_message)
# highlight the "warning" icon for warnings/errors
if record and record.levelno > 20:
self.gui.get_object("StatusBarWarning").show()
@gui_activity_guard @gui_activity_guard
def copy_log_to_clipboard(self, widget=None): def copy_log_to_clipboard(self, widget=None):
...@@ -2021,10 +2024,12 @@ class ProjectGui: ...@@ -2021,10 +2024,12 @@ class ProjectGui:
self.log_model.foreach(copy_row, content) self.log_model.foreach(copy_row, content)
clipboard = gtk.Clipboard() clipboard = gtk.Clipboard()
clipboard.set_text(os.linesep.join(content)) clipboard.set_text(os.linesep.join(content))
self.gui.get_object("StatusBarWarning").hide()
@gui_activity_guard @gui_activity_guard
def clear_log_window(self, widget=None): def clear_log_window(self, widget=None):
self.log_model.clear() self.log_model.clear()
self.gui.get_object("StatusBarWarning").hide()
@gui_activity_guard @gui_activity_guard
def toggle_log_window(self, widget=None, value=None, action=None): def toggle_log_window(self, widget=None, value=None, action=None):
...@@ -2048,6 +2053,7 @@ class ProjectGui: ...@@ -2048,6 +2053,7 @@ class ProjectGui:
self._log_window_position = self.log_window.get_position() self._log_window_position = self.log_window.get_position()
self.log_window.hide() self.log_window.hide()
toggle_log_checkbox.set_active(new_state) toggle_log_checkbox.set_active(new_state)
self.gui.get_object("StatusBarWarning").hide()
# don't destroy the window with a "destroy" event # don't destroy the window with a "destroy" event
return True return True
......
Markdown is supported
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