-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheckwindow.py
More file actions
executable file
·46 lines (30 loc) · 1010 Bytes
/
checkwindow.py
File metadata and controls
executable file
·46 lines (30 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
__author__ = "helljump"
import logging
log = logging.getLogger(__name__)
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import uic
log = logging.getLogger(__name__)
class CheckWindow(QMainWindow):
canceled = pyqtSignal()
def __init__(self, title, label, ctext, from_=0, to=0, parent=None):
QMainWindow.__init__(self, parent)
uic.loadUi("assets/progress.ui", self)
self.setWindowTitle(title)
self.label.setText(label)
self.progressBar.setRange(from_, to)
def closeEvent(self, event):
self.canceled.emit()
event.accept()
def cancel(self):
self.close()
def setText(self, text):
self.label.setText(text)
def incValue(self, v=1):
self.setValue(self.value() + v)
def setValue(self, v):
self.progressBar.setValue(v)
def value(self):
return self.progressBar.value()