Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove silo create tab from Loader and Context Manager GUI #393

Merged
merged 3 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion avalon/tools/cbloader/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, parent=None):

container = QtWidgets.QWidget()

assets = AssetWidget()
assets = AssetWidget(silo_creatable=False)
families = FamilyListWidget()
subsets = SubsetWidget()
version = VersionWidget()
Expand Down
2 changes: 1 addition & 1 deletion avalon/tools/contextmanager/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, parent=None):
accept_btn = QtWidgets.QPushButton("Accept")

# Asset picker
assets = AssetWidget()
assets = AssetWidget(silo_creatable=False)

# Task picker
tasks_widgets = QtWidgets.QWidget()
Expand Down
14 changes: 8 additions & 6 deletions avalon/tools/projectmanager/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ class SiloTabWidget(QtWidgets.QTabBar):
silo_changed = QtCore.Signal(str)
silo_added = QtCore.Signal(str)

def __init__(self, parent=None):
def __init__(self, silo_creatable=True, parent=None):
super(SiloTabWidget, self).__init__(parent=parent)
self.silo_creatable = silo_creatable
self._previous_tab_index = -1
self.set_silos([])

Expand All @@ -338,7 +339,7 @@ def on_tab_changed(self, index):

# If it's the last tab
num = self.count()
if index == num - 1:
if self.silo_creatable and index == num - 1:
self.on_add_silo()
self.setCurrentIndex(self._previous_tab_index)
return
Expand Down Expand Up @@ -372,8 +373,9 @@ def set_silos(self, silos):
for silo in sorted(silos):
self.addTab(silo)

# Add the "+" tab
self.addTab("+")
if self.silo_creatable:
# Add the "+" tab
self.addTab("+")

self.set_current_silo(current_silo)
self.blockSignals(False)
Expand Down Expand Up @@ -460,7 +462,7 @@ class AssetWidget(QtWidgets.QWidget):
selection_changed = QtCore.Signal() # on view selection change
current_changed = QtCore.Signal() # on view current index change

def __init__(self, parent=None):
def __init__(self, silo_creatable=True, parent=None):
super(AssetWidget, self).__init__(parent=parent)
self.setContentsMargins(0, 0, 0, 0)

Expand All @@ -471,7 +473,7 @@ def __init__(self, parent=None):
# Header
header = QtWidgets.QHBoxLayout()

silo = SiloTabWidget()
silo = SiloTabWidget(silo_creatable=silo_creatable)

icon = awesome.icon("fa.refresh", color=style.colors.light)
refresh = QtWidgets.QPushButton(icon, "")
Expand Down