Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilem Duha <vilem.duha@gmail.com>2019-05-28 16:25:00 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-05-28 21:41:32 +0300
commit18b843223df65b40bf77cb3c57a3824e2812647b (patch)
tree6534090da8d4c8f5c9d69340a015dc7203af5046 /blenderkit/ui_panels.py
parent8252cc7044eaa21ec08e4a25e86b62d4a851819b (diff)
BlenderKit: Change private flag to be an ENUM, so it can be expanded.
checks for private quota separately obviously still not computed on production server. show profile panel
Diffstat (limited to 'blenderkit/ui_panels.py')
-rw-r--r--blenderkit/ui_panels.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py
index 759e9c23..552516a4 100644
--- a/blenderkit/ui_panels.py
+++ b/blenderkit/ui_panels.py
@@ -134,8 +134,8 @@ def draw_upload_common(layout, props, asset_type, context):
if asset_type == 'MODEL' and props.subcategory != '': # by now block this for other asset types.
layout.prop(props, 'subcategory')
- layout.prop(props, 'is_private')
- if not props.is_private:
+ layout.prop(props, 'is_private', expand=True)
+ if props.is_private == 'PUBLIC':
layout.prop(props, 'license')
@@ -394,10 +394,8 @@ class VIEW3D_PT_blenderkit_profile(Panel):
@classmethod
def poll(cls, context):
- user_preferences = bpy.context.preferences.addons['blenderkit'].preferences
- if user_preferences.enable_oauth:
- return True
- return False
+
+ return True
def draw(self, context):
# draw asset properties here
@@ -411,9 +409,9 @@ class VIEW3D_PT_blenderkit_profile(Panel):
return
if len(user_preferences.api_key) < 20:
- layout.operator("wm.blenderkit_login", text="Login/ Sign up",
- icon='URL')
-
+ if user_preferences.enable_oauth:
+ layout.operator("wm.blenderkit_login", text="Login/ Sign up",
+ icon='URL')
else:
me = bpy.context.window_manager.get('bkit profile')
if me is not None:
@@ -426,8 +424,9 @@ class VIEW3D_PT_blenderkit_profile(Panel):
layout.label(text='Remaining private storage: %i Mb' % (me['remainingPrivateQuota']))
layout.operator("wm.url_open", text="See my uploads",
icon='URL').url = paths.BLENDERKIT_USER_ASSETS
- layout.operator("wm.blenderkit_logout", text="Logout",
- icon='URL')
+ if user_preferences.enable_oauth:
+ layout.operator("wm.blenderkit_logout", text="Logout",
+ icon='URL')
def draw_panel_model_rating(self, context):
@@ -802,11 +801,11 @@ class VIEW3D_PT_blenderkit_downloads(Panel):
row.label(text=asset_data['name'])
row.label(text=str(int(tcom.progress)) + ' %')
row.operator('scene.blenderkit_download_kill', text='', icon='CANCEL')
- if tcom.passargs.get('retry_counter',0)>0:
+ if tcom.passargs.get('retry_counter', 0) > 0:
row = layout.row()
- row.label(text = 'failed. retrying ... ', icon='ERROR')
- row.label(text = str(tcom.passargs["retry_counter"]))
-
+ row.label(text='failed. retrying ... ', icon='ERROR')
+ row.label(text=str(tcom.passargs["retry_counter"]))
+
layout.separator()