* Added "Recheck for connected device feature" * WIP on progress bar
working for larger transfers * More generated debug files that I will probably use to help create tests
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Debug version of main window with console output
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, "src")
|
||||
|
||||
from gui.main_window import AndroidFileHandlerGUI
|
||||
|
||||
|
||||
class DebugAndroidFileHandlerGUI(AndroidFileHandlerGUI):
|
||||
"""Debug version with console output."""
|
||||
|
||||
def _initialize_components(self):
|
||||
"""Initialize GUI components and handlers with debug output."""
|
||||
super()._initialize_components()
|
||||
|
||||
# Wrap the progress callback with debug output
|
||||
original_update_progress = self.progress_handler.update_progress
|
||||
|
||||
def debug_update_progress(percentage):
|
||||
print(f"DEBUG: Progress update called with {percentage}%")
|
||||
return original_update_progress(percentage)
|
||||
|
||||
# Wrap the status callback with debug output
|
||||
original_set_status = self.progress_handler.set_status
|
||||
|
||||
def debug_set_status(message):
|
||||
print(f"DEBUG: Status update called with '{message}'")
|
||||
return original_set_status(message)
|
||||
|
||||
# Replace the callbacks
|
||||
self.progress_handler.update_progress = debug_update_progress
|
||||
self.progress_handler.set_status = debug_set_status
|
||||
|
||||
# Update ADB manager callbacks
|
||||
self.adb_manager.set_progress_callback(self.progress_handler.update_progress)
|
||||
self.adb_manager.set_status_callback(self.progress_handler.set_status)
|
||||
|
||||
print("DEBUG: Callbacks set up with debug wrappers")
|
||||
|
||||
|
||||
def main():
|
||||
"""Main function to run the debug application."""
|
||||
if sys.platform not in ["win32", "linux"]:
|
||||
import tkinter as tk
|
||||
from tkinter import messagebox
|
||||
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
messagebox.showerror(
|
||||
"Unsupported OS", "This application only supports Windows or Linux."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
app = DebugAndroidFileHandlerGUI()
|
||||
app.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user