Skip to content

Commit

Permalink
better ask dialog, fix scan on abort
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj committed Feb 24, 2024
1 parent b2a5dd9 commit 05b9e90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ def threaded_cde(timeout_semi_list,thread_index,thread_data_list,cde_errors_quan
cde_threads[thread_index] = cde_thread = Thread(target = lambda : threaded_cde(timeout_semi_list_per_thread[thread_index],thread_index,all_threads_data_list[thread_index],all_threads_files_cde_errors_quant[thread_index],all_threads_customdata_stats_time[thread_index]),daemon=True)
cde_thread.start()

self_killed = self.killed

while any_thread_alive:
any_thread_alive = False
now = time()
Expand Down Expand Up @@ -843,8 +845,6 @@ def threaded_cde(timeout_semi_list,thread_index,thread_data_list,cde_errors_quan
self_header.cde_stats_refs=customdata_stats_refs
self_header.cde_stats_time=customdata_stats_time



#############################################################
def sld_recalc_rec(self,scan_like_data):
new_size_on_this_level = 0
Expand Down
17 changes: 15 additions & 2 deletions src/librer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,19 @@ def get_text_ask_dialog_on_scan(self):

return self.text_ask_dialog_on_scan

ask_dialog_on_scan_created = False
@restore_status_line
@block
def get_ask_dialog_on_scan(self):
if not self.ask_dialog_on_scan_created:
self.status("Creating dialog ...")

self.ask_dialog_on_scan = LabelDialogQuestion(self.scan_dialog.widget,self.main_icon_tuple,self.bg_color,pre_show=lambda new_widget: self.pre_show(on_main_window_dialog=False,new_widget=new_widget),post_close=lambda : self.post_close(on_main_window_dialog=False),image=self.ico_warning)

self.ask_dialog_on_scan_created = True

return self.ask_dialog_on_scan

text_ask_dialog_on_main_created = False
@restore_status_line
@block
Expand Down Expand Up @@ -3601,8 +3614,8 @@ def scan(self,compression_level,threads,group=None):
all_timeout_set = False

if not all_timeout_set:
ask_dialog = self.get_text_ask_dialog_on_scan()
ask_dialog.show('CDE Timeout not set?','Continue without Custom Data Extractor timeout ?')
ask_dialog = self.get_ask_dialog_on_scan()
ask_dialog.show('CDE Timeout not set','Continue without Custom Data Extractor timeout ?')

if not ask_dialog.res_bool:
return False
Expand Down

0 comments on commit 05b9e90

Please sign in to comment.