# Path: vise/constants.py
# DOWNLOADS_URL = 'vise:downloads'
# WELCOME_URL = 'vise:welcome'
# STATUS_BAR_HEIGHT = 24
# FOLLOW_LINK_KEY_MAP = {getattr(Qt.Key, 'Key_' + x.upper()): x for x in string.ascii_lowercase + string.digits}
# VISE_SCHEME = 'vise'
# def _get_cache_dir():
# def _get_config_dir():
# def get_windows_username():
# def local_socket_address():
# 
# Path: vise/resources.py
# @lru_cache(maxsize=512)
# def get_icon(name):
#     if not name.startswith('images/'):
#         name = 'images/' + name
#     return QIcon(get_data_as_path(name))
# 
# Path: vise/settings.py
# def to_json(obj):
# def from_json(obj):
#     def __init__(self, name):
#     def conn(self):
#     def get(self, name, default=None):
#     def set(self, name, val):
#     def __getitem__(self, name):
#     def __setitem__(self, name, val):
#     def __delitem__(self, name):
#     def buffer_commits(self):
#     def buffer_commits(self, val):
#     def __enter__(self):
#     def __exit__(self, *args):
# def safe_makedirs(path):
# def create_script(
#     name, src, world=QWebEngineScript.ScriptWorldId.ApplicationWorld, injection_point=QWebEngineScript.InjectionPoint.DocumentCreation, on_subframes=True
# ):
# def client_script():
# def insert_scripts(profile, *scripts):
# def get_spell_langs():
# def create_profile(parent=None, private=False):
# def profile():
# def do_delete_profile(profile):
# def delete_profile():
# def quickmarks():
# class DynamicPrefs:
# TITLE_TOKEN = None
#     TITLE_TOKEN = hexlify(os.urandom(32)).decode('ascii')
# 
# Path: vise/utils.py
# def safe_disconnect(signal):
#     try:
#         signal.disconnect()
#     except TypeError:
#         pass  # signal was not connected


from gettext import gettext as _
from PyQt6.QtCore import QSize, Qt, pyqtSignal
from PyQt6.QtGui import QAction, QIcon, QKeySequence
from PyQt6.QtWidgets import (QApplication, QCheckBox, QDialog,
                             QDialogButtonBox, QGridLayout, QLabel,
                             QPlainTextEdit, QStyle)
from .constants import appname, str_version
from .resources import get_icon
from .settings import gprefs
from .utils import safe_disconnect
        if show_copy_button:
            self.ctc_button = self.bb.addButton(_('&Copy to clipboard'),
                                                QDialogButtonBox.ButtonRole.ActionRole)
            self.ctc_button.clicked.connect(self.copy_to_clipboard)

        self.show_det_msg = _('Show &details')
        self.hide_det_msg = _('Hide &details')
        self.det_msg_toggle = self.bb.addButton(self.show_det_msg, QDialogButtonBox.ButtonRole.ActionRole)
        self.det_msg_toggle.clicked.connect(self.toggle_det_msg)
        self.det_msg_toggle.setToolTip(
            _('Show detailed information about this error'))

        self.copy_action = QAction(self)
        self.addAction(self.copy_action)
        self.copy_action.setShortcuts(QKeySequence.StandardKey.Copy)
        self.copy_action.triggered.connect(self.copy_to_clipboard)

        self.is_question = type_ == self.QUESTION
        if self.is_question:
            self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Yes | QDialogButtonBox.StandardButton.No)
            self.bb.button(QDialogButtonBox.StandardButton.Yes if default_yes else QDialogButtonBox.StandardButton.No
                           ).setDefault(True)
            self.default_yes = default_yes
            if yes_text is not None:
                self.bb.button(QDialogButtonBox.StandardButton.Yes).setText(yes_text)
            if no_text is not None:
                self.bb.button(QDialogButtonBox.StandardButton.No).setText(no_text)
            if yes_icon is not None:
                self.bb.button(QDialogButtonBox.StandardButton.Yes).setIcon(yes_icon if isinstance(yes_icon, QIcon) else get_icon(yes_icon))
            if no_icon is not None:

