Skip to content

Commit

Permalink
Make shotgun login dialog visible and clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
victorbartel authored and ClementHector committed Feb 7, 2022
1 parent ac015e8 commit 58e00b2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 0 additions & 2 deletions openpype/modules/shotgun/hooks/post_shotgun_changes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from openpype.lib import PostLaunchHook


Expand Down
3 changes: 1 addition & 2 deletions openpype/modules/shotgun/shotgun_module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from typing import Optional, Dict, AnyStr, Any
from Qt import QtWidgets

from openpype.modules import PypeModule, ITrayModule, IPluginPaths, ILaunchHookPaths
from openpype.modules.shotgun.tray.shotgun_tray import ShotgunTrayWrapper

Expand Down Expand Up @@ -44,4 +44,3 @@ def tray_exit(self, *args, **kwargs):

def tray_menu(self, tray_menu):
return self.tray_wrapper.tray_menu(tray_menu)

7 changes: 2 additions & 5 deletions openpype/modules/shotgun/tray/credential_dialog.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import os
from typing import Any

import requests
from Qt import QtCore, QtWidgets

from openpype import style
from openpype.modules.ftrack.lib import credentials
from openpype import resources
from Qt import QtCore, QtGui, QtWidgets


class CredentialsDialog(QtWidgets.QDialog):
Expand Down
9 changes: 8 additions & 1 deletion openpype/modules/shotgun/tray/shotgun_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from openpype.modules.shotgun.tray.credential_dialog import CredentialsDialog
from Qt import QtWidgets


class ShotgunTrayWrapper:
module: Any
credentials_dialog: CredentialsDialog
Expand All @@ -11,6 +12,9 @@ def __init__(self, module) -> None:
self.module = module
self.credentials_dialog = CredentialsDialog(module)

def show_connect_dialog(self):
self.show_credential_dialog()

def show_credential_dialog(self):
self.credentials_dialog.show()
self.credentials_dialog.activateWindow()
Expand All @@ -19,9 +23,12 @@ def show_credential_dialog(self):
def tray_menu(self, tray_menu):
print(type(tray_menu))
menu = QtWidgets.QMenu("Shotgun", tray_menu)
show_connect_action = QtWidgets.QAction("Connect to Shotgun", menu)
show_connect_action.triggered.connect(self.show_connect_dialog)
menu.addAction(show_connect_action)

tray_menu.addMenu(menu)

def validate(self):
self.show_credential_dialog()
return True

4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[flake8]
# ignore = D203
ignore = BLK100, W504, W503
max-line-length = 79
max-line-length = 88
exclude =
.git,
__pycache__,
Expand All @@ -26,4 +26,4 @@ omit = /tests
directory = ./coverage

[tool:pytest]
norecursedirs = repos/* openpype/modules/ftrack/*
norecursedirs = repos/* openpype/modules/ftrack/*

0 comments on commit 58e00b2

Please sign in to comment.