11import os
22import sys
3+ import ctypes
34import traceback
5+ import logging
46
57from serial .tools import list_ports
68from pyqtgraph .Qt import QtGui , QtCore
1315from gui .run_experiment_tab import Run_experiment_tab
1416from gui .setups_tab import Setups_tab
1517
18+ if os .name == 'nt' : # Needed on windows to get taskbar icon to display correctly.
19+ ctypes .windll .shell32 .SetCurrentProcessExplicitAppUserModelID (u'pyControl' )
20+
1621# --------------------------------------------------------------------------------
1722# GUI_main
1823# --------------------------------------------------------------------------------
@@ -179,7 +184,7 @@ def excepthook(self, ex_type, ex_value, ex_traceback):
179184 '''Called whenever an uncaught exception occurs.'''
180185 if hasattr (self .tab_widget .currentWidget (), 'excepthook' ):
181186 self .tab_widget .currentWidget ().excepthook (ex_type , ex_value , ex_traceback )
182- traceback .print_exception (ex_type , ex_value , ex_traceback )
187+ logging . error ( '' . join ( traceback .format_exception (ex_type , ex_value , ex_traceback )) )
183188
184189# --------------------------------------------------------------------------------
185190# Launch GUI.
@@ -189,6 +194,7 @@ def launch_GUI():
189194 '''Launch the pyControl GUI.'''
190195 app = QtGui .QApplication (sys .argv )
191196 app .setStyle ('Fusion' )
197+ app .setWindowIcon (QtGui .QIcon ("gui/icons/logo.svg" ))
192198 font = QtGui .QFont ()
193199 font .setPixelSize (ui_font_size )
194200 app .setFont (font )
0 commit comments