@@ -52,7 +52,7 @@ class EditorMain(QMainWindow, QtStyleTools):
5252 繼承 QMainWindow 與 QtStyleTools
5353 """
5454
55- def __init__ (self , debug_mode : bool = False , show_system_tray_ray : bool = False ):
55+ def __init__ (self , debug_mode : bool = False , show_system_tray_ray : bool = False , extend : bool = False ):
5656 # 初始化時記錄 log
5757 # Log initialization
5858 jeditor_logger .info (f"Init EditorMain "
@@ -95,10 +95,11 @@ def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = False)
9595
9696 # Windows 系統專用:設定應用程式 ID
9797 # Windows only: set application ID
98- self .id = language_wrapper .language_word_dict .get ("application_name" )
99- if sys .platform in ["win32" , "cygwin" , "msys" ]:
100- from ctypes import windll
101- windll .shell32 .SetCurrentProcessExplicitAppUserModelID (self .id )
98+ if not extend :
99+ self .id = language_wrapper .language_word_dict .get ("application_name" )
100+ if sys .platform in ["win32" , "cygwin" , "msys" ]:
101+ from ctypes import windll
102+ windll .shell32 .SetCurrentProcessExplicitAppUserModelID (self .id )
102103
103104 # 設定 Python 輸出不緩衝
104105 # Set Python output unbuffered
@@ -144,18 +145,19 @@ def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = False)
144145
145146 # 設定應用程式圖示
146147 # Set application icon
147- self .icon_path = Path (os .getcwd () + "/je_driver_icon.ico" )
148- self .icon = QIcon (str (self .icon_path ))
149- if self .icon .isNull () is False :
150- self .setWindowIcon (self .icon )
151- # 如果系統支援系統匣,則顯示圖示
152- # Show system tray icon if available
153- if ExtendSystemTray .isSystemTrayAvailable () and self .show_system_tray_ray :
154- self .system_tray = ExtendSystemTray (main_window = self )
155- self .system_tray .setIcon (self .icon )
156- self .system_tray .setVisible (True )
157- self .system_tray .show ()
158- self .system_tray .setToolTip (language_wrapper .language_word_dict .get ("application_name" ))
148+ if not extend :
149+ self .icon_path = Path (os .getcwd () + "/python_editor.ico" )
150+ self .icon = QIcon (str (self .icon_path ))
151+ if not self .icon .isNull ():
152+ self .setWindowIcon (self .icon )
153+ # 如果系統支援系統匣,則顯示圖示
154+ # Show system tray icon if available
155+ if ExtendSystemTray .isSystemTrayAvailable () and self .show_system_tray_ray :
156+ self .system_tray = ExtendSystemTray (main_window = self )
157+ self .system_tray .setIcon (self .icon )
158+ self .system_tray .setVisible (True )
159+ self .system_tray .show ()
160+ self .system_tray .setToolTip (language_wrapper .language_word_dict .get ("application_name" ))
159161
160162 # 設定輸出重導 (stdout/stderr)
161163 # Setup output redirection (stdout/stderr)
0 commit comments