@@ -1421,51 +1421,57 @@ def setMouseEvents(label: QLabel, parameterType: str, height: int):
14211421
14221422 @staticmethod
14231423 def connectSettings (window : Main ):
1424+ _translate = translationVar .translateFrom
1425+
14241426 def isValidTFPath () -> bool :
14251427 if AppSettings .path in ("" , None ):
14261428 return False
1427- elif not os .path .isfile (AppSettings .path + "/ " + "TFMain64.dll" ):
1429+ elif not os .path .isfile (AppSettings .path + "\\ " + "TFMain64.dll" ):
14281430 return False
14291431 return True
14301432
14311433 def run ():
14321434 if not isValidTFPath ():
14331435 window .toolBox .setCurrentIndex (0 )
1434- window .location_error_text .setText ("!! Error: TFMain64.dll not found !!" )
1436+ window .location_error_text .setText (_translate ( "!! Error: TFMain64.dll not found !!" ) )
14351437 return
1436- os .system (AppSettings .path + "/" + "start.bat" )
1438+
1439+ os .system (rf'"{ AppSettings .path } \\start.bat"' )
14371440
14381441 def stop ():
14391442 if not isValidTFPath ():
14401443 window .toolBox .setCurrentIndex (0 )
1441- window .location_error_text .setText ("!! Error: TFMain64.dll not found !!" )
1444+ window .location_error_text .setText (_translate ( "!! Error: TFMain64.dll not found !!" ) )
14421445 return
1443- os .system (AppSettings .path + "/" + "stop.bat" )
1446+
1447+ os .system (rf'"{ AppSettings .path } \\stop.bat"' )
14441448
14451449 def install ():
14461450 if not isValidTFPath ():
14471451 window .toolBox .setCurrentIndex (0 )
1448- window .location_error_text .setText ("!! Error: TFMain64.dll not found !!" )
1452+ window .location_error_text .setText (_translate ( "!! Error: TFMain64.dll not found !!" ) )
14491453 return
1454+
14501455 windll .shell32 .ShellExecuteW (
14511456 None ,
14521457 "runas" ,
14531458 "cmd.exe" ,
1454- " " .join (["/c" , AppSettings .path + "/" + " install.bat" ]),
1459+ " " .join (["/c" , rf'" { AppSettings .path } \\ install.bat"' ]),
14551460 None ,
14561461 1 ,
14571462 )
14581463
14591464 def uninstall ():
14601465 if not isValidTFPath ():
14611466 window .toolBox .setCurrentIndex (0 )
1462- window .location_error_text .setText ("!! Error: TFMain64.dll not found !!" )
1467+ window .location_error_text .setText (_translate ( "!! Error: TFMain64.dll not found !!" ) )
14631468 return
1469+
14641470 windll .shell32 .ShellExecuteW (
14651471 None ,
14661472 "runas" ,
14671473 "cmd.exe" ,
1468- " " .join (["/c" , AppSettings .path + "/" + " uninstall.bat" ]),
1474+ " " .join (["/c" , rf'" { AppSettings .path } \\ uninstall.bat"' ]),
14691475 None ,
14701476 1 ,
14711477 )
@@ -1504,7 +1510,7 @@ def saveGeneral():
15041510 if path in ["" , None ] or not os .path .isfile (r"{}/{}" .format (path , "TFMain64.dll" )):
15051511 AppSettings .path = ""
15061512 window .locationLineEdit .setText (AppSettings .path )
1507- window .location_error_text .setText ("!! Error: TFMain64.dll not found !!" )
1513+ window .location_error_text .setText (_translate ( "!! Error: TFMain64.dll not found !!" ) )
15081514 else :
15091515 AppSettings .path = path
15101516 window .location_error_text .setText ("" )
0 commit comments