def __init__(self, app): super().__init__() self.bridgetreasureChest = bridgetreasureChest.bridgetreasureChest() self.app = app self.translate = QCoreApplication.translate self.__v2rayshellVersion = "20180511" self.__windowTitile = "V2Ray-shell" + " " + self.__v2rayshellVersion self.runv2raycore = False self.iconStart = QIcon() self.iconStop = QIcon() self.__iconSize = QSize(32, 32) self.iconStart.addPixmap(QPixmap(filePath + "/icons/start.png"), QIcon.Normal, QIcon.On) self.iconStop.addPixmap(QPixmap(filePath + "/icons/stop.png"), QIcon.Disabled, QIcon.On) self.currentRowRightClicked = False self.v2rayshellTrayIcon = QSystemTrayIcon() self.v2rayshellTrayIcon.setIcon(self.iconStart) self.v2rayshellTrayIcon.show() self.radioButtonGroup = QButtonGroup() self.setV2RayshellLanguage() self.trytimes = self.bridgetreasureChest.getConnectiontrytimes() self.interval = self.bridgetreasureChest.getConnectioninterval() self.proxyTryConnect = proxyTryconnect() if v2rayshellDebug: self.proxyTryConnect.setresetTime(6, 3) else: self.proxyTryConnect.setresetTime(self.interval, self.trytimes) self.labelBridge = (self.translate("bridgePanel", "Start/Stop"), self.translate("bridgePanel", "Host Name"), self.translate("bridgePanel", "Config Name"), self.translate("bridgePanel", "Proxy"), self.translate("bridgePanel", "Time Lag")) self.checkTrayicon = QTimer() self.createBridgePanel()
def __init__(self, outputTextEdit, v2rayPath="v2ray", v2rayOption="", bridgetreasureChest=False): super().__init__() self.outputTextEdit = outputTextEdit self.v2rayPath = v2rayPath self.v2rayOption = v2rayOption self.bridgetreasureChest = bridgetreasureChest if not self.bridgetreasureChest: from bridgehouse.extension import bridgetreasureChest self.bridgetreasureChest = bridgetreasureChest.bridgetreasureChest( ) self.v2rayProcess = QProcess() self.v2rayProcess.setProcessChannelMode(QProcess.MergedChannels) self.v2rayProcess.setProcessEnvironment( QProcessEnvironment.systemEnvironment()) self.v2rayProcess.readyRead.connect(self.setoutputTextEdit) self.v2rayProcess.started.connect(self.oncreatePIDFile) self.start.connect(self.onstart) self.stop.connect(self.onstop) self.translate = QCoreApplication.translate self.pidFile = ".v2rayPID"
def __init__(self, app): super().__init__() self.__v2rayshellConfigFile = { "preferences": { "v2ray-core": "", "v2ray-coreFilePath": "", "connection": { "connect": "switch", "interval": 45, "timeout": 3, "enable": True, "trytimes": 3 } }, "configFiles": [ { "enable": True, "hostName": "", "configFileName": "" } ] } self.bridgetreasureChest = bridgetreasureChest.bridgetreasureChest() self.app = app self.translate = QCoreApplication.translate self.__v2rayshellVersion = "20171119" self.__windowTitile = "V2Ray-shell" self.runv2raycore = False self.iconStart = QIcon() self.iconStop = QIcon() self.__iconSize = QSize(32, 32) self.iconStart.addPixmap(QPixmap(filePath + "/icons/start.png"), QIcon.Normal, QIcon.On) self.iconStop.addPixmap(QPixmap(filePath + "/icons/stop.png"), QIcon.Disabled, QIcon.On) self.currentRowRightClicked = False self.v2rayshellTrayIcon = QSystemTrayIcon() self.v2rayshellTrayIcon.setIcon(self.iconStart) self.v2rayshellTrayIcon.show() self.radioButtonGroup = QButtonGroup() self.setV2RayshellLanguage() self.trytimes = self.bridgetreasureChest.getConnectiontrytimes() self.interval = self.bridgetreasureChest.getConnectioninterval() self.proxyTryConnect = proxyTryconnect() if v2rayshellDebug: self.proxyTryConnect.setresetTime(6, 3) else: self.proxyTryConnect.setresetTime(self.interval, self.trytimes) self.labelBridge = (self.translate("bridgePanel", "Start/Stop"), self.translate("bridgePanel", "Host Name"), self.translate("bridgePanel", "Config Name"), self.translate("bridgePanel", "Proxy"), self.translate("bridgePanel", "Time Lag")) self.createBridgePanel()
def __init__(self, bridgetreasureChest = False): super().__init__() self.__preferencesJSONFile = { "v2ray-core": "x.xx", "v2ray-coreFilePath": "v2ray", "connection":{ "enable": True, "connect": "switch", ### reconnect/switch "interval": 60, ### seconds "timeout" : 3, "trytimes": 3 } } self.bridgetreasureChest = bridgetreasureChest if bridgetreasureChest == False: from bridgehouse.extension import bridgetreasureChest self.bridgetreasureChest = bridgetreasureChest.bridgetreasureChest() self.translate = QCoreApplication.translate self.AllLanguage = self.bridgetreasureChest.getAllLanguage()
def __init__(self, bridgetreasureChest=False, bridgeSingal=False): self.v2rayAPI = v2rayAPI() self.bridgeSingal = bridgeSingal self.bridgetreasureChest = bridgetreasureChest if not self.bridgetreasureChest: from bridgehouse.extension import bridgetreasureChest self.bridgetreasureChest = bridgetreasureChest.bridgetreasureChest( ) self.updateV2Ray = updateV2ray(v2rayapi=self.v2rayAPI) if (self.bridgetreasureChest.getsilentInstall()): self.updateV2Ray.enableSilentInstall() self.usingVersion = self.bridgetreasureChest.getV2raycoreVersion() self.downloadFile = self.bridgetreasureChest.getupdatedownloadFile() self.installOption = self.bridgetreasureChest.getupdateinstallOption() self.downloadPath = False self.releaseVersion = None Qt.Everyday = 8 self.checkGithubV2RaycoreLastestReleaseVersion() self.startAutoupdateV2rayCore()
def __init__(self, protocol=False, proxyhostName=False, port=False, v2rayapi=False, bridgetreasureChest=False): super().__init__() self.translate = QCoreApplication.translate self.update = { "enable": True, "schedule": { "date": 8, "time": 4 }, "install": "auto", # ## auto install/ manual install "downloadFile": False, "silentInstall": True } self.daysoftheweek = (self.translate("v2rayUpdatePanel", "Select a Day for update"), self.translate("v2rayUpdatePanel", "Every Monday"), self.translate("v2rayUpdatePanel", "Every Tuesday"), self.translate("v2rayUpdatePanel", "Every Wednesday"), self.translate("v2rayUpdatePanel", "Every Thursday"), self.translate("v2rayUpdatePanel", "Every Friday"), self.translate("v2rayUpdatePanel", "Every Saturday"), self.translate("v2rayUpdatePanel", "Every Sunday"), self.translate("v2rayUpdatePanel", "Every Day")) self.downloadFiles = ("v2ray-windows-64.zip", "v2ray-macos.zip", "v2ray-linux-64.zip", "v2ray-windows-32.zip", "v2ray-linux-32.zip", "v2ray-freebsd-32.zip", "v2ray-freebsd-64.zip", "v2ray-linux-arm.zip", "v2ray-linux-arm64.zip", "v2ray-linux-mips.zip", "v2ray-linux-mips64.zip", "v2ray-linux-mips64le.zip", "v2ray-linux-mipsle.zip", "v2ray-openbsd-32.zip", "v2ray-openbsd-64.zip", "v2ray-linux-s390x.zip") self.protocol = protocol self.proxyhostName = proxyhostName self.port = port if (v2rayapi): self.v2rayAPI = v2rayapi else: self.v2rayAPI = v2rayAPI() self.bridgetreasureChest = bridgetreasureChest if not self.bridgetreasureChest: from bridgehouse.extension import bridgetreasureChest self.bridgetreasureChest = bridgetreasureChest.bridgetreasureChest( ) self.v2raycoreAPIURL = QUrl( r"""https://api.github.com/repos/v2ray/v2ray-core/releases/latest""" ) self.spinBoxPort = QSpinBox() self.lineEditProxy = QLineEdit() self.radioButtonSocks5 = QRadioButton("Socks") self.radioButtonHttp = QRadioButton("Http") self.groupBoxViaProxy = QGroupBox( self.translate("v2rayUpdatePanel", "Via Proxy")) self.groupBoxViaProxy.setCheckable(True) self.proxy = QNetworkProxy() if (self.protocol and self.proxyhostName and self.port and v2rayapi): self.settingProxyhost(protocol, proxyhostName, port) self.groupBoxViaProxy.setChecked(True) else: self.groupBoxViaProxy.setChecked(False)