def setup_ui(self): super(VersionInfoDialog, self).setup_ui() versions_layout = QtWidgets.QHBoxLayout() versions_layout.setSpacing(2) versions_layout.setContentsMargins(0, 0, 0, 0) current_version_label = QtWidgets.QLabel('Current Version: ') self._current_version_label = QtWidgets.QLabel() latest_version_label = QtWidgets.QLabel('Latest Version: ') self._latest_version_label = QtWidgets.QLabel() versions_layout.addStretch() versions_layout.addWidget(current_version_label) versions_layout.addWidget(self._current_version_label) versions_layout.addStretch() versions_layout.addWidget(latest_version_label) versions_layout.addWidget(self._latest_version_label) versions_layout.addStretch() version_message_frame = QtWidgets.QFrame() version_message_frame.setFrameShape(QtWidgets.QFrame.StyledPanel) version_message_frame.setFrameShadow(QtWidgets.QFrame.Sunken) version_message_layout = QtWidgets.QHBoxLayout() version_message_layout.setSpacing(2) version_message_layout.setContentsMargins(0, 0, 0, 0) version_message_frame.setLayout(version_message_layout) self._version_icon = QtWidgets.QLabel() self._version_message_label = QtWidgets.QLabel() version_message_layout.addStretch() version_message_layout.addWidget(self._version_icon) version_message_layout.addWidget(self._version_message_label) version_message_layout.addStretch() buttons_layout = QtWidgets.QHBoxLayout() buttons_layout.setSpacing(2) buttons_layout.setContentsMargins(0, 0, 0, 0) self._go_to_download_web_btn = QtWidgets.QPushButton( 'Go to Artella Plugins website') buttons_layout.addWidget(self._go_to_download_web_btn) self.main_layout.addLayout(versions_layout) self.main_layout.addWidget(version_message_frame) self.main_layout.addLayout(buttons_layout) self._go_to_download_web_btn.clicked.connect( self._on_open_artella_plugins_webiste)
def setup_ui(self): super(AboutDialog, self).setup_ui() version_layout = QtWidgets.QHBoxLayout() version_layout.setContentsMargins(2, 2, 2, 2) version_layout.setSpacing(2) version_label = QtWidgets.QLabel('Version: '.format(dcc.nice_name())) self._artella_dcc_plugin_version_label = QtWidgets.QLabel() version_layout.addStretch() version_layout.addWidget(version_label) version_layout.addWidget(self._artella_dcc_plugin_version_label) version_layout.addStretch() button_layout = QtWidgets.QHBoxLayout() button_layout.setContentsMargins(2, 2, 2, 2) button_layout.setSpacing(2) self._show_plugins_btn = QtWidgets.QPushButton('Show Plugins') button_layout.addStretch() button_layout.addWidget(self._show_plugins_btn) button_layout.addStretch() self._plugins_tree = QtWidgets.QTreeWidget() self._plugins_tree.setHeaderLabels(['Name', 'Version', 'ID']) self._plugins_tree.setColumnCount(3) self._plugins_tree.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) self._plugins_tree.setVisible(False) self.main_layout.addStretch() self.main_layout.addLayout(version_layout) self.main_layout.addLayout(button_layout) self.main_layout.addStretch() self.main_layout.addLayout(button_layout) self.main_layout.addStretch() self.main_layout.addWidget(self._plugins_tree) self._show_plugins_btn.clicked.connect(self._on_toggle_plugins_visibility)
def __init__(self, id, name, package, version, author, email, summary, latest_version, upload_date, size, url, icon_pixmap=None, parent=None): super(PluginVersionWidget, self).__init__(parent) self._id = id self._name = name self._package = package self._version = version self._author = author self._email = email self._summary = summary self._latest_version = latest_version self._upload_date = upload_date self._size = size self._url = url icon_pixmap = (icon_pixmap or resource.pixmap('artella') or QtGui.QPixmap()).scaled( QtCore.QSize(30, 30), QtCore.Qt.KeepAspectRatio, transformMode=QtCore.Qt.SmoothTransformation) self.setFrameShape(QtWidgets.QFrame.StyledPanel) self.setFrameShadow(QtWidgets.QFrame.Raised) self.setMinimumHeight(130) main_layout = QtWidgets.QHBoxLayout() main_layout.setContentsMargins(2, 2, 2, 2) main_layout.setSpacing(2) self.setLayout(main_layout) main_info_layout = QtWidgets.QVBoxLayout() main_info_layout.setContentsMargins(2, 2, 2, 2) main_info_layout.setSpacing(2) top_layout = QtWidgets.QHBoxLayout() top_layout.setContentsMargins(2, 2, 2, 2) top_layout.setSpacing(5) self._icon_label = QtWidgets.QLabel() self._icon_label.setPixmap(icon_pixmap) self._icon_label.setAlignment(QtCore.Qt.AlignTop) self._plugin_name_label = QtWidgets.QLabel(name) self._plugin_version_label = QtWidgets.QLabel( '({})'.format(version)) plugin_name_info_layout = QtWidgets.QVBoxLayout() plugin_name_info_layout.setContentsMargins(2, 2, 2, 2) plugin_name_info_layout.setSpacing(5) plugin_name_layout = QtWidgets.QHBoxLayout() plugin_name_layout.setContentsMargins(2, 2, 2, 2) plugin_name_layout.setSpacing(2) plugin_info_layout = QtWidgets.QHBoxLayout() plugin_info_layout.setContentsMargins(2, 2, 2, 2) plugin_info_layout.setSpacing(5) plugin_name_layout.addWidget(self._plugin_name_label) plugin_name_layout.addWidget(self._plugin_version_label) plugin_name_layout.addStretch() plugin_name_info_layout.addLayout(plugin_name_layout) plugin_name_info_layout.addLayout(plugin_info_layout) plugin_name_info_layout.addStretch() self._plugin_date_label = QtWidgets.QLabel(upload_date) self._plugin_size_label = QtWidgets.QLabel(size) separator_widget = QtWidgets.QWidget() separator_layout = QtWidgets.QVBoxLayout() separator_layout.setAlignment(QtCore.Qt.AlignLeft) separator_layout.setContentsMargins(0, 0, 0, 0) separator_layout.setSpacing(0) separator_widget.setLayout(separator_layout) separator_frame = QtWidgets.QFrame() separator_frame.setMaximumHeight(15) separator_frame.setFrameShape(QtWidgets.QFrame.VLine) separator_frame.setFrameShadow(QtWidgets.QFrame.Sunken) separator_layout.addWidget(separator_frame) plugin_info_layout.addWidget(self._plugin_date_label) plugin_info_layout.addWidget(separator_widget) plugin_info_layout.addWidget(self._plugin_size_label) plugin_info_layout.addStretch() top_layout.addWidget(self._icon_label) top_layout.addLayout(plugin_name_info_layout) bottom_layout = QtWidgets.QHBoxLayout() bottom_layout.setContentsMargins(2, 2, 2, 2) bottom_layout.setSpacing(5) self._summary_text = QtWidgets.QPlainTextEdit(summary) self._summary_text.setReadOnly(True) self._summary_text.setMinimumHeight(60) self._summary_text.setFocusPolicy(QtCore.Qt.NoFocus) bottom_layout.addWidget(self._summary_text) download_layout = QtWidgets.QVBoxLayout() download_layout.setContentsMargins(2, 2, 2, 2) download_layout.setSpacing(2) self._progress = splash.ProgressCricle(width=80) self._progress_text = QtWidgets.QLabel('Wait please ...') self._ok_label = QtWidgets.QLabel() self._ok_label.setPixmap(resource.pixmap('success')) self._update_button = QtWidgets.QPushButton() self._progress.setVisible(False) self._progress_text.setVisible(False) self._ok_label.setVisible(False) progress_layout = QtWidgets.QHBoxLayout() progress_layout.addStretch() progress_layout.addWidget(self._progress) progress_layout.addStretch() progress_text_layout = QtWidgets.QHBoxLayout() progress_text_layout.addStretch() progress_text_layout.addWidget(self._progress_text) progress_text_layout.addStretch() ok_layout = QtWidgets.QHBoxLayout() ok_layout.addStretch() ok_layout.addWidget(self._ok_label) ok_layout.addStretch() download_layout.addStretch() download_layout.addLayout(progress_layout) download_layout.addLayout(progress_text_layout) download_layout.addLayout(ok_layout) download_layout.addWidget(self._update_button) download_layout.addStretch() main_info_layout.addLayout(top_layout) main_info_layout.addStretch() main_info_layout.addLayout(bottom_layout) main_info_layout.addStretch() main_info_layout.addStretch() main_layout.addLayout(main_info_layout) separator_widget = QtWidgets.QWidget() separator_layout = QtWidgets.QVBoxLayout() separator_layout.setAlignment(QtCore.Qt.AlignLeft) separator_layout.setContentsMargins(0, 0, 0, 0) separator_layout.setSpacing(0) separator_widget.setLayout(separator_layout) separator_frame = QtWidgets.QFrame() separator_frame.setFrameShape(QtWidgets.QFrame.VLine) separator_frame.setFrameShadow(QtWidgets.QFrame.Sunken) separator_layout.addWidget(separator_frame) main_layout.addWidget(separator_widget) main_layout.addLayout(download_layout) main_info_layout.addStretch() self._update_plugin_thread = QtCore.QThread(self) self._update_plugin_worker = utils.UpdatePluginWorker() self._update_plugin_worker.moveToThread(self._update_plugin_thread) self._update_plugin_worker.updateStart.connect( self._on_start_update) self._update_plugin_worker.updateFinish.connect( self._on_finish_update) self._update_plugin_thread.start() self._timer = QtCore.QTimer(self) self.updatePlugin.connect(self._update_plugin_worker.run) self._update_button.clicked.connect(self._on_update) self._timer.timeout.connect(self._on_advance_progress) self.refresh()