mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Did this the easy way and let's go!
This commit is contained in:
parent
e98f81c70c
commit
db1316dd68
4 changed files with 1 additions and 50 deletions
|
|
@ -42,9 +42,6 @@ class FtrackModule(
|
|||
|
||||
self.ftrack_url = ftrack_url
|
||||
|
||||
ftrack_open_as_app = ftrack_settings["ftrack_open_as_app"]
|
||||
self.ftrack_open_as_app = ftrack_open_as_app
|
||||
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
low_platform = platform.system().lower()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ import os
|
|||
import time
|
||||
import datetime
|
||||
import threading
|
||||
import platform
|
||||
import posixpath
|
||||
import ntpath
|
||||
import webbrowser
|
||||
|
||||
from Qt import QtCore, QtWidgets, QtGui
|
||||
|
||||
|
|
@ -54,43 +50,7 @@ class FtrackTrayWrapper:
|
|||
self.widget_login.raise_()
|
||||
|
||||
def show_ftrack_browser(self):
|
||||
env_pf64 = os.environ['ProgramW6432'].replace(
|
||||
ntpath.sep, posixpath.sep)
|
||||
env_pf32 = os.environ['ProgramFiles(x86)'].replace(
|
||||
ntpath.sep, posixpath.sep)
|
||||
env_loc = os.environ['LocalAppData'].replace(
|
||||
ntpath.sep, posixpath.sep)
|
||||
chromium_paths_win = [
|
||||
f"{env_pf64}/Google/Chrome/Application/chrome.exe",
|
||||
f"{env_pf32}/Google/Chrome/Application/chrome.exe",
|
||||
f"{env_loc}/Google/Chrome/Application/chrome.exe",
|
||||
f"{env_pf32}/Microsoft/Edge/Application/msedge.exe"
|
||||
]
|
||||
cur_os = cur_os = platform.system().lower()
|
||||
if cur_os == "windows":
|
||||
is_chromium = False
|
||||
for p in chromium_paths_win:
|
||||
if os.path.exists(p):
|
||||
is_chromium = True
|
||||
chromium_path = p
|
||||
break
|
||||
if is_chromium and self.module.ftrack_open_as_app:
|
||||
webbrowser.get(f"{chromium_path} %s").open_new(
|
||||
f"--app={self.module.ftrack_url}")
|
||||
else:
|
||||
webbrowser.get(using="windows-default").open_new(
|
||||
self.module.ftrack_url)
|
||||
|
||||
else:
|
||||
if self.module.ftrack_open_as_app:
|
||||
try:
|
||||
webbrowser.get(using='chrome').open_new(
|
||||
f"--app={self.module.ftrack_url}")
|
||||
except webbrowser.Error:
|
||||
webbrowser.open_new(self.module.ftrack_url)
|
||||
else:
|
||||
webbrowser.open_new(self.module.ftrack_url)
|
||||
return
|
||||
QtGui.QDesktopServices.openUrl(self.module.ftrack_url)
|
||||
|
||||
def validate(self):
|
||||
validation = False
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
"ftrack": {
|
||||
"enabled": false,
|
||||
"ftrack_server": "",
|
||||
"ftrack_open_as_app": false,
|
||||
"ftrack_actions_path": {
|
||||
"windows": [],
|
||||
"darwin": [],
|
||||
|
|
|
|||
|
|
@ -16,11 +16,6 @@
|
|||
"key": "ftrack_server",
|
||||
"label": "Server"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "ftrack_open_as_app",
|
||||
"label": "Open in app mode"
|
||||
},
|
||||
{
|
||||
"type": "splitter"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue