Skip to content

Commit

Permalink
crop mode: add_all button clears all thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
xinntao committed Jul 29, 2022
1 parent d880c80 commit c5ea1f2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions handyview/canvas_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def add_all_images(self):
self.set_selection_pos()
# 1. clear all the existing thumbnails
self.thumbnails.clear()
self.crop_thumbnails.clear()
self.rect_thumbnails.clear()
# 2. add thumbnails
for path in self.db.path_list[0]:
self.thumbnails.addItem(QListWidgetItem(QIcon(path), os.path.basename(path)))
Expand Down Expand Up @@ -263,20 +265,20 @@ def record_crop_history(self, path, pos, ratio, mode):

def open_patch_folder(self):
try:
if sys.platform == "win32":
if sys.platform == 'win32':
os.startfile(self.patch_folder)
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
opener = 'open' if sys.platform == 'darwin' else 'xdg-open'
subprocess.call([opener, self.patch_folder])
except Exception as error:
show_msg(icon='Critical', title='Title', text=f'Open error: {error}', timeout=None)

def open_rect_folder(self):
try:
if sys.platform == "win32":
if sys.platform == 'win32':
os.startfile(self.rect_folder)
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
opener = 'open' if sys.platform == 'darwin' else 'xdg-open'
subprocess.call([opener, self.rect_folder])
except Exception as error:
show_msg(icon='Critical', title='Title', text=f'Open error: {error}', timeout=None)
Expand All @@ -295,10 +297,10 @@ def delete_rect_folder(self):

def open_history_file(self):
try:
if sys.platform == "win32":
if sys.platform == 'win32':
os.startfile(os.path.join(ROOT_DIR, 'history_crop.txt'))
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
opener = 'open' if sys.platform == 'darwin' else 'xdg-open'
subprocess.call([opener, os.path.join(ROOT_DIR, 'history_crop.txt')])
except Exception as error:
show_msg(icon='Critical', title='Title', text=f'Open error: {error}', timeout=None)
Expand Down

0 comments on commit c5ea1f2

Please sign in to comment.