diff --git a/.gitignore b/.gitignore index f8cf2ae..4f4c14e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,5 @@ -# Build artifacts -build/ -<<<<<<< HEAD - -# Python cache -__pycache__/ -*.pyc -*.pyo -*.pyd -.Python - -# Virtual environments -venv/ -env/ -ENV/ - -# Application data folders label/ -logs/ -pdf_backup/ -======= -dist/ +build/ logs/ pdf_backup/ venv/ @@ -28,24 +8,4 @@ __pycache__/ *.pyc *.pyo *.pyd ->>>>>>> 747656e (Fix Windows browse, status label mapping, and repo cleanup) -# User-specific configuration -conf/app.conf - -# IDE / Editor -.vscode/ -.idea/ -*.swp -*.swo -*~ - -# OS files -.DS_Store -Thumbs.db -desktop.ini - -# Python packaging -*.egg-info/ -.eggs/ -*.egg diff --git a/LabelPrinter.spec b/LabelPrinter.spec index e29d4c3..fa23c0a 100644 --- a/LabelPrinter.spec +++ b/LabelPrinter.spec @@ -6,7 +6,7 @@ a = Analysis( pathex=[], binaries=[], datas=[], - hiddenimports=['kivy', 'PIL', 'barcode', 'reportlab', 'print_label', 'print_label_pdf', 'svglib', 'cairosvg', 'watchdog', 'watchdog.observers', 'watchdog.events', 'pystray'], + hiddenimports=['kivy', 'kivy.core.window', 'kivy.core.text', 'kivy.core.image', 'kivy.uix.boxlayout', 'kivy.uix.gridlayout', 'kivy.uix.label', 'kivy.uix.textinput', 'kivy.uix.button', 'kivy.uix.spinner', 'kivy.uix.scrollview', 'kivy.uix.popup', 'kivy.clock', 'kivy.graphics', 'PIL', 'barcode', 'reportlab', 'print_label', 'print_label_pdf', 'svglib', 'cairosvg', 'watchdog', 'watchdog.observers', 'watchdog.events', 'pystray', 'win32timezone'], hookspath=[], hooksconfig={}, runtime_hooks=[], diff --git a/build_exe.py b/build_exe.py index 1cda591..c8a47b4 100644 --- a/build_exe.py +++ b/build_exe.py @@ -52,6 +52,7 @@ args = [ '--hidden-import=watchdog.observers', '--hidden-import=watchdog.events', '--hidden-import=pystray', + '--hidden-import=win32timezone', ] if __name__ == '__main__': diff --git a/build_windows.bat b/build_windows.bat index b33edf8..492a380 100644 --- a/build_windows.bat +++ b/build_windows.bat @@ -78,6 +78,7 @@ pyinstaller label_printer_gui.py ^ --hidden-import=watchdog.observers ^ --hidden-import=watchdog.events ^ --hidden-import=pystray ^ + --hidden-import=win32timezone ^ -y if errorlevel 1 ( diff --git a/conf/app.conf b/conf/app.conf index 168c69a..12cbb3f 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -1,4 +1,4 @@ [Settings] -file_path = C:\Users\Public\Documents\check.txt -printer = Microsoft Print to P +file_path = C:\temp\check.txt +printer = ZDesigner ZQ630 Plus diff --git a/dist/LabelPrinter.exe b/dist/LabelPrinter.exe new file mode 100644 index 0000000..9c76dc0 Binary files /dev/null and b/dist/LabelPrinter.exe differ diff --git a/label_printer_gui.py b/label_printer_gui.py index f0087b5..39e9086 100644 --- a/label_printer_gui.py +++ b/label_printer_gui.py @@ -15,7 +15,6 @@ from kivy.uix.popup import Popup from kivy.core.window import Window from kivy.uix.image import Image as KivyImage from kivy.graphics import Color, Rectangle -from kivy.uix.filechooser import FileChooserListView import os import threading @@ -646,14 +645,16 @@ printer = PDF def browse_file(self, instance): """Open file browser to select file to monitor""" - # On Windows, use native dialog to avoid missing-library issues with Kivy FileChooser - if platform.system() == 'Windows': + # On Windows, always use native dialog to avoid Kivy FileChooser win32timezone issues in packaged apps + if os.name == 'nt': selected_file = self._browse_file_windows_native() if selected_file: self.file_input.text = selected_file self.save_config() return + from kivy.uix.filechooser import FileChooserListView + content = BoxLayout(orientation='vertical', spacing=10, padding=10) # File chooser diff --git a/requirements_gui.txt b/requirements_gui.txt index 39e9c72..32b7f94 100644 --- a/requirements_gui.txt +++ b/requirements_gui.txt @@ -3,4 +3,5 @@ pillow pycups kivy reportlab +pywin32