### Manual Integration Example - Linux (Thunar) Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Illustrates how a user might manually add AICodePrep integration to a different Linux file manager like Thunar, by querying an AI assistant for specific commands. ```Linux > "How do I add a custom right-click action to the Thunar file manager on XFCE that runs the command `aicp %f` on a selected folder?" ``` -------------------------------- ### Windows Manual Installation Steps Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Manual installation steps for AICodePrep-GUI on Windows using the command line. This involves installing Python, pipx, and then the aicodeprep-gui package. ```shell py -m pip install --user pipx py -m pipx ensurepath pipx install aicodeprep-gui ``` -------------------------------- ### Linux Installer Script Execution Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Steps to make the Linux installer script executable and then run it. ```shell chmod +x INSTALLER_Linux.sh ./INSTALLER_Linux.sh ``` -------------------------------- ### Linux Manual Installation Steps Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Manual installation steps for AICodePrep-GUI on Linux using the command line. This involves installing Python and pip, pipx, and then the aicodeprep-gui package. ```shell python3 -m pip install --user pipx python3 -m pipx ensurepath pipx install aicodeprep-gui ``` -------------------------------- ### macOS Manual Installation Steps Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Manual installation steps for AICodePrep-GUI on macOS using the command line. This involves installing Homebrew, pipx, and then the aicodeprep-gui package. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install pipx pipx ensurepath pipx install aicodeprep-gui ``` -------------------------------- ### Running AICodePrep-GUI Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Command to execute the AICodePrep-GUI application after successful installation. ```shell aicp # or aicodeprep-gui ``` -------------------------------- ### Install Quick Action - macOS Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Details the steps to install the AICodePrep Quick Action on macOS. This allows users to right-click folders in Finder and access AICodePrep directly. ```macOS 1. After successfully installing the application, find the `AICodePrep.workflow` file that was included with your download. 2. Double-click `AICodePrep.workflow`. 3. A dialog will appear asking if you want to install the "AICodePrep" Quick Action. Click Install. 4. You can now right-click any folder in Finder and find the action under the Quick Actions menu. (Note: The `File` menu option inside the app does not currently work for this on macOS, so you must double-click the `.workflow` file.) ``` -------------------------------- ### Install Right-Click Menu - Windows Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Guides users through installing the right-click context menu integration for AICodePrep GUI on Windows. This process requires administrator privileges to modify the system registry. ```Windows 1. Run the app (`aicp`). 2. In the application's menu bar, go to `File` -> `Install Right-Click Menu...`. 3. Follow the on-screen instructions. A UAC prompt will appear, as this requires administrator privileges to modify the registry. ``` -------------------------------- ### Install pipx on macOS Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Installs pipx using Homebrew and ensures it's added to the system's PATH for subsequent package installations. ```sh # Install pipx using Homebrew brew install pipx # Add pipx to your PATH pipx ensurepath ``` -------------------------------- ### Install aicodeprep-gui on Linux Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Installs the aicodeprep-gui package using pipx after ensuring pipx is correctly set up and the terminal is reloaded to apply PATH changes. ```sh pipx install aicodeprep-gui ``` -------------------------------- ### Install aicodeprep-gui on Windows Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Installs the aicodeprep-gui package using pipx after setting up pipx and opening a new terminal window to apply PATH changes. ```sh pipx install aicodeprep-gui ``` -------------------------------- ### Install pipx on Windows Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Installs pipx for the current user and ensures its executables are added to the system's PATH. It assumes Python is already installed and accessible via 'py'. ```sh py -m pip install --user pipx py -m pipx ensurepath ``` -------------------------------- ### GitHub App Setup Instructions Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/github-sponsor-verification-plan.md Steps to create a GitHub App with necessary permissions for reading user profile and sponsorship information. ```text 1. Go to GitHub Settings > Developer settings > GitHub Apps 2. Create new GitHub App with these permissions: - Repository permissions: None needed - Account permissions: - Sponsorships: Read (to check if user sponsors you) - User permissions: - Profile: Read (to get user info) ``` -------------------------------- ### Python Delegate Customization - Interaction (Right-Click Menu) Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Provides an example of customizing interaction by adding a context menu for direct state selection via right-click. ```python from PySide6 import QtCore, QtGui, QtWidgets # Inside the delegate's editorEvent method: # if event.type() == QtCore.QEvent.MouseButtonPress and event.button() == QtCore.Qt.RightButton: # menu = QtWidgets.QMenu() # for value, label in [(0, "None"), (1, "Blue"), (2, "Green"), (3, "Gold"), (4, "Orange-Red")]: # act = menu.addAction(label) # # Connect to model.setData with the selected value # act.triggered.connect(lambda checked, v=value: model.setData(index, v, LEVEL_ROLE)) # menu.exec(QtGui.QCursor.pos()) # return True ``` -------------------------------- ### aicodeprep-gui Configuration Example Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md An example TOML file demonstrating how to customize aicodeprep-gui's behavior by overriding default filters for file size, code extensions, and exclusion/inclusion patterns. ```toml # Set a different max file size in bytes max_file_size = 2000000 # Override the default code extensions to check code_extensions = [".py", ".js", ".ts", ".html", ".css", ".rs"] # Add custom exclusion patterns (uses .gitignore syntax) exclude_patterns = [ "build/", "dist/", "*.log", "temp_*", "cache/" ] # Add custom patterns for files that should always be checked by default default_include_patterns = [ "README.md", "main.py", "docs/architecture.md" ] ``` -------------------------------- ### Install aicodeprep-gui on macOS Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Installs the aicodeprep-gui package using pipx after ensuring pipx is correctly set up and the terminal is reloaded. ```sh pipx install aicodeprep-gui ``` -------------------------------- ### Update and Install Python Packages on Linux Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Updates package lists, upgrades existing packages, installs pip for Python 3, and then installs pipx for user-space package management. ```sh sudo apt update && sudo apt upgrade -y sudo apt install python3-pip -y pip3 install --user pipx pipx ensurepath ``` -------------------------------- ### Configuration File Example Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/zzz_brain_mode.md An example JSON configuration file for the 'pro/brain_mode' directory. It specifies available AI models with their names and colors, as well as canvas settings like grid size and snapping behavior. ```json { "models": [ { "name": "OpenAI o3", "color": "#10a37f" }, { "name": "Kimi K2", "color": "#00a6fb" } ], "canvas": { "grid_size": 20, "snap_to_grid": true } } ``` -------------------------------- ### Install File Manager Action - Linux (Nautilus) Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Provides instructions for installing the AICodePrep file manager action on Linux, specifically for the Nautilus file manager. This enables right-click integration within GNOME, Ubuntu, and Cinnamon desktops. ```Linux 1. This feature is designed for the Nautilus file manager, which is default on GNOME, Ubuntu, and Cinnamon desktops. 2. Run the app (`aicp`). 3. In the application's menu bar, go to `File` -> `Install File Manager Action...`. 4. Use the "Install Nautilus Script" button. 5. You may need to restart Nautilus (`nautilus -q`) or log out and back in for the script to appear in your right-click menu. ``` -------------------------------- ### Skeleton Mode Example Output Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/Z.md Demonstrates the expected output format for a 'skeleton' mode, indicating which files and folders were compressed or skipped while preserving context. ```markdown ### These files/folders exist but the contents were skipped /fried/Potatoes.md /fried/test/ /fried/Soups.py ### END of Skipped ``` -------------------------------- ### aicodeprep-gui Configuration File Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md An example of the `aicodeprep-gui.toml` configuration file, which uses a `.gitignore`-style pattern system to intelligently include or exclude files from the context. ```toml # Example aicodeprep-gui.toml # Include all files by default include = ["**/*"] # Exclude node_modules, venv, and build directories exclude = [ "node_modules/", "venv/", "dist/", "build/", "*.pyc", "__pycache__/", ".git/" ] # Include specific file types [include_patterns] "*.py" = true "*.js" = true "*.md" = true # Exclude specific files [exclude_patterns] "*.lock" = true "*.log" = true # Include directories with specific files [include_dirs_with_files] "tests/" = ["test_*.py"] # Exclude directories with specific files [exclude_dirs_with_files] "docs/" = ["*.md"] ``` -------------------------------- ### Linux Package Manager Commands Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/INSTRUCTIONS.md Commands to install Python and Pip on different Linux distributions (Debian/Ubuntu, Fedora, Arch). ```shell # Debian/Ubuntu sudo apt update && sudo apt install python3 python3-pip -y # Fedora sudo dnf install python3 python3-pip -y # Arch sudo pacman -Syu python python-pip --noconfirm ``` -------------------------------- ### Basic QTreeWidget Setup Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/old_random_scripts/pyside6_qt_docs.md Initializes a QApplication and a QTreeWidget, setting the column count and header labels. This is the foundational step for creating a QTreeWidget. ```python import sys from PySide6.QtWidgets import QApplication, QTreeWidget, QTreeWidgetItem app = QApplication() tree = QTreeWidget() tree.setColumnCount(2) tree.setHeaderLabels(["Name", "Type"]) ``` -------------------------------- ### Dockerfile for Verification Service Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/github-sponsor-verification-plan.md This Dockerfile sets up a Python 3.11 environment for a verification service. It installs dependencies from requirements.txt, copies the application code, exposes port 8000, and runs the service using uvicorn. ```dockerfile FROM python:3.11-slim WORKDIR /app COPY requirements.txt . RUN pip install -r requirements.txt COPY . . EXPOSE 8000 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] ``` -------------------------------- ### APIDOC: MultiStateLevelDelegate Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Documentation for the `MultiStateLevelDelegate` class, responsible for rendering and handling interactions for the 5-state level column. ```apidoc class MultiStateLevelDelegate(QStyledItemDelegate): """Delegate for the 5-state level column. Handles painting of a visual indicator and user interaction (cycling states). """ LEVEL_ROLE = Qt.UserRole + 1 def __init__(self, parent=None): """Initializes the delegate. Args: parent: The parent widget. """ super().__init__(parent) def paint(self, painter: QPainter, option: QStyleOptionViewItem, index: QModelIndex): """Paints the item's level indicator. Args: painter: The QPainter object. option: The style options for the item. index: The model index of the item. """ # Implementation details for painting the indicator based on index.data(LEVEL_ROLE) # This includes calculating the rect, choosing colors, and drawing. pass def editorEvent(self, event: QEvent, view: QAbstractItemView, left: QModelIndex, right: QModelIndex) -> bool: """Handles user interaction events for the delegate. Detects clicks within the indicator's area and cycles the level state. Args: event: The event object. view: The item view. left: The top-left index. right: The bottom-right index. Returns: True if the event was handled, False otherwise. """ # Implementation to handle mouse clicks, state cycling, and potentially other events. # Example: Check for left mouse button press within the indicator's rect. # If clicked, calculate next state and call model.setData(index, next_state, self.LEVEL_ROLE). return super().editorEvent(event, view, left, right) ``` -------------------------------- ### Python Main Window Wiring Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Shows the necessary steps in the main window to set up the tree widget with the custom 'Level' column and delegate. ```python from PySide6 import QtWidgets # Assuming 'self.tree_widget' is a QTreeWidget instance: # self.tree_widget.setHeaderLabels(["File/Folder", "Level"]) # self.tree_widget.header().setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch) # self.tree_widget.header().setSectionResizeMode(1, QtWidgets.QHeaderView.ResizeToContents) # When creating items: # item = QtWidgets.QTreeWidgetItem(parent, [text, ""]) # item.setData(1, LEVEL_ROLE, 0) # Initialize level state ``` -------------------------------- ### GitHub OAuth Dialog UI Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/github-sponsor-verification-plan.md Provides a user interface for initiating the GitHub OAuth verification process, displaying instructions and a button to start the flow. ```python # aicodeprep_gui/gui/oauth_dialog.py from PySide6.QtWidgets import QDialog, QVBoxLayout, QPushButton, QLabel, QProgressBar from PySide6.QtCore import QTimer class GitHubOAuthDialog(QDialog): def __init__(self, parent=None): super().__init__(parent) self.oauth_handler = GitHubOAuthHandler(CLIENT_ID) self.setup_ui() def setup_ui(self): layout = QVBoxLayout() self.info_label = QLabel( "To enable Pro features, verify your GitHub sponsorship.\n" "This will open GitHub in your browser for secure authentication." ) self.verify_button = QPushButton("Verify with GitHub") self.verify_button.clicked.connect(self.start_verification) self.progress = QProgressBar() self.progress.setVisible(False) layout.addWidget(self.info_label) layout.addWidget(self.verify_button) layout.addWidget(self.progress) self.setLayout(layout) ``` -------------------------------- ### Python Delegate Customization - Painting with Icons Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Shows how to replace the default painted indicator with custom icons using QIcon or QPixmap. ```python from PySide6 import QtGui # Inside the delegate's paint method: # icon = QtGui.QIcon(":/icons/level_1.png") # Use Qt resource or file path # icon.paint(painter, rect) # Option 1: Let icon render itself # pix = QtGui.QPixmap(":/icons/level_1.png") # target = rect.adjusted(1, 1, -1, -1) # small inset # painter.drawPixmap(target, pix) # Option 2: Use QPixmap ``` -------------------------------- ### Python Data Storage and Initialization Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Demonstrates how to store and initialize the custom 5-state level data for tree widget items using a specific role. ```python from .components.multi_state_level_delegate import LEVEL_ROLE # Assuming 'item' is a QTreeWidgetItem instance and 'model' is its model # Initialize item with default state (0) item.setData(1, LEVEL_ROLE, 0) ``` -------------------------------- ### QTreeWidget Delegate Best Practices Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Provides best practices for developing custom delegates for `QTreeWidget`, including state management, resource caching, respecting selection visuals, and accessibility. ```APIDOC Best Practices for QTreeWidget Delegates: 1. State Management: - Use custom roles (e.g., LEVEL_ROLE) to store state, avoiding conflicts with built-in roles like checkboxes. 2. Resource Caching: - Cache heavy resources like icons or pixmaps within the delegate instance to prevent repeated loading during painting. 3. Visual Consistency: - Allow the Qt style to draw the base cell appearance before painting custom indicators to maintain consistent selection visuals. 4. Accessibility: - Implement tooltips or alternative text representations for custom indicators to support accessibility needs. ``` -------------------------------- ### Multiple Checkboxes on Same Line in PySide6 Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/pyside6_checkbox_examples.md Illustrates how to arrange multiple checkboxes horizontally using QHBoxLayout. This example shows a mix of binary and tri-state checkboxes, as well as a group of binary checkboxes, all placed on separate lines within a main layout. ```python from PySide6.QtCore import Qt from PySide6.QtWidgets import QApplication, QCheckBox, QHBoxLayout, QVBoxLayout, QWidget, QLabel import sys class MultipleCheckboxExample(QWidget): def __init__(self): super().__init__() main_layout = QVBoxLayout(self) # Example 1: Binary + Tri-state on same line row1_layout = QHBoxLayout() binary_checkbox = QCheckBox("Binary") binary_checkbox.stateChanged.connect(lambda state: print(f"Binary: {state == Qt.CheckState.Checked}")) tristate_checkbox = QCheckBox("Tri-state") tristate_checkbox.setTristate(True) tristate_checkbox.setCheckState(Qt.CheckState.PartiallyChecked) tristate_checkbox.stateChanged.connect(self.on_tristate_changed) row1_layout.addWidget(QLabel("Options:")) row1_layout.addWidget(binary_checkbox) row1_layout.addWidget(tristate_checkbox) row1_layout.addStretch() # Push checkboxes to the left # Example 2: Multiple binary checkboxes row2_layout = QHBoxLayout() option1 = QCheckBox("Option 1") option2 = QCheckBox("Option 2") option3 = QCheckBox("Option 3") row2_layout.addWidget(QLabel("Features:")) row2_layout.addWidget(option1) row2_layout.addWidget(option2) row2_layout.addWidget(option3) row2_layout.addStretch() main_layout.addLayout(row1_layout) main_layout.addLayout(row2_layout) def on_tristate_changed(self, state): states = { Qt.CheckState.Unchecked: "Unchecked", Qt.CheckState.PartiallyChecked: "Partially Checked", Qt.CheckState.Checked: "Checked" } print(f"Tri-state: {states[state]}") if __name__ == '__main__': app = QApplication(sys.argv) window = MultipleCheckboxExample() window.show() sys.exit(app.exec()) ``` -------------------------------- ### PySide6 QGridLayout Checkbox Example Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/pyside6_checkbox_examples.md This Python code snippet demonstrates how to use QGridLayout to arrange QCheckBox widgets within a PySide6 application. It shows how to create different types of checkboxes (normal, tri-state, disabled) and group related checkboxes, providing a structured layout for UI elements. ```python from PySide6.QtCore import Qt from PySide6.QtWidgets import QApplication, QCheckBox, QGridLayout, QWidget, QLabel import sys class GridCheckboxExample(QWidget): def __init__(self): super().__init__() layout = QGridLayout(self) # Row 1: Different types of checkboxes layout.addWidget(QLabel("Mixed Types:"), 0, 0) normal_cb = QCheckBox("Normal") layout.addWidget(normal_cb, 0, 1) tristate_cb = QCheckBox("Tri-state") tristate_cb.setTristate(True) layout.addWidget(tristate_cb, 0, 2) disabled_cb = QCheckBox("Disabled") disabled_cb.setEnabled(False) disabled_cb.setChecked(True) layout.addWidget(disabled_cb, 0, 3) # Row 2: Grouped functionality layout.addWidget(QLabel("Permissions:"), 1, 0) read_cb = QCheckBox("Read") write_cb = QCheckBox("Write") execute_cb = QCheckBox("Execute") layout.addWidget(read_cb, 1, 1) layout.addWidget(write_cb, 1, 2) layout.addWidget(execute_cb, 1, 3) if __name__ == '__main__': app = QApplication(sys.argv) window = GridCheckboxExample() window.show() sys.exit(app.exec()) ``` -------------------------------- ### aicodeprep-gui Command Line Usage Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Demonstrates how to launch the aicodeprep-gui tool from the command line, either in the current directory or a specified path, and how to access help. ```bash # Run in the current directory aicp # Run in a specific directory aicodeprep-gui /path/to/your/project # See all options aicp --help ``` -------------------------------- ### Python Delegate Painting Geometry Calculation Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Provides an example of calculating the rectangular area for painting the 5-state indicator within a tree widget cell. ```python from PySide6 import QtCore BOX_SIZE = 16 def _indicator_rect(option) -> QtCore.QRect: # centered rect in the cell # Implementation details for calculating the rect would go here ``` -------------------------------- ### Basic Tri-State Checkbox in PySide6 Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/pyside6_checkbox_examples.md Demonstrates how to create a basic tri-state checkbox using QCheckBox and setTristate(True). It connects to the stateChanged signal to print the current state (Unchecked, PartiallyChecked, Checked). ```python from PySide6.QtCore import Qt from PySide6.QtWidgets import QApplication, QCheckBox, QVBoxLayout, QWidget import sys class TriStateExample(QWidget): def __init__(self): super().__init__() layout = QVBoxLayout(self) # Create tri-state checkbox checkbox = QCheckBox("Tri-state check box") checkbox.setTristate(True) checkbox.setCheckState(Qt.CheckState.PartiallyChecked) # Connect to state change signal checkbox.stateChanged.connect(self.on_state_changed) layout.addWidget(checkbox) def on_state_changed(self, state): if state == Qt.CheckState.Unchecked: print("Unchecked") elif state == Qt.CheckState.PartiallyChecked: print("Partially Checked") elif state == Qt.CheckState.Checked: print("Checked") if __name__ == '__main__': app = QApplication(sys.argv) window = TriStateExample() window.show() sys.exit(app.exec()) ``` -------------------------------- ### GitHub App Creation Steps Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/github-sponsor-verification-plan.md Detailed instructions for creating a new GitHub App, including naming, setting the homepage and callback URLs, and configuring permissions. ```text 1. Go to https://github.com/settings/apps 2. Click "New GitHub App" 3. Fill in details: - Name: "aicodeprep-gui Sponsor Verification" - Homepage URL: Your GitHub repo URL - Callback URL: http://localhost:8080/callback - Permissions: Sponsorships (Read), Profile (Read) 4. Generate client secret 5. Note down Client ID and Client Secret ``` -------------------------------- ### PySide6 5-State Checkbox Widget Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/pyside6_checkbox_examples.md A custom QWidget that implements a 5-state checkbox. It visually represents states from empty to fully filled with color gradients and emits a signal when the state changes. The widget supports text labels and custom painting. ```python from PySide6.QtCore import Qt, Signal, QRect from PySide6.QtGui import QPainter, QPen, QBrush, QColor from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel from enum import IntEnum import sys class FiveState(IntEnum): STATE_0 = 0 # Empty STATE_1 = 1 # Quarter filled STATE_2 = 2 # Half filled STATE_3 = 3 # Three quarters filled STATE_4 = 4 # Fully filled class FiveStateCheckbox(QWidget): stateChanged = Signal(int) def __init__(self, text="", parent=None): super().__init__(parent) self._state = FiveState.STATE_0 self._text = text self.setMinimumSize(200, 30) self.setMaximumHeight(30) def state(self): return self._state def setState(self, state): if self._state != state: self._state = state self.stateChanged.emit(state) self.update() def mousePressEvent(self, event): if event.button() == Qt.MouseButton.LeftButton: # Cycle through states next_state = (self._state + 1) % 5 self.setState(next_state) super().mousePressEvent(event) def paintEvent(self, event): painter = QPainter(self) painter.setRenderHint(QPainter.RenderHint.Antialiasing) # Draw checkbox square checkbox_rect = QRect(5, 5, 20, 20) painter.setPen(QPen(QColor(0, 0, 0), 2)) painter.setBrush(QBrush(QColor(255, 255, 255))) painter.drawRect(checkbox_rect) # Fill based on state if self._state > FiveState.STATE_0: fill_height = int((checkbox_rect.height() - 4) * self._state / 4) fill_rect = QRect( checkbox_rect.x() + 2, checkbox_rect.bottom() - 2 - fill_height, checkbox_rect.width() - 4, fill_height ) # Color gradient from red to green colors = [ QColor(255, 0, 0), # Red QColor(255, 128, 0), # Orange QColor(255, 255, 0), # Yellow QColor(0, 255, 0) # Green ] painter.setBrush(QBrush(colors[self._state - 1])) painter.setPen(Qt.PenStyle.NoPen) painter.drawRect(fill_rect) # Draw text if self._text: text_rect = QRect(35, 0, self.width() - 35, self.height()) painter.setPen(QPen(QColor(0, 0, 0))) painter.drawText(text_rect, Qt.AlignmentFlag.AlignVCenter, self._text) class FiveStateExample(QWidget): def __init__(self): super().__init__() layout = QVBoxLayout(self) self.status_label = QLabel("State: 0 (Empty)") layout.addWidget(self.status_label) checkbox = FiveStateCheckbox("5-State Progress Checkbox") checkbox.stateChanged.connect(self.on_state_changed) layout.addWidget(checkbox) # Multiple 5-state checkboxes for i in range(3): cb = FiveStateCheckbox(f"Item {i+1}") cb.stateChanged.connect(lambda state, idx=i: print(f"Item {idx+1}: State {state}")) layout.addWidget(cb) def on_state_changed(self, state): state_names = ["Empty", "Quarter", "Half", "Three Quarters", "Full"] self.status_label.setText(f"State: {state} ({state_names[state]})") if __name__ == '__main__': app = QApplication(sys.argv) window = FiveStateExample() window.show() sys.exit(app.exec()) ``` -------------------------------- ### Launching aicodeprep-gui Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Demonstrates the two primary methods for launching the aicodeprep-gui application: via the operating system's right-click context menu or by executing a command in the terminal. ```bash Right-click any folder in your File Explorer, Finder, or Nautilus and select "Open with aicodeprep-gui". _or_ Pop open a terminal and type `aicp` and press Enter. ``` -------------------------------- ### aicodeprep-gui Command Line Usage Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Shows how to use the `aicp` command to launch aicodeprep-gui, optionally specifying a directory to process. ```bash # Launch in the current directory aicp # Launch and process a specific project directory aicp ./my-project ``` -------------------------------- ### QCheckBox Initialization Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/tristate.md Demonstrates how to create a QCheckBox with and without text, and with a parent widget. It also shows how to set a shortcut key. ```python from PyQt5.QtWidgets import QCheckBox # Checkbox with no text and a parent widget checkbox_no_text = QCheckBox(self) # Checkbox with text and a parent widget checkbox_with_text = QCheckBox("Case sensitive", self) # Setting a shortcut key (Alt+A) # For actual ampersand, use "&&" checkbox_shortcut = QCheckBox("&Case sensitive", self) ``` -------------------------------- ### QML Property Binding Example Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/pyside6_force_ui_update.md Provides an example of QML property binding where one element's property is linked to another, ensuring automatic updates. ```QML Rectangle { id: chartA color: "red" } Rectangle { id: chartB color: chartA.color // Updates automatically when chartA.color changes } ``` -------------------------------- ### Security Approach Comparison Table Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/github-sponsor-verification-plan.md A comparison of different security approaches for the AICodeprep GUI, evaluating identity verification, automation, server requirements, and complexity. ```APIDOC Security Approach Comparison: | Approach | Identity Verification | Automation | Server Required | Complexity | |------------------------------|-----------------------|------------|-----------------|------------| | Direct API (Approach 1) | ❌ None | ✅ Full | ❌ No | 🟢 Low | | Server + Webhook (Approach 2)| ❌ None | ✅ Full | ✅ Yes | 🟡 Medium | | Token System (Approach 3) | ❌ None | 🟡 Partial | ✅ Yes | 🟡 Medium | | GitHub OAuth (Approach 4) | ✅ Strong | ✅ Full | ❌ No* | 🔴 High | | Email Verification (Approach 5)| 🟡 Medium | 🟡 Partial | ✅ Yes | 🟡 Medium | | GitHub Issue Token (Approach 6)| ✅ Strong | ❌ Manual | ✅ Yes | 🟢 Low | *OAuth can work without a server initially, but may need a server for production. ``` -------------------------------- ### QStandardItemModel with Multi-State Item Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_checkbox_tree_docs.md Example of initializing a QStandardItem in a QStandardItemModel with a custom multi-state value using Qt.CheckStateRole. ```python from PySide6.QtGui import QStandardItem, QStandardItemModel model = QStandardItemModel() item = QStandardItem("File.txt") item.setData(0, Qt.CheckStateRole) # Start at state 0 model.appendRow(item) ``` -------------------------------- ### ProgressStateExample Usage Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/pyside6_custom_multistate_widgets.md An example demonstrating how to create and use the ProgressStateWidget within a PySide6 application. This includes setting up a basic layout. ```python class ProgressStateExample(QWidget): def __init__(self): super().__init__() layout = QVBoxLayout(self) ``` -------------------------------- ### Donation Methods Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/README.md Provides various methods for users to support the AICodePrep GUI project. This includes cryptocurrency addresses for Bitcoin, Litecoin, and Monero, as well as a CashApp handle and a link to the project's website. ```APIDOC Donation Methods: Bitcoin: Address: `bc1qut8nz74hlwztckdghlg0jxan5gnwyqmzkr9c94` Litecoin: Address: `ltc1q3z327a3ea22mlhtawmdjxmwn69n65a32fek2s4` Monero: Address: `46FzbFckBy9bbExzwAifMPBheYFb37k8ghGWSHqc6wE1BiEz6rQc2f665JmqUdtv1baRmuUEcDoJ2dpqY6Msa3uCKArszQZ` CashApp: Handle: `$lightweb73` Website: Link: `https://wuu73.org/hello.html` ``` -------------------------------- ### Standard Checkbox Role Example Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_checkbox_tree_docs.md Demonstrates how to return a checked state for a specific item in a PySide6 tree view using the Qt.CheckStateRole. ```python if role == Qt.CheckStateRole and index.row() == 1 and index.column() == 0: return Qt.CheckState.Checked ``` -------------------------------- ### Updating the Application Entry Point Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/f-refactor.md Modifies the main.py file to import the refactored MainWindow from aicodeprep_gui.main_window and moves the show_file_selection_gui helper function into main.py. ```python # Original file: main.py # from gui import FileSelectionGUI # Remove this import from aicodeprep_gui.main_window import MainWindow # Add this import def show_file_selection_gui(): # ... implementation ... pass def main(): # ... application setup ... # window = FileSelectionGUI() # Replace with: window = MainWindow() # ... rest of the main function ... pass ``` -------------------------------- ### Python Delegate Customization - Size and Position Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/pyside6_docs/level_column_delegate_guide.md Explains how to adjust the size and position of the painted indicator by modifying the `_indicator_rect` function. ```python from PySide6 import QtCore def _indicator_rect(option) -> QtCore.QRect: r = option.rect size = 18 x = r.x() + 6 # left pad y = r.y() + (r.height() - size) // 2 return QtCore.QRect(x, y, size, size) ``` -------------------------------- ### New Entry Point Function Source: https://github.com/detroittommy879/aicodeprep-gui/blob/main/f-refactor.md Defines a new function to instantiate and show the main application window, replacing the old entry point function. ```python def show_main_window(files): app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([]) gui = MainWindow(files) gui.show() app.exec() return gui.action, gui.get_selected_files() ```