Skip to content

Commit

Permalink
fix 'zero records' bug
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj committed Jan 11, 2024
1 parent 68f5351 commit 75d2f51
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/librer.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def __init__(self,cwd):
self.cfg = Config(DATA_DIR)
self.cfg.read()

self.last_dir = self.cfg.get(CFG_last_dir).replace('/',sep)

self.cfg_get=self.cfg.get

self.last_dir = self.cfg_get(CFG_last_dir).replace('/',sep)

signal(SIGINT, lambda a, k : self.handle_sigint())

self.main_locked_by_child=None
Expand Down Expand Up @@ -552,7 +552,7 @@ def help_cascade_post():

self.main_update()
try:
cfg_geometry=self.cfg.get(CFG_geometry)
cfg_geometry=self.cfg_get(CFG_geometry)

if cfg_geometry:
self_main.geometry(cfg_geometry)
Expand Down Expand Up @@ -1842,7 +1842,10 @@ def motion_on_tree(self,event):
self.tooltip_show_after_tree = event.widget.after(1, self.show_tooltips_tree(event))

def configure_tooltip(self,widget):
self.tooltip_lab_configure(text=self.tooltip_message[str(widget)])
try:
self.tooltip_lab_configure(text=self.tooltip_message[str(widget)])
except Exception as te:
print(f'configure_tooltip error:{widget}:{te}')

def show_tooltip_widget(self,event):
self.unschedule_tooltip_widget(event)
Expand Down Expand Up @@ -3131,10 +3134,14 @@ def scan(self,compression_level):
self_progress_dialog_on_scan.abort_single_button.pack_forget()
#############################

self.scan_dialog.widget.update()
#self.tooltip_message[str_self_progress_dialog_on_scan_abort_button]='If you abort at this stage,\nyou will not get any results.'
self_tooltip_message = self.tooltip_message
self_configure_tooltip = self.configure_tooltip

self_tooltip_message[str_self_progress_dialog_on_scan_abort_button]='If you abort at this stage,\nData record will not be created.'
self_progress_dialog_on_scan.abort_button.configure(image=self.ico_abort,text='Cancel',compound='left',width=15)

self.scan_dialog.widget.update()

self.action_abort=False
self_progress_dialog_on_scan.abort_button.configure(state='normal')

Expand Down Expand Up @@ -3170,8 +3177,6 @@ def scan(self,compression_level):

self_progress_dialog_on_scan_lab[2].configure(image='',text='')

self_tooltip_message = self.tooltip_message
self_configure_tooltip = self.configure_tooltip

any_cde_enabled=False
cde_sklejka_list=[]
Expand Down Expand Up @@ -3247,10 +3252,6 @@ def scan(self,compression_level):

#############################

records_len = len(librer_core.records)
if records_len==0:
return

self_progress_dialog_on_scan_progr1var_set = self.progress_dialog_on_scan.progr1var.set
self_progress_dialog_on_scan_progr2var_set = self.progress_dialog_on_scan.progr2var.set

Expand All @@ -3271,10 +3272,6 @@ def scan(self,compression_level):

self_get_hg_ico = self.get_hg_ico

#librer_core_files_search_quant = librer_core.files_search_quant
#fnumber_files_search_quant = fnumber(files_search_quant)
#fnumber_records_len = fnumber(records_len)

self_tooltip_message[str_self_progress_dialog_on_scan_abort_button]='If you abort at this stage,\nData record will not be created.'
self_configure_tooltip(str_self_progress_dialog_on_scan_abort_button)

Expand Down Expand Up @@ -3474,6 +3471,7 @@ def scan_dialog_show(self):
self.CDE_shell_var_list[e].set(False)
self.CDE_timeout_var_list[e].set('')
self.CDE_crc_var_list[e].set(False)

self.cfg.set(CFG_KEY_CDE_SETTINGS,[])
self.cfg.write()

Expand Down

0 comments on commit 75d2f51

Please sign in to comment.