コード例 #1
0
    def _handle_relative_toggle(self, value, force=False):
        icon =  QtGui.QIcon(":/icons/light/references.svg") if not value else QtGui.QIcon(":/icons/references_pushed.png")
        self._relative_button.setIcon(icon)
        self._relative = value

        if force and value:
            self._relative_button.setChecked(True)
コード例 #2
0
    def _handle_enabled_toggle(self, value, force=False):
        icon = QtGui.QIcon(":/icons/off.png") if not value else QtGui.QIcon(":/icons/on.png")
        self._enabled_button.setIcon(icon)
        self._enabled = value

        if force and value:
            self._enabled_button.setChecked(True)
コード例 #3
0
    def start(self):
        """Main method of this class
        It will create a BackgroundProcess that will be interacting with Deadline.
        The Background process is a Daemon Thread. It will be triggered every 30 secs.
        It will get any new job that is Active (Rendering, Queried) or Pending

        Once this BackgroundProcess timedout, it will automatically pass all the results
        through the method ``_results_emitted``
        """
        if not self._started:
            if not self._background_process:
                only_new_jobs = self.actionWrangler_only_jobs_from_now_on.isChecked()
                self._background_process = BackgroundProcess(only_new_jobs=only_new_jobs, parent=self)
                self._background_process.finished.connect(self._thread_finished)
                self._background_process.emit_results.connect(self._results_emitted)

                self._timer = QtCore.QTimer(self)
                self._timer.setInterval(30000)
                # self._timer.setSingleShot(True)
                self._timer.timeout.connect(self._background_process.start)
            
            self._timer.start()        
            self._started = True
            self.actionStart.setText("Pause")
            self.actionStart.setIcon(QtGui.QIcon(":/icons/light/pause.svg"))
            logger.info("Starting")
        else:
            self._timer.stop()
            self._background_process.terminate()
            self._background_process.wait()
            self.actionStart.setText("Start")
            self.actionStart.setIcon(QtGui.QIcon(":/icons/light/play.svg"))
            self._started = False        
            logger.info("Pausing")
        self.rules_tabs_widget.setDisabled(self._started)            
コード例 #4
0
 def _setup_info_button(self):
     self._info = QtWidgets.QPushButton()
     self._info.setMinimumSize(QtCore.QSize(20, 20))
     self._info.setMaximumSize(QtCore.QSize(20, 20))
     # self._info.setCheckable(True)
     self._info.setIconSize(QtCore.QSize(20, 20))
     self._info.setStyleSheet(CHECK_TOOLBUTTON_STYLESHEET)
     self._info.setIcon(QtGui.QIcon(":/icons/light/info.svg"))
     self._info.setFocusPolicy(QtCore.Qt.NoFocus)
     self._info.setCursor(QtCore.Qt.PointingHandCursor)       
     self._info.clicked.connect(self.show_description)
     # self._info.setAutoRaise(True)
     return self._info
コード例 #5
0
 def _setup_relative_button(self):
     self._relative_button = QtWidgets.QPushButton()
     self._relative_button.setMinimumSize(QtCore.QSize(20, 20))
     self._relative_button.setMaximumSize(QtCore.QSize(20, 20))
     self._relative_button.setCheckable(True)
     self._relative_button.setIconSize(QtCore.QSize(20, 20))
     self._relative_button.setIcon(QtGui.QIcon(":/icons/light/references.svg"))
     # self._relative_button.setAutoRaise(True)
     self._relative_button.setStyleSheet(CHECK_TOOLBUTTON_STYLESHEET)
     self._relative_button.toggled.connect(self._handle_relative_toggle)
     self._relative_button.setFocusPolicy(QtCore.Qt.NoFocus)
     self._relative_button.setCursor(QtCore.Qt.PointingHandCursor)        
     return self._relative_button
コード例 #6
0
 def _setup_enable_button(self):
     self._enabled_button = QtWidgets.QPushButton()
     self._enabled_button.setMinimumSize(QtCore.QSize(35, 25))
     self._enabled_button.setMaximumSize(QtCore.QSize(35, 25))
     self._enabled_button.setCheckable(True)
     self._enabled_button.setIconSize(QtCore.QSize(34, 25))
     self._enabled_button.setIcon(QtGui.QIcon(":/icons/off.png"))
     # self._enabled_button.setAutoRaise(True)       
     self._enabled_button.setStyleSheet(CHECK_TOOLBUTTON_STYLESHEET)
     self._enabled_button.toggled.connect(self._handle_enabled_toggle)
     self._enabled_button.setFocusPolicy(QtCore.Qt.NoFocus)
     self._enabled_button.setCursor(QtCore.Qt.PointingHandCursor)
     return self._enabled_button