Skip to content

Commit

Permalink
Merge branch 'bilal/dui3' into bilal/cnx-892-replace-placeholder-vers…
Browse files Browse the repository at this point in the history
…ion-dialog
  • Loading branch information
bimgeek authored Jan 15, 2025
2 parents 76aaf2f + d862ace commit 57f671d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
7 changes: 1 addition & 6 deletions bpy_speckle/speckle_blender_addon.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
}
],
"settings": {
"blender.addon.loadDirectory": "auto",
"blender.executables": [
{
"path": "/Applications/Blender.app/Contents/MacOS/Blender"
}
]
"blender.addon.loadDirectory": "auto"
}
}
4 changes: 2 additions & 2 deletions bpy_speckle/ui/project_selection_dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import bpy
from bpy.types import UILayout, Context, UIList, PropertyGroup, Operator, Event, WindowManager
from ..utils.project_manager import get_projects_for_account
from bpy.types import UILayout, Context, UIList, PropertyGroup, Operator, Event
from typing import List, Tuple
from ..utils.account_manager import get_account_enum_items, get_default_account_id

class speckle_project(bpy.types.PropertyGroup):
Expand Down
11 changes: 6 additions & 5 deletions bpy_speckle/ui/version_selection_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import bpy
from bpy.types import WindowManager
from bpy.types import WindowManager, UILayout, Context, UIList, PropertyGroup, Operator, Event
from typing import List, Tuple
from .mouse_position_mixin import MousePositionMixin
from ..utils.version_manager import get_versions_for_model

Expand All @@ -24,7 +25,7 @@ class SPECKLE_UL_versions_list(bpy.types.UIList):
This UIList is used to display a list of versions in the version selection dialog.
"""
#TODO: Adjust column widths so message has the most space.
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
def draw_item(self, context: Context, layout: UILayout, data: PropertyGroup, item: PropertyGroup, icon: str, active_data: PropertyGroup, active_propname: str) -> None:
if self.layout_type in {'DEFAULT', 'COMPACT'}:
row = layout.row(align=True)
split = row.split(factor=0.166)
Expand Down Expand Up @@ -99,7 +100,7 @@ def update_versions_list(self, context):

return None

def execute(self, context):
def execute(self, context: Context) -> set[str]:
model_card = context.scene.speckle_state.model_cards.add()
model_card.project_name = self.project_name
model_card.model_name = self.model_name
Expand All @@ -109,7 +110,7 @@ def execute(self, context):
model_card.version_id = selected_version.id
return {'FINISHED'}

def invoke(self, context, event):
def invoke(self, context: Context, event: Event) -> set[str]:

# Ensure WindowManager has the versions collection
if not hasattr(WindowManager, "speckle_versions"):
Expand All @@ -124,7 +125,7 @@ def invoke(self, context, event):

return context.window_manager.invoke_props_dialog(self)

def draw(self, context):
def draw(self, context: Context) -> None:
layout = self.layout
layout.label(text=f"Project: {self.project_name}")
layout.label(text=f"Model: {self.model_name}")
Expand Down
4 changes: 2 additions & 2 deletions bpy_speckle/utils/account_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from specklepy.api.credentials import get_local_accounts

def get_account_enum_items() -> list[tuple[str, str, str]]:
from typing import List, Tuple
def get_account_enum_items() -> List[Tuple[str, str, str]]:
accounts = get_local_accounts()
if not accounts:
return [("NO_ACCOUNTS", "No accounts found! Please add an account from Manager for Speckle.", "")]
Expand Down

0 comments on commit 57f671d

Please sign in to comment.