Allow sharing only once
This commit is contained in:
@@ -41,6 +41,7 @@ global_scene_status = {}
|
|||||||
global_cancel = False
|
global_cancel = False
|
||||||
global_cached_system_info = None
|
global_cached_system_info = None
|
||||||
global_cached_compute_devices = None
|
global_cached_compute_devices = None
|
||||||
|
global_results_submitted = False
|
||||||
images = {}
|
images = {}
|
||||||
current_progress = 0.0
|
current_progress = 0.0
|
||||||
progress_lock = Lock()
|
progress_lock = Lock()
|
||||||
@@ -59,12 +60,14 @@ def reset_global_state():
|
|||||||
global global_result_dict
|
global global_result_dict
|
||||||
global global_background_image_path
|
global global_background_image_path
|
||||||
global global_scene_status
|
global global_scene_status
|
||||||
|
global global_results_submitted
|
||||||
global_result_platform = None
|
global_result_platform = None
|
||||||
global_progress_status = None
|
global_progress_status = None
|
||||||
global_result_stats = None
|
global_result_stats = None
|
||||||
global_result_dict = None
|
global_result_dict = None
|
||||||
global_background_image_path = ""
|
global_background_image_path = ""
|
||||||
global_scene_status = {}
|
global_scene_status = {}
|
||||||
|
global_results_submitted = False
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Draw Utilities.
|
# Draw Utilities.
|
||||||
@@ -568,6 +571,7 @@ class BENCHMARK_PT_main(Panel):
|
|||||||
sub.separator()
|
sub.separator()
|
||||||
|
|
||||||
sub = col.row()
|
sub = col.row()
|
||||||
|
sub.enabled = not global_results_submitted
|
||||||
sub.scale_y = 2.25
|
sub.scale_y = 2.25
|
||||||
sub.operator("benchmark.share", text="SHARE ONLINE")
|
sub.operator("benchmark.share", text="SHARE ONLINE")
|
||||||
|
|
||||||
@@ -854,6 +858,7 @@ class BENCHMARK_OT_share(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
from benchmark import submission
|
from benchmark import submission
|
||||||
|
global global_results_submitted
|
||||||
|
|
||||||
make_buttons_default()
|
make_buttons_default()
|
||||||
print('Submitting benchmark')
|
print('Submitting benchmark')
|
||||||
@@ -864,6 +869,7 @@ class BENCHMARK_OT_share(bpy.types.Operator):
|
|||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
print('Submission done')
|
print('Submission done')
|
||||||
make_buttons_green()
|
make_buttons_green()
|
||||||
|
global_results_submitted = True
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
class BENCHMARK_OT_opendata_link(bpy.types.Operator):
|
class BENCHMARK_OT_opendata_link(bpy.types.Operator):
|
||||||
|
Reference in New Issue
Block a user