From d97b3ab6e81263cc4e99b1f0c2acecd269364cd2 Mon Sep 17 00:00:00 2001
From: Marko Mecina <marko.mecina@univie.ac.at>
Date: Thu, 1 Sep 2022 12:40:59 +0200
Subject: [PATCH] reduce message bar activity in TST

---
 Tst/tst/tst.py  | 15 ++++++---------
 Tst/tst/view.py |  6 ++----
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/Tst/tst/tst.py b/Tst/tst/tst.py
index d2ef80d..5b69289 100755
--- a/Tst/tst/tst.py
+++ b/Tst/tst/tst.py
@@ -947,14 +947,13 @@ class TstAppWindow(Gtk.ApplicationWindow):
             for pth in file_list:
                 pth = os.path.abspath(pth)
                 try:
-                    self.logger.info('Opening in the CCS-Editor the file: {}'.format(pth))
+                    self.logger.info('Opening file {} in the CCS-Editor'.format(pth))
                     editor.Functions('open_file', pth)
                 except dbus.exceptions.DBusException as e:
                     message = 'Could not find the file: {}'.format(pth)
-                    self.logger.error('Could not find the file: {}'.format(pth))
+                    self.logger.error(message)
                     self.logger.exception(e)
-                    self.add_info_bar(message_type=Gtk.MessageType.ERROR,
-                                      message=message)
+                    self.add_info_bar(message_type=Gtk.MessageType.ERROR, message=message)
 
     def on_generate_products_message_dialog(self, paths):
         """
@@ -1027,20 +1026,18 @@ class TstAppWindow(Gtk.ApplicationWindow):
             self.logger.error(message)
             self.logger.exception(e)
             # add a info bar message that the starting of the CCS-Editor failed.
-            self.add_info_bar(message_type=Gtk.MessageType.ERROR,
-                              message=message)
+            self.add_info_bar(message_type=Gtk.MessageType.ERROR, message=message)
 
     def on_start_ccs_editor(self, *args):
         try:
             self.logger.info('Starting CCS-Editor application.')
             cfl.start_editor()
         except Exception as e:
-            message = 'Could not start CCS-Editor. Further information probably can be found in the tst.log file.'
+            message = 'Could not start CCS-Editor.'
             self.logger.error(message)
             self.logger.exception(e)
             # add a info bar message that the starting of the CCS-Editor failed.
-            self.add_info_bar(message_type=Gtk.MessageType.ERROR,
-                              message=message)
+            self.add_info_bar(message_type=Gtk.MessageType.ERROR, message=message)
 
     def on_apply_css(self, *args):
         style_provider = Gtk.CssProvider()
diff --git a/Tst/tst/view.py b/Tst/tst/view.py
index 333ecef..8973e3f 100644
--- a/Tst/tst/view.py
+++ b/Tst/tst/view.py
@@ -287,7 +287,7 @@ class Board(Gtk.Box):
             if not found:
                 msg = 'Given Pre-Condition Name could not be found/loaded'
                 self.logger.warning(msg)
-                self.app.add_info_bar(message_type=Gtk.MessageType.INFO, message=msg)
+                # self.app.add_info_bar(message_type=Gtk.MessageType.INFO, message=msg)
                 self.on_precon_changed(self.precon_selection)
 
         # set the post-condition name
@@ -300,7 +300,7 @@ class Board(Gtk.Box):
             if not found:
                 msg = 'Given Post-Condition Name could not be found/loaded'
                 self.logger.warning(msg)
-                self.app.add_info_bar(message_type=Gtk.MessageType.INFO, message=msg)
+                # self.app.add_info_bar(message_type=Gtk.MessageType.INFO, message=msg)
                 self.on_postcon_changed(self.precon_selection)
 
         # Set the test comment
@@ -309,8 +309,6 @@ class Board(Gtk.Box):
         # Set the Locked STep numeration
         self.text_meta_data_test_is_locked.set_active(self.model.primary_counter_locked)
 
-
-
     def collapse_all_steps(self, button):
         """ Close all expander of the steps """
         steps = self.grid.get_children()
-- 
GitLab