Beispiel #1
0
    def __init__(self, parent=None):
        super(FileWatcher, self).__init__(parent)

        self.__files = {}

        self.__timer = QtCore.QTimer(self)
        self.__timer.setInterval(5000)
        self.__timer.timeout.connect(self.checkFiles)
Beispiel #2
0
    def setRefreshTime(self, value):
        value = int(value)

        if self.__refreshTimer is None:
            self.__refreshTimer = QtCore.QTimer(self)
            self.__refreshTimer.timeout.connect(self.__refresh)

        self.__refreshTimer.stop()
        self.__refreshTimer.start(max(value, 1) * 1000)
Beispiel #3
0
    def __init__(self, parent=None):
        QtCore.QAbstractTableModel.__init__(self, parent)
        self.__tasks = []
        self.__index = {}
        self.__jobId = None
        self.__lastUpdateTime = 0

        # A timer for refreshing duration column.
        self.__timer = QtCore.QTimer(self)
        self.__timer.setInterval(1000)
        self.__timer.timeout.connect(self.__durationRefreshTimer)
Beispiel #4
0
    def __init__(self, parent=None):
        super(TaskModel, self).__init__(parent)

        self.__jobId = None
        self.__lastUpdateTime = 0

        # Tasks are updated incrementally, so don't
        # remove missing ones
        self.refreshShouldRemove = False

        # A timer for refreshing duration column.
        self.__timer = QtCore.QTimer(self)
        self.__timer.setInterval(1000)
        self.__timer.timeout.connect(self.__durationRefreshTimer)
Beispiel #5
0
    def __init__(self, attrs, parent=None):
        super(JobWranglerWidget, self).__init__(parent)
        self.__attrs = attrs

        layout = QtGui.QVBoxLayout(self)
        layout.setContentsMargins(4,0,4,4)

        # DEBUG
        if not "projects" in attrs:
            attrs['projects'] = plow.client.get_projects()

        self.__model = model = JobModel(attrs, self)
        self.__proxy = proxy = models.AlnumSortProxyModel(self)
        proxy.setSourceModel(model)

        self.__view = view = TreeWidget(self)
        view.setModel(proxy)
        view.sortByColumn(4, QtCore.Qt.DescendingOrder)

        for i, width in enumerate(JobNode.HEADER_WIDTHS):
            view.setColumnWidth(i, width)

        view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        view.customContextMenuRequested.connect(self.__showContextMenu)

        layout.addWidget(view)

        #
        # Connections
        #
        view.doubleClicked.connect(self.__itemDoubleClicked)
        view.activated.connect(self.__itemClicked)

        model.modelReset.connect(view.expandAll)

        self.__refreshTimer = timer = QtCore.QTimer(self)
        timer.setSingleShot(True)
        timer.setInterval(1500)
        timer.timeout.connect(self.refresh)