#!/bin/bash

response=$(zenity --question \
  --title="Paint.NET 3.5.11 Wine Warning" \
  --width=400 \
  --height=200 \
  --text=$'⚠️Warning⚠️ Before running Paint.NET 3.5.11, you must follow this instruction:\n\nAdd the application in winecfg at:\n\n  /opt/Paint.NET/PaintDotNet.exe\n\nThen set Wine Windows Version: to Windows XP 64 bits\nPlease open winecfg and set the Windows version first.' \
  --ok-label="Go to winecfg" \
  --extra-button="Run Paint.NET 3.5.11")

zenity_exit_status=$?

# Handle responses
if [ "$zenity_exit_status" -eq 0 ]; then
    # User clicked "Go to winecfg"
    winecfg
elif [ "$response" = "Run Paint.NET 3.5.11" ]; then
    # User clicked the extra button
    /usr/bin/paintdotnet
else
    # User closed the dialog or pressed Esc
    echo "Dialog closed or cancelled."
fi