# Path: vise/constants.py
# DOWNLOADS_URL = 'vise:downloads'
# WELCOME_URL = 'vise:welcome'
# STATUS_BAR_HEIGHT = 24
# FOLLOW_LINK_KEY_MAP = {getattr(Qt.Key, 'Key_' + x.upper()): x for x in string.ascii_lowercase + string.digits}
# VISE_SCHEME = 'vise'
# def _get_cache_dir():
# def _get_config_dir():
# def get_windows_username():
# def local_socket_address():
# 
# Path: vise/resources.py
# @lru_cache(maxsize=512)
# def get_icon(name):
#     if not name.startswith('images/'):
#         name = 'images/' + name
#     return QIcon(get_data_as_path(name))
# 
# Path: vise/settings.py
# def to_json(obj):
# def from_json(obj):
#     def __init__(self, name):
#     def conn(self):
#     def get(self, name, default=None):
#     def set(self, name, val):
#     def __getitem__(self, name):
#     def __setitem__(self, name, val):
#     def __delitem__(self, name):
#     def buffer_commits(self):
#     def buffer_commits(self, val):
#     def __enter__(self):
#     def __exit__(self, *args):
# def safe_makedirs(path):
# def create_script(
#     name, src, world=QWebEngineScript.ScriptWorldId.ApplicationWorld, injection_point=QWebEngineScript.InjectionPoint.DocumentCreation, on_subframes=True
# ):
# def client_script():
# def insert_scripts(profile, *scripts):
# def get_spell_langs():
# def create_profile(parent=None, private=False):
# def profile():
# def do_delete_profile(profile):
# def delete_profile():
# def quickmarks():
# class DynamicPrefs:
# TITLE_TOKEN = None
#     TITLE_TOKEN = hexlify(os.urandom(32)).decode('ascii')
# 
# Path: vise/utils.py
# def safe_disconnect(signal):
#     try:
#         signal.disconnect()
#     except TypeError:
#         pass  # signal was not connected


# Path: vise/message_box.py
from gettext import gettext as _
from PyQt6.QtCore import QSize, Qt, pyqtSignal
from PyQt6.QtGui import QAction, QIcon, QKeySequence
from PyQt6.QtWidgets import (QApplication, QCheckBox, QDialog,
                             QDialogButtonBox, QGridLayout, QLabel,
                             QPlainTextEdit, QStyle)
from .constants import appname, str_version
from .resources import get_icon
from .settings import gprefs
from .utils import safe_disconnect

        if show_copy_button:
            self.ctc_button = self.bb.addButton(_('&Copy to clipboard'),
                                                QDialogButtonBox.ButtonRole.ActionRole)
            self.ctc_button.clicked.connect(self.copy_to_clipboard)

        self.show_det_msg = _('Show &details')
        self.hide_det_msg = _('Hide &details')
        self.det_msg_toggle = self.bb.addButton(self.show_det_msg, QDialogButtonBox.ButtonRole.ActionRole)
        self.det_msg_toggle.clicked.connect(self.toggle_det_msg)
        self.det_msg_toggle.setToolTip(
            _('Show detailed information about this error'))

        self.copy_action = QAction(self)
        self.addAction(self.copy_action)
        self.copy_action.setShortcuts(QKeySequence.StandardKey.Copy)
        self.copy_action.triggered.connect(self.copy_to_clipboard)

        self.is_question = type_ == self.QUESTION
        if self.is_question:
            self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Yes | QDialogButtonBox.StandardButton.No)
            self.bb.button(QDialogButtonBox.StandardButton.Yes if default_yes else QDialogButtonBox.StandardButton.No
                           ).setDefault(True)
            self.default_yes = default_yes
            if yes_text is not None:
                self.bb.button(QDialogButtonBox.StandardButton.Yes).setText(yes_text)
            if no_text is not None:
                self.bb.button(QDialogButtonBox.StandardButton.No).setText(no_text)
            if yes_icon is not None:
                self.bb.button(QDialogButtonBox.StandardButton.Yes).setIcon(yes_icon if isinstance(yes_icon, QIcon) else get_icon(yes_icon))
            if no_icon is not None:

                self.bb.button(QDialogButtonBox.StandardButton.No).setIcon(no_icon if isinstance(no_icon, QIcon) else get_icon(no_icon))