summaryrefslogtreecommitdiff
path: root/src/leap/gui/progress.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-20 19:09:11 +0900
committerkali <kali@leap.se>2012-11-20 19:09:11 +0900
commit4e1d0ed099a82843cbb91d5f417c552e9f1674e2 (patch)
treeaa579b0b137a2180959e51c32a1b270459a42708 /src/leap/gui/progress.py
parentd225d5a4eb0a8e63eb11a0311c732bda88e8385b (diff)
added inline panel within zero-margin frame
Diffstat (limited to 'src/leap/gui/progress.py')
-rw-r--r--src/leap/gui/progress.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/leap/gui/progress.py b/src/leap/gui/progress.py
index 3ade28b3..cbfa6194 100644
--- a/src/leap/gui/progress.py
+++ b/src/leap/gui/progress.py
@@ -152,11 +152,12 @@ class WithStepsMixIn(object):
self.onStepStatusChanged)
# slot
- #@QtCore.pyqtSlot(QtCore.QString, int)
+ #@QtCore.pyqtSlot(str, int)
def onStepStatusChanged(self, status, progress=None):
- import pdb4qt; pdb4qt.set_trace()
if status not in ("head_sentinel", "end_sentinel"):
self.add_status_line(status)
+ if status in ("end_sentinel"):
+ self.check_last_item()
if progress and hasattr(self, 'progress'):
self.progress.setValue(progress)
self.progress.update()
@@ -165,6 +166,8 @@ class WithStepsMixIn(object):
self.steps = ProgressStepContainer()
# steps table widget
self.stepsTableWidget = StepsTableWidget(self)
+ zeros = (0, 0, 0, 0)
+ self.stepsTableWidget.setContentsMargins(*zeros)
self.errors = OrderedDict()
def set_error(self, name, error):
@@ -216,6 +219,19 @@ class WithStepsMixIn(object):
logger.debug('populate table. width=%s' % width)
table.horizontalHeader().resizeSection(0, width * FIRST_COLUMN_PERCENT)
+ def check_last_item(self):
+ """
+ mark the last item
+ as done
+ """
+ index = len(self.steps)
+ table = self.stepsTableWidget
+ table.setCellWidget(
+ index - 1,
+ ProgressStep.DONE,
+ ImgWidget(img=CHECKMARK_IMG))
+ table.update()
+
def add_status_line(self, message):
index = len(self.steps)
step = ProgressStep(message, False, index=index)