Example #1
0
 def _polish_icon(self, *args, **kwargs):
     if self._artella_image:
         if self.isCheckable() and self.isChecked():
             self.setIcon(
                 resource.icon(self._artella_image,
                               color=theme.theme().main_color))
         else:
             self.setIcon(resource.icon(self._artella_image))
Example #2
0
def show_error_message_box(title, text, parent=None):
    """
    Shows an error message box that can be used to show critical text to users.

    :param str title: text that is displayed in the title bar of the dialog
    :param str text: default text which is placed n the plain text edit
    :param QWidget parent: optional parent widget for the input text dialog. If not given, current DCC main parent
        window will be used.
    """

    if not QT_AVAILABLE:
        return

    from artella import dcc
    from artella.core import resource

    parent = parent if parent else dcc.get_main_window()
    window_icon = resource.icon('artella')

    message_box = QtWidgets.QMessageBox(parent)
    message_box.setWindowTitle(title)
    message_box.setWindowIcon(window_icon)
    message_box.setIcon(message_box.Icon.Critical)
    flags = message_box.windowFlags() ^ QtCore.Qt.WindowContextHelpButtonHint | QtCore.Qt.WindowStaysOnTopHint
    if text:
        message_box.setText(text)
    message_box.setStandardButtons(QtWidgets.QMessageBox.Ok)
    message_box.setWindowFlags(flags)
    message_box.exec_()
Example #3
0
    def __init__(self,
                 current_version,
                 latest_release_info,
                 parent=None,
                 **kwargs):
        super(VersionInfoDialog, self).__init__(parent, **kwargs)

        self._current_version = current_version
        self._latest_release_info = latest_release_info

        self.setWindowTitle('Updater - Version Checker')
        self.setWindowIcon(resource.icon('artella'))

        self._fill_data()
Example #4
0
 def enterEvent(self, event):
     if self._artella_image:
         self.setIcon(
             resource.icon(self._artella_image,
                           color=theme.theme().main_color))
     return super(ArtellaToolButton, self).enterEvent(event)