Compare commits
3 commits
3804f90bc6
...
e84f7bbd66
| Author | SHA1 | Date | |
|---|---|---|---|
| e84f7bbd66 | |||
| e3fae14c69 | |||
| 44dbc9b2e5 |
9 changed files with 2998 additions and 2881 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Application
|
# Application
|
||||||
APP_NAME=WebDrop Bridge
|
APP_NAME=WebDrop Bridge
|
||||||
APP_VERSION=0.8.1
|
APP_VERSION=0.8.2
|
||||||
|
|
||||||
# Web App
|
# Web App
|
||||||
WEBAPP_URL=file:///./webapp/index.html
|
WEBAPP_URL=file:///./webapp/index.html
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -2,7 +2,7 @@
|
||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||||
xmlns:ui="http://schemas.microsoft.com/wix/2010/ui"
|
xmlns:ui="http://schemas.microsoft.com/wix/2010/ui"
|
||||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||||
<Product Id="*" Name="WebDrop Bridge" Language="1033" Version="0.8.1"
|
<Product Id="*" Name="WebDrop Bridge" Language="1033" Version="0.8.2"
|
||||||
Manufacturer="HIM-Tools"
|
Manufacturer="HIM-Tools"
|
||||||
UpgradeCode="12345678-1234-1234-1234-123456789012">
|
UpgradeCode="12345678-1234-1234-1234-123456789012">
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
"""WebDrop Bridge - Qt-based desktop application for intelligent drag-and-drop file handling."""
|
"""WebDrop Bridge - Qt-based desktop application for intelligent drag-and-drop file handling."""
|
||||||
|
|
||||||
__version__ = "0.8.1"
|
__version__ = "0.8.2"
|
||||||
__author__ = "WebDrop Team"
|
__author__ = "WebDrop Team"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,16 @@
|
||||||
"""WebDrop Bridge - Application entry point."""
|
"""WebDrop Bridge - Application entry point."""
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# Force Chromium to treat hover as primary input method and disable touch detection
|
||||||
|
# This ensures CSS media queries (hover: hover) evaluate correctly for desktop applications
|
||||||
|
os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--touch-events=disabled"
|
||||||
|
|
||||||
|
# Enable Qt WebEngine Remote Debugging Protocol (Chromium Developer Tools)
|
||||||
|
# Allows debugging via browser DevTools at http://localhost:9222 or edge://inspect
|
||||||
|
os.environ["QTWEBENGINE_REMOTE_DEBUGGING"] = "9222"
|
||||||
|
|
||||||
from PySide6.QtWidgets import QApplication
|
from PySide6.QtWidgets import QApplication
|
||||||
|
|
||||||
from webdrop_bridge.config import Config, ConfigurationError
|
from webdrop_bridge.config import Config, ConfigurationError
|
||||||
|
|
@ -57,7 +66,7 @@ def main() -> int:
|
||||||
window.show()
|
window.show()
|
||||||
|
|
||||||
logger.info("Main window opened successfully")
|
logger.info("Main window opened successfully")
|
||||||
|
|
||||||
# Check for updates on startup (non-blocking, async)
|
# Check for updates on startup (non-blocking, async)
|
||||||
window.check_for_updates_startup()
|
window.check_for_updates_startup()
|
||||||
|
|
||||||
|
|
|
||||||
54
src/webdrop_bridge/ui/developer_tools.py
Normal file
54
src/webdrop_bridge/ui/developer_tools.py
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
"""Developer Tools for WebDrop Bridge - using Chromium Remote Debugging Protocol."""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
|
from PySide6.QtCore import QTimer, QUrl
|
||||||
|
from PySide6.QtWebEngineWidgets import QWebEngineView
|
||||||
|
from PySide6.QtWidgets import QVBoxLayout, QWidget
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
__all__ = ["DeveloperToolsWidget"]
|
||||||
|
|
||||||
|
|
||||||
|
class DeveloperToolsWidget(QWidget):
|
||||||
|
"""Embedded Chromium Developer Tools Inspector.
|
||||||
|
|
||||||
|
Loads the Chromium DevTools UI using the Remote Debugging Protocol
|
||||||
|
running on localhost:9222.
|
||||||
|
|
||||||
|
Features:
|
||||||
|
- Real HTML/CSS Inspector with live editing
|
||||||
|
- Full JavaScript Console with all DevTools features
|
||||||
|
- Network monitoring
|
||||||
|
- Performance profiling
|
||||||
|
- Storage inspection
|
||||||
|
- All standard Chromium DevTools features
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, web_view: Any) -> None:
|
||||||
|
"""Initialize Developer Tools.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
web_view: The QWebEngineView to debug
|
||||||
|
"""
|
||||||
|
super().__init__()
|
||||||
|
self.web_view = web_view
|
||||||
|
|
||||||
|
# Create layout
|
||||||
|
layout = QVBoxLayout(self)
|
||||||
|
layout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
layout.setSpacing(0)
|
||||||
|
|
||||||
|
# Create WebEngineView for DevTools UI
|
||||||
|
self.dev_tools_view = QWebEngineView()
|
||||||
|
layout.addWidget(self.dev_tools_view)
|
||||||
|
|
||||||
|
# Load DevTools after delay to let debugger start
|
||||||
|
QTimer.singleShot(500, self._load_devtools)
|
||||||
|
|
||||||
|
def _load_devtools(self) -> None:
|
||||||
|
"""Load the DevTools targets page from localhost:9222."""
|
||||||
|
logger.info("Loading DevTools from http://localhost:9222")
|
||||||
|
self.dev_tools_view.load(QUrl("http://localhost:9222"))
|
||||||
|
|
@ -22,7 +22,7 @@ from PySide6.QtCore import (
|
||||||
Signal,
|
Signal,
|
||||||
Slot,
|
Slot,
|
||||||
)
|
)
|
||||||
from PySide6.QtGui import QDesktopServices, QIcon, QMouseEvent
|
from PySide6.QtGui import QDesktopServices, QIcon, QKeySequence, QMouseEvent, QShortcut
|
||||||
from PySide6.QtWebChannel import QWebChannel
|
from PySide6.QtWebChannel import QWebChannel
|
||||||
from PySide6.QtWebEngineCore import QWebEngineDownloadRequest, QWebEngineScript
|
from PySide6.QtWebEngineCore import QWebEngineDownloadRequest, QWebEngineScript
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
|
|
@ -425,6 +425,11 @@ class MainWindow(QMainWindow):
|
||||||
# Create navigation toolbar (Kiosk-mode navigation)
|
# Create navigation toolbar (Kiosk-mode navigation)
|
||||||
self._create_navigation_toolbar()
|
self._create_navigation_toolbar()
|
||||||
|
|
||||||
|
# Set up F12 keyboard shortcut for Developer Tools
|
||||||
|
f12_shortcut = QShortcut(QKeySequence(Qt.Key.Key_F12), self)
|
||||||
|
f12_shortcut.activated.connect(self._open_developer_tools)
|
||||||
|
logger.debug("F12 shortcut registered for Developer Tools")
|
||||||
|
|
||||||
# Create status bar
|
# Create status bar
|
||||||
self._create_status_bar()
|
self._create_status_bar()
|
||||||
|
|
||||||
|
|
@ -1307,6 +1312,11 @@ class MainWindow(QMainWindow):
|
||||||
log_action.setToolTip("Open Log File")
|
log_action.setToolTip("Open Log File")
|
||||||
log_action.triggered.connect(self._open_log_file)
|
log_action.triggered.connect(self._open_log_file)
|
||||||
|
|
||||||
|
# Developer Tools button on the right
|
||||||
|
dev_tools_action = toolbar.addAction("🔧")
|
||||||
|
dev_tools_action.setToolTip("Developer Tools (F12)")
|
||||||
|
dev_tools_action.triggered.connect(self._open_developer_tools)
|
||||||
|
|
||||||
def _open_log_file(self) -> None:
|
def _open_log_file(self) -> None:
|
||||||
"""Open the application log file in the system default text editor.
|
"""Open the application log file in the system default text editor.
|
||||||
|
|
||||||
|
|
@ -1334,6 +1344,50 @@ class MainWindow(QMainWindow):
|
||||||
f"No log file found at:\n{log_file}",
|
f"No log file found at:\n{log_file}",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _open_developer_tools(self) -> None:
|
||||||
|
"""Open Developer Tools in a separate window.
|
||||||
|
|
||||||
|
Creates a dedicated window with JavaScript Console and DOM Inspector.
|
||||||
|
Provides code execution, DOM inspection, and console log capture all
|
||||||
|
in your application window - no external browser needed.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
# Check if dev tools window already exists and is visible
|
||||||
|
if not hasattr(self, "_dev_tools_window") or self._dev_tools_window is None:
|
||||||
|
from webdrop_bridge.ui.developer_tools import DeveloperToolsWidget
|
||||||
|
|
||||||
|
# Create new window
|
||||||
|
self._dev_tools_window = QMainWindow()
|
||||||
|
self._dev_tools_window.setWindowTitle("🔧 Developer Tools")
|
||||||
|
self._dev_tools_window.setGeometry(100, 100, 1200, 700)
|
||||||
|
self._dev_tools_window.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
|
||||||
|
|
||||||
|
# Create developer tools widget
|
||||||
|
dev_tools_widget = DeveloperToolsWidget(self.web_view)
|
||||||
|
|
||||||
|
# Set the widget as central widget
|
||||||
|
self._dev_tools_window.setCentralWidget(dev_tools_widget)
|
||||||
|
|
||||||
|
# Connect close event to clear reference
|
||||||
|
def on_close_dev_tools():
|
||||||
|
self._dev_tools_window = None
|
||||||
|
|
||||||
|
self._dev_tools_window.destroyed.connect(on_close_dev_tools)
|
||||||
|
|
||||||
|
# Show or bring to front
|
||||||
|
self._dev_tools_window.show()
|
||||||
|
self._dev_tools_window.raise_()
|
||||||
|
self._dev_tools_window.activateWindow()
|
||||||
|
logger.info("Developer Tools window opened")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Failed to open Developer Tools window: {e}", exc_info=True)
|
||||||
|
QMessageBox.warning(
|
||||||
|
self,
|
||||||
|
"Developer Tools",
|
||||||
|
f"Could not open Developer Tools:\n{e}",
|
||||||
|
)
|
||||||
|
|
||||||
def _create_status_bar(self) -> None:
|
def _create_status_bar(self) -> None:
|
||||||
"""Create status bar with update status indicator."""
|
"""Create status bar with update status indicator."""
|
||||||
self.status_bar = self.statusBar()
|
self.status_bar = self.statusBar()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue