mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-08 22:59:48 +03:00
Add isScriptMode function
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -21,6 +21,7 @@ from Furious.Utility.Constants import (
|
||||
APPLICATION_MACOS_SIGNATURE,
|
||||
PLATFORM,
|
||||
)
|
||||
from Furious.Utility.Utility import isScriptMode
|
||||
|
||||
from PySide6 import QtCore
|
||||
|
||||
@@ -39,7 +40,7 @@ class StartupOnBoot:
|
||||
@staticmethod
|
||||
def on_():
|
||||
def _on():
|
||||
if sys.argv[0].endswith('.py'):
|
||||
if isScriptMode():
|
||||
# Script mode
|
||||
logger.info('ignore turn on StartupOnBoot in script mode')
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ from PySide6 import QtCore
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
import os
|
||||
import sys
|
||||
import copy
|
||||
import ujson
|
||||
import queue
|
||||
@@ -407,6 +408,10 @@ def isVPNMode():
|
||||
return isAdministrator() and APP().VPNMode == Switch.ON_
|
||||
|
||||
|
||||
def isScriptMode():
|
||||
return sys.argv[0].endswith('.py')
|
||||
|
||||
|
||||
def moveToCenter(widget, parent=None):
|
||||
geometry = widget.geometry()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user