# Path: vise/utils.py
# class Dialog(QDialog):
# 
#     '''
#     An improved version of Qt's QDialog class. This automatically remembers the
#     last used size, automatically connects the signals for QDialogButtonBox,
#     automatically sets the window title and if the dialog has an object named
#     splitter, automatically saves the splitter state.
# 
#     In order to use it, simply subclass an implement setup_ui(). You can also
#     implement sizeHint() to give the dialog a different default size when shown
#     for the first time.
#     '''
# 
#     def __init__(self, title, name, parent=None, prefs=gprefs):
#         QDialog.__init__(self, parent)
#         self.prefs_for_persistence = prefs
#         self.setWindowTitle(title)
#         self.name = name
#         self.bb = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
#         self.bb.accepted.connect(self.accept)
#         self.bb.rejected.connect(self.reject)
# 
#         self.setup_ui()
# 
#         self.resize(self.sizeHint())
#         geom = self.prefs_for_persistence.get(name + '-geometry', None)
#         if geom is not None:
#             self.restoreGeometry(geom)
#         if hasattr(self, 'splitter'):
#             state = self.prefs_for_persistence.get(name + '-splitter-state', None)
#             if state is not None:
#                 self.splitter.restoreState(state)
# 
#     def accept(self):
#         self.prefs_for_persistence.set(self.name + '-geometry', bytearray(self.saveGeometry()))
#         if hasattr(self, 'splitter'):
#             self.prefs_for_persistence.set(self.name + '-splitter-state', bytearray(self.splitter.saveState()))
#         QDialog.accept(self)
# 
#     def reject(self):
#         self.prefs_for_persistence.set(self.name + '-geometry', bytearray(self.saveGeometry()))
#         if hasattr(self, 'splitter'):
#             self.prefs_for_persistence.set(self.name + '-splitter-state', bytearray(self.splitter.saveState()))
#         QDialog.reject(self)
# 
#     def setup_ui(self):
#         raise NotImplementedError('You must implement this method in Dialog subclasses')
# 
# Path: vise/message_box.py
# def error_dialog(parent, title, msg, det_msg='', show=True, show_copy_button=True):
#     d = MessageBox(MessageBox.ERROR, _('ERROR:') + ' ' +
#                    title, msg, det_msg, parent=parent, show_copy_button=show_copy_button)
#     return d.exec() if show else d


from gettext import gettext as _
from PyQt6.QtCore import QUrl
from PyQt6.QtWidgets import QLineEdit, QCheckBox, QFormLayout, QLabel, QDialog
from .utils import Dialog
from .message_box import error_dialog
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>





class Credentials(Dialog):

    def __init__(self, msg, parent=None):
        self.msg = msg

# Path: vise/utils.py
# class Dialog(QDialog):
# 
#     '''
#     An improved version of Qt's QDialog class. This automatically remembers the
#     last used size, automatically connects the signals for QDialogButtonBox,
#     automatically sets the window title and if the dialog has an object named
#     splitter, automatically saves the splitter state.
# 
#     In order to use it, simply subclass an implement setup_ui(). You can also
#     implement sizeHint() to give the dialog a different default size when shown
#     for the first time.
#     '''
# 
#     def __init__(self, title, name, parent=None, prefs=gprefs):
#         QDialog.__init__(self, parent)
#         self.prefs_for_persistence = prefs
#         self.setWindowTitle(title)
#         self.name = name
#         self.bb = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
#         self.bb.accepted.connect(self.accept)
#         self.bb.rejected.connect(self.reject)
# 
#         self.setup_ui()
# 
#         self.resize(self.sizeHint())
#         geom = self.prefs_for_persistence.get(name + '-geometry', None)
#         if geom is not None:
#             self.restoreGeometry(geom)
#         if hasattr(self, 'splitter'):
#             state = self.prefs_for_persistence.get(name + '-splitter-state', None)
#             if state is not None:
#                 self.splitter.restoreState(state)
# 
#     def accept(self):
#         self.prefs_for_persistence.set(self.name + '-geometry', bytearray(self.saveGeometry()))
#         if hasattr(self, 'splitter'):
#             self.prefs_for_persistence.set(self.name + '-splitter-state', bytearray(self.splitter.saveState()))
#         QDialog.accept(self)
# 
#     def reject(self):
#         self.prefs_for_persistence.set(self.name + '-geometry', bytearray(self.saveGeometry()))
#         if hasattr(self, 'splitter'):
#             self.prefs_for_persistence.set(self.name + '-splitter-state', bytearray(self.splitter.saveState()))
#         QDialog.reject(self)
# 
#     def setup_ui(self):
#         raise NotImplementedError('You must implement this method in Dialog subclasses')
# 
# Path: vise/message_box.py
# def error_dialog(parent, title, msg, det_msg='', show=True, show_copy_button=True):
#     d = MessageBox(MessageBox.ERROR, _('ERROR:') + ' ' +
#                    title, msg, det_msg, parent=parent, show_copy_button=show_copy_button)
#     return d.exec() if show else d


# Path: vise/auth.py
from gettext import gettext as _
from PyQt6.QtCore import QUrl
from PyQt6.QtWidgets import QLineEdit, QCheckBox, QFormLayout, QLabel, QDialog
from .utils import Dialog
from .message_box import error_dialog

#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>





class Credentials(Dialog):

    def __init__(self, msg, parent=None):
        self.msg = msg

        Dialog.__init__(self, _('Password needed'), 'http-auth-credentials', parent)