Example #1
0
    def __init__(self, title, html="", parent=None):
        ''' Display information text in dialog.
        If no html is given, fill with About html.
        '''

        sys.excepthook = exception_handler
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_Dialog_information()
        self.ui.setupUi(self)
        self.setWindowTitle(title)
        if html == "":
            self.setHtml(a)
        else:
            self.setHtml(html)
Example #2
0
    def __init__(self, app, title, html="", parent=None):
        """Display information text in dialog.
        If no html is given, fill with About html. """

        sys.excepthook = exception_handler
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_Dialog_information()
        self.ui.setupUi(self)
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
        font = 'font: ' + str(app.settings['fontsize']) + 'pt '
        font += '"' + app.settings['font'] + '";'
        self.setStyleSheet(font)
        self.setWindowTitle(title)
        if html == "":
            self.setHtml(about.replace("QualCoderVersion", app.version))
        else:
            self.setHtml(html)
Example #3
0
class DialogInformation(QtWidgets.QDialog):
    """
    Dialog to display about information from html and text files for PyQDA development,
    version and license.
    The html is coded below because it avoids potential data file import errors with pyinstaller.
    Called from:
         qualcoder.MainWindow.about
         view_graph_original.ViewGraphOriginal.list_graph.TextGraphicsItem
         view_graph_original.ViewGraphOriginal.circular_graph.TextGraphicsItem
    """

    title = ""
    text = ""

    def __init__(self, app, title, html="", parent=None):
        """Display information text in dialog.
        If no html is given, fill with About html. """

        sys.excepthook = exception_handler
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_Dialog_information()
        self.ui.setupUi(self)
        self.setWindowFlags(self.windowFlags()
                            & ~QtCore.Qt.WindowContextHelpButtonHint)
        font = 'font: ' + str(app.settings['fontsize']) + 'pt '
        font += '"' + app.settings['font'] + '";'
        self.setStyleSheet(font)
        self.setWindowTitle(title)
        if html == "":
            self.setHtml(about.replace("QualCoderVersion", app.version))
        else:
            self.setHtml(html)

    def setHtml(self, html):
        """This method is used to populate the textEdit.
        Usually called from a View_graph TextGraphicsItem via a context menu. """

        self.text = html
        self.ui.textEdit.setHtml(self.text)

    def accepted(self):
        """ Accepted button overridden method """
        self.information = self.ui.textEdit.toPlainText()
        self.ui.Dialog_information.accept()
Example #4
0
    def __init__(self, title, filename="", parent=None):
        ''' Display information text in dialog.
        If no filename is given, open a blank dialog to be populated later '''

        sys.excepthook = exception_handler
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_Dialog_information()
        self.ui.setupUi(self)
        self.setWindowTitle(title)
        if filename != "":
            scriptdir = os.path.dirname(os.path.abspath(__file__))
            htmlFile = os.path.join(scriptdir, filename)
            try:
                with open(htmlFile, 'r', encoding='utf8') as f:
                    self.text = f.read()
                self.ui.textEdit.setHtml(self.text)
            except Exception as e:
                print(e)
                self.text = _("Cannot open file.")
Example #5
0
class DialogInformation(QtWidgets.QDialog):
    """
    Dialog to display details information PyQDA development, version and license.
    """

    title = ""
    text = ""

    #Dialog_information = None

    def __init__(self, title, filename="", parent=None):
        ''' Display information text in dialog.
        If no filename is given, open a blank dialog to be populated later '''

        sys.excepthook = exception_handler
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_Dialog_information()
        self.ui.setupUi(self)
        self.setWindowTitle(title)
        if filename != "":
            scriptdir = os.path.dirname(os.path.abspath(__file__))
            htmlFile = os.path.join(scriptdir, filename)
            try:
                with open(htmlFile, 'r', encoding='utf8') as f:
                    self.text = f.read()
                self.ui.textEdit.setHtml(self.text)
            except Exception as e:
                print(e)
                self.text = "Cannot open file."

    def setHtml(self, html):
        ''' This menthod is used to populate the textEdit.
        Usually called from a View_graph TextGraphicsItem via a context menu '''

        self.text = html
        self.ui.textEdit.setHtml(self.text)

    def accepted(self):
        ''' Accepted button overridden method '''
        self.information = self.ui.textEdit.toPlainText()
        self.ui.Dialog_information.accept()
Example #6
0
class DialogInformation(QtWidgets.QDialog):
    """
    Dialog to display about information from html and text files for PyQDA development,
    version and license.
    The html is coded below because it avoids potential data file import errors with pyinstaller.
    Called from:
         qualcoder.MainWindow.about
         view_graph_original.ViewGraphOriginal.list_graph.TextGraphicsItem
         view_graph_original.ViewGraphOriginal.circular_graph.TextGraphicsItem
    """

    title = ""
    text = ""

    def __init__(self, title, html="", parent=None):
        ''' Display information text in dialog.
        If no html is given, fill with About html.
        '''

        sys.excepthook = exception_handler
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_Dialog_information()
        self.ui.setupUi(self)
        self.setWindowTitle(title)
        if html == "":
            self.setHtml(a)
        else:
            self.setHtml(html)

    def setHtml(self, html):
        ''' This method is used to populate the textEdit.
        Usually called from a View_graph TextGraphicsItem via a context menu '''

        self.text = html
        self.ui.textEdit.setHtml(self.text)

    def accepted(self):
        ''' Accepted button overridden method '''
        self.information = self.ui.textEdit.toPlainText()
        self.ui.Dialog_information.accept()