Skip to content

Commit

Permalink
drag & drop event binding (main window, new record window)
Browse files Browse the repository at this point in the history
pyinstaller, nuitka update
release & distros rename
  • Loading branch information
piotrj committed Apr 15, 2024
1 parent 3cc4943 commit 3e59e6f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 10 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
name: librer Release ${{ steps.version.outputs.version }}
name: Librer ${{ steps.version.outputs.version }}
draft: false
prerelease: false
files: |
librer.${{ steps.version.outputs.version }}.portable.linux.zip
librer.${{ steps.version.outputs.version }}.portable.linux.nuitka.zip
librer.${{ steps.version.outputs.version }}.portable.windows.zip
librer.${{ steps.version.outputs.version }}.portable.windows.nuitka.zip
librer.${{ steps.version.outputs.version }}.linux.portable.zip
librer.${{ steps.version.outputs.version }}.linux.nuitka.portable.zip
librer.${{ steps.version.outputs.version }}.windows.portable.zip
librer.${{ steps.version.outputs.version }}.windows.nuitka.portable.zip
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
pyinstaller==6.5.0
pyinstaller==6.6.0
send2trash==1.8.2
zstandard==0.22.0
psutil==5.9.8
pympler==1.0.1
ciso8601==2.3.1
pywin32==306; sys.platform == 'win32'
nuitka==2.1.2
nuitka==2.1.5
tkinterdnd2==0.3.0
36 changes: 34 additions & 2 deletions src/librer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
####################################################################################

from os import sep,system,getcwd,name as os_name,cpu_count
from os.path import abspath,normpath,dirname,join as path_join,isfile as path_isfile
from os.path import abspath,normpath,dirname,join as path_join,isfile as path_isfile,exists as path_exists,isdir
from gc import disable as gc_disable, enable as gc_enable,collect as gc_collect,set_threshold as gc_set_threshold, get_threshold as gc_get_threshold

from pathlib import Path
Expand All @@ -37,6 +37,9 @@
from tkinter import Tk,Toplevel,PhotoImage,Menu,Label,LabelFrame,Frame,StringVar,BooleanVar,IntVar
from tkinter.ttk import Treeview,Checkbutton,Radiobutton,Scrollbar,Button,Menubutton,Entry,Scale,Style
from tkinter.filedialog import askdirectory,asksaveasfilename,askopenfilename,askopenfilenames

from tkinterdnd2 import DND_FILES, TkinterDnD

from threading import Thread
from traceback import format_stack
import sys
Expand Down Expand Up @@ -348,7 +351,11 @@ def __init__(self,cwd):

self.main_locked_by_child=None
####################################################################
self_main = self.main = Tk()
#self_main = self.main = Tk()
self_main = self.main = TkinterDnD.Tk()

self_main.drop_target_register(DND_FILES)
self_main.dnd_bind('<<Drop>>', lambda e: self.main_drop(e.data) )

self.main_config = self.main.config

Expand Down Expand Up @@ -929,6 +936,28 @@ def help_cascade_post():

self_main.mainloop()

def main_drop(self, data):
dialog = self.get_scan_dialog()
self.path_to_scan_entry_var.set(data)
self.scan_label_entry_var.set("dropped_path")

self.main.after_idle(lambda : self.scan_dialog_show())

def scan_dialog_drop(self, data):
if paths := self.main.splitlist(data):
path = paths[0]
p_path = normpath(abspath(path))

self.scan_label_entry_var.set("dropped_path")

if path_exists(p_path):
if isdir(p_path):
self.path_to_scan_entry_var.set(p_path)
else:
self.path_to_scan_entry_var.set(dirname(p_path))
else:
self.get_info_dialog_on_scan().show('Path does not exist',str(p_path))

def tree_focus_out(self):
tree = self.tree
item=tree.focus()
Expand Down Expand Up @@ -1128,6 +1157,9 @@ def get_scan_dialog(self):

self.scan_dialog=dialog=GenericDialog(self.main,(self.ico_record_new,self.ico_record_new),self.bg_color,'---',pre_show=self.pre_show,post_close=self.post_close,min_width=800,min_height=550)

dialog.area_main.drop_target_register(DND_FILES)
dialog.area_main.dnd_bind('<<Drop>>', lambda e: self.scan_dialog_drop(e.data) )

self_ico = self.ico

#self.log_skipped_var=BooleanVar()
Expand Down

0 comments on commit 3e59e6f

Please sign in to comment.