Posts by speedy005

    update online

    OSCam Emu Patch Generator & Toolkit
    A powerful, Python-based GUI tool for automated OSCam patching and system readiness checks.

    Core Features

    • Automated Patching: Generates and applies the latest OSCam-Emu patches to your source directory with a single click.
    • Real-Time System Check: Integrated System Status Bar that monitors your environment for essential build tools (GIT, PATCH, GCC).
    • Visual Status Indicators: High-visibility LED-style indicators (Green/Red) provide instant feedback on tool availability.
    • Live Progress Monitoring: A dedicated log console (QTextEdit) captures and displays all background processes and command outputs in real-time.
    • Git Integration: Background worker thread checks for new commits on the Streamboard repository to keep your source up-to-date.

    Advanced UI & UX

    • Dual-Theme Support: Features a professional Dark Mode and Light Mode toggle to adapt to your working environment.
    • Modern Dashboard Design: High-contrast header with a digital clock, date display, and brand-specific branding.
    • Enhanced Progress Tracking: Stylish gradient progress bar with percentage overlays for long-running build tasks.
    • Smart Directory Management: Automatically detects and manages patch directories (S3/Simplebuild, local, or home fallbacks).
    • Self-Healing Logic: Includes an automatic dependency installer that checks for missing Python libraries upon startup.

    Technical Highlights

    • Framework: Built with PyQt6 for a native and responsive desktop experience.
    • Multi-Platform: Environment-aware script that handles pathing and permissions for both Linux (S3/opt) and Windows.
    • Non-Blocking UI: Uses QThread workers for network and Git operations to ensure the interface remains fluid and responsive.


    cu

    speedy005

    Project Overview: OSCam Emu Patch Generator
    This professional tool is designed to automate the process of creating and managing patches for OSCam-Emu. It bridges the gap between the official OSCam source code and the Emu-extensions, providing a user-friendly GUI for developers and enthusiasts.

    Core Features & Functionality

    • Automated Patch Generation:

      Automatically fetches the latest source code from official repositories (Streamboard and OSCam-Emu) and generates compatible .patch files.
    • Dual Repository Integration:

      Seamlessly switches between different repository URLs (e.g., official mirrors or custom developer forks) via a localized selection menu.
    • Smart Commit Tracking:

      Includes a built-in monitoring system that checks for new commits on the Streamboard. It notifies the user immediately if a new version is available to ensure the patch is always up to date.
    • Dynamic Localization (Multi-Language):

      Full support for German and English. The entire interface, including dialogs, button labels, and tooltips, adapts instantly to the selected language.
    • Intelligent Configuration Management:

      A robust backend saves user preferences (Author name, Repo URLs, Language) in a config.json. It features a "Silent Mode" to prevent log clutter during automated background tasks.
    • Advanced UI with Real-Time Logging:

      Features a color-coded Info-Screen (Red for timestamps, Cyan for system data) that provides live feedback on every action performed by the tool.
    • Cross-Platform Compatibility:

      Optimized for both Linux and Windows, with specific fixes for path handling in environments like Git Bash.
    • Safety & Sound Feedback:

      Includes integrated audio notifications for successful operations and errors, using system-safe playback methods.

    Technical Stack

    • Language: Python 3
    • Framework: PyQt6 (GUI)
    • Version Control: Git integration for diffing and patching.
    • Data Format: JSON-based configuration management.

    pasted-from-clipboard.png

    🚀 OSCam Emu Patch Manager - Features & Fixes

    1. Permanent Configuration & Persistence

    • Auto-Save System: The tool now remembers your selected color scheme even after a restart. It automatically writes your choice to the config.json file.
    • Startup Protection: I implemented an is_loading safety flag. This prevents the tool from accidentally overwriting your saved settings with default values during the boot-up phase.
    • Dynamic Loading: On startup, the script specifically looks for your last used theme and applies it before the UI becomes visible to the user.

    2. Intelligent Theming Engine

    • Global Color Management: We use a central dictionary (current_diff_colors) that defines Background, Text, Hover, and Border colors for every theme (Classics, Dark, Blue, etc.).
    • Themed Info Dialog: The "About" window is no longer "hard-coded." It now dynamically inherits the colors of your chosen theme, ensuring perfect readability (no more "white text on white background").
    • Color-Coded Branding:
      • Green: Highlights the Author/Success status (speedy005).
      • Blue: Used for informational titles and primary action buttons.
      • Red: Used for critical information like Licenses or Warnings.

    3. Technical Stability & UI Logic

    • Signal Blocking: We use blockSignals(True) during the initialization of the dropdown menus. This stops the app from triggering "Change" events while it's still loading the UI components.
    • Streamlined Log Output: Fixed the "Double Log" issue (where messages like "Git folder is being cleared" appeared twice). The app now performs its startup routines exactly once.
    • Robust Error Handling: The load_config function was improved to handle missing keys or corrupted JSON files by automatically falling back to safe default values without crashing.

    4. Code Cleanup

    • Syntax Fixes: Corrected critical errors (like the ef show_info typo) to ensure the script runs smoothly in any Python 3 environment.
    • Path Resolution: Uses absolute pathing for the config.json, ensuring the manager works correctly regardless of whether it's started from the terminal or via a shortcut.

    pasted-from-clipboard.png

    OSCAm Emu Patch Manager – Fixes & Improvements Summary

    1. Automatic Update Check at Startup

      • Added a 1-second delayed automatic check for plugin updates using QTimer.singleShot.

      • Shows a message if an update is available or not.

    2. Plugin Update Button Improvements

      • Clicking the Plugin Update button now shows a proper dialog:

        • If a new version is available → asks for confirmation before downloading.

        • If already up-to-date → shows a “No new version available” info message.

      • Fixed the bug where the old window remained open after updating on startup.

    3. Commit Count Feature

      • Added a label and spinbox to select the number of commits to display.

      • The value is now immediately saved to config.json whenever it changes.

      • Avoided duplicate spinboxes in the UI.

    4. Restart Tool Button

      • Text now adapts correctly to language changes.

      • Added missing English translation for "restart_tool": "Restart Tool" in TEXTS.

    5. Configuration Saving Method

      • Added a reusable save_config_value(key, value) method for writing changes to config.json.

    6. Text Updates (TEXTS)

      • Added missing translations for all new features (commit label, plugin update dialogs, restart button, etc.).

      • Ensured both English and German texts are consistent.

    7. Color Themes for Dark Mode

      • Added 15 new dark mode color themes in the format:

        Code
        "ThemeName": {"bg": "#1A1A1D", "text": "<BrightColor>"}
      • Each theme has a dark background and a bright text color.

    8. Miscellaneous Fixes

      • Fixed plugin_update_action() error regarding unexpected progress_callback argument.

      • Ensured smooth update process whether triggered at startup or via the Plugin Update button.

      pasted-from-clipboard.png

    OSCam Emu Patch Manager – Features

    1. Patch Management

      • Create, apply, check, and zip OSCam patches.

      • Backup old patches and restore them if needed.

      • Clean patch folders safely.

    2. S3 Patch Folder Integration

      • Set and save the path to your S3 patch folder.

      • All patch operations (backup, create, renew) use this folder automatically.

      • Config remembers the folder after restarting the tool.

    3. Plugin Updates

      • Update the OSCam Patch Manager plugin automatically.

      • Backup current plugin files before updating.

      • Shows an info box when the update is finished.

      • Optional restart of the tool after the update.

    4. Tool Restart

      • Manual “Restart Tool” button.

      • Restarts the application safely while keeping all settings.

    5. Git / Commit Integration

      • View commits directly from the tool.

      • Configure commit count.

      • Upload patches or OSCam Emu folders to GitHub.

      • Edit GitHub upload configuration for patches and OSCam Emu.

    6. User Interface Customization

      • Change language between English (EN) and German (DE).

      • Change color theme dynamically.

      • Digital clock display in the header.

      • Patch Header editor.

    7. Backup and Safety

      • Automatic backups of plugin files before updates.

      • Backup and restore patch files before applying changes.

    8. Progress Monitoring

      • Shows progress for long-running tasks (patch creation, Git uploads, etc.).

      • Info log panel for detailed messages.

    9. Grid & Option Buttons

      • Easy-to-access buttons for all major actions (patch, Git, plugin, config).

      • Options arranged clearly with color coding for quick identification.

    10. Config Persistence

      • Stores language, color theme, commit count, and S3 patch folder in config.json.

      • Automatically loads previous settings on startup.





    pasted-from-clipboard.pngpasted-from-clipboard.png

    OSCam Emu Patch Manager – Features

    Patch Creation

    • Generates a patch from the OSCam source code.

    • Automatically fetches the latest code from both the OSCam-Emu repo and the Streamboard OSCam repo.

    • Includes a header with version, build, commit hash, and modifier info.

    • Shows progress and info in the GUI with colored messages and emojis.

    Patch Renewal

    • Updates an existing patch by re-generating it from the latest source.

    Patch Checking

    • Verifies if the patch can be applied cleanly to the local OSCam-Emu Git repository.

    • Gives clear success/error messages in the GUI.

    Patch Application

    • Applies the patch directly to the local OSCam-Emu Git repository.

    • Configures Git user name/email automatically.

    • Commits the changes with a clear message including patch version.

    • Shows colored success or error messages in the info panel.

    Zip Patch

    • Packages the patch file (oscam-emu.patch) into a ZIP archive.

    • Confirms success in the GUI.

    Backup Old Patch

    • Creates a backup of the previous patch (oscam-emu.altpatch) before replacing it.

    • Ensures you can always revert if needed.

    Clean Patch Folder

    • Deletes temporary files in the patch folder.

    • Keeps important files intact (like config, scripts, icons).

    • Displays progress and success/error messages.

    OSCam-Emu Git Folder Management

    • Clean OSCam-Emu Git: Deletes the local OSCam-Emu Git repository safely.

    • Patch OSCam-Emu Git: Clones the repo, applies the patch, and commits changes automatically.

    GitHub Integration

    • Upload Patch File: Uploads oscam-emu.patch to a GitHub repository.

    • Ensures only the patch file is overwritten; other files remain untouched.

    • Upload OSCam-Emu Git Folder: Uploads the local OSCam-Emu Git repository with applied patch.

    • Manage GitHub Credentials: Configure username, token, repo URL, branch, Git user name/email.

    Tool Check

    • Automatically checks that required tools (git, patch, zip, python3, pip3) are installed.

    • Attempts to install missing tools on Debian/Ubuntu automatically.

    • Shows colored info/warning/error messages in the GUI.

    GUI Features

    • Modern PyQt6 interface with:

      • Info panel with colored messages and emojis (✅ ⚠️ ❌ ℹ️)

      • Buttons with icons for main actions

      • Language switching (English/Deutsch)

      • Color themes for buttons and progress bars

      • Progress bar for all actions

      • Commit count selection for viewing last commits

    Other Utilities

    • Change S3 patch folder: lets you point the tool to your old patch folder.

    • View Commits: shows the latest commits from the OSCam-Emu repository.

    • Supports multiple color themes for GUI readability and style.

      pasted-from-clipboard.png

    2️⃣ Old Patch Folder Button Renamed

    • In the “Options” section at the bottom (Grid Buttons), the S3-Patch Folder button was renamed to “Select Old Patch” (or in English: “S3 Folder”).
    • The button text is now pulled from TEXTS[LANG]["change_old_dir"] → makes switching languages easier.

    3️⃣ Progress Bar Centered Properly

    • Old version: full window width, looked messy.
    • New version:
      • QProgressBar wrapped in an HBoxLayout
      • addStretch() on left and right → centered
      • setFixedWidth(600) → reasonable length
    • Indentation cleaned up → Black-compatible.

    4️⃣ Consistent Indentation Everywhere

    • All code blocks now use 4 spaces per level.
    • Comments placed correctly at block level, not inside code.
    • No mix of tabs and spaces, avoiding Python syntax errors.

    5️⃣ Option Buttons Cleanly Created

    • create_option_button() function used → consistent height, radius, and colors
    • Buttons added to the layout in the correct order
    • Lambda callbacks set up correctly → activate button and execute action

    6️⃣ Grid Buttons Set Up Correctly

    • Buttons from actions = [...] added cleanly in a QGridLayout
    • Row/column calculation (divmod(idx, 3)) correct
    • Lambda callbacks clean, no indentation issues
    • Can now be formatted automatically with Black

    7️⃣ GitHub Upload Fix

    • The GitHub Upload buttons for Patch Files and OSCam-Emu-Git were fixed:
      • Proper text labels applied
      • Correct callbacks assigned
      • Buttons now behave consistently with other option buttons
      • All issues in the GitHub configuration window have been fixed.

    ✅ Summary:

    • All bottom option and grid buttons work correctly
    • Old Patch folder button renamed
    • Progress bar centered with reasonable width
    • Indentation fixed → compatible with Black
    • GitHub upload buttons now functional and integrated

    pasted-from-clipboard.png

    OSCam Emu Toolkit - Fixes and Improvements

    Patch Upload Fixed:

    • oscam-emu.patch now correctly overwrites the previous version on GitHub.

    • Only the patch file is updated; all other repository files remain untouched.

    • Commit messages are automatically extracted from the patch file header without unnecessary prefixes like Update patch.

    Progress Callback Compatibility:

    • All patch-related functions (create_patch, apply_patch, backup_old_patch, zip_patch, github_upload_patch_file) now support progress_callback correctly.

    • GUI progress bar reflects task completion properly.

    Header Handling:

    • Patch headers remain intact.

    • Git commit message uses the exact first line of the patch, removing redundant “Update patch” prefixes.

    Git Safety:

    • During patch uploads, only oscam-emu.patch is replaced; other files in the Git repository are preserved.

    • The tool performs git reset --hard and git pull safely to avoid conflicts without deleting unrelated files.

    • fix info screen

    General Stability:

    • Minor syntax and function fixes (create_icons, zip_patch, backup_old_patch) to ensure all features run without errors.

    • pasted-from-clipboard.png