diff options
author | kali <kali@leap.se> | 2012-11-20 19:09:11 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-11-20 19:09:11 +0900 |
commit | 4e1d0ed099a82843cbb91d5f417c552e9f1674e2 (patch) | |
tree | aa579b0b137a2180959e51c32a1b270459a42708 | |
parent | d225d5a4eb0a8e63eb11a0311c732bda88e8385b (diff) |
added inline panel within zero-margin frame
-rw-r--r-- | src/leap/gui/firstrun/providerselect.py | 21 | ||||
-rw-r--r-- | src/leap/gui/progress.py | 20 |
2 files changed, 33 insertions, 8 deletions
diff --git a/src/leap/gui/firstrun/providerselect.py b/src/leap/gui/firstrun/providerselect.py index fc030cf3..3f021ee9 100644 --- a/src/leap/gui/firstrun/providerselect.py +++ b/src/leap/gui/firstrun/providerselect.py @@ -74,7 +74,7 @@ class SelectProviderPage(InlineValidationPage): validationMsg = QtGui.QLabel("") validationMsg.setStyleSheet(ErrorLabelStyleSheet) self.validationMsg = validationMsg - providerCheckButton = QtGui.QPushButton("check") + providerCheckButton = QtGui.QPushButton("chec&k") self.providerCheckButton = providerCheckButton # cert info @@ -113,7 +113,7 @@ class SelectProviderPage(InlineValidationPage): # add validation frame self.setupValidationFrame() - layout.addWidget(self.valFrame, 4, 1, 4, 2) + layout.addWidget(self.valFrame, 4, 2, 4, 2) self.valFrame.hide() self.setLayout(layout) @@ -135,8 +135,13 @@ class SelectProviderPage(InlineValidationPage): def setupValidationFrame(self): qframe = QtGui.QFrame valFrame = qframe() - valFrame.setFrameStyle(qframe.StyledPanel) # | qframe.Sunken) + valFrame.setFrameStyle(qframe.NoFrame) + # Box | qframe.Plain) + # NoFrame, StyledPanel) | qframe.Sunken) + #valFrame.setContentsMargins(0, 0, 0, 0) valframeLayout = QtGui.QVBoxLayout() + zeros = (0, 0, 0, 0) + valframeLayout.setContentsMargins(*zeros) #dummylabel = QtGui.QLabel('test foo') #valframeLayout.addWidget(dummylabel) @@ -147,12 +152,16 @@ class SelectProviderPage(InlineValidationPage): # check domain def onCheckButtonClicked(self): + print 'check button called....' + self.providerCheckButton.setDisabled(True) + self.valFrame.show() import time time.sleep(1) - self.is_done = True - self.providerCheckButton.setDisabled(True) - self.stepChanged.emit('foo check', 0) + # XXX bug here!... Y U DUPLICATE?!! + self.stepChanged.emit('xxx', 10) + self.stepChanged.emit('end_sentinel', 0) self.valFrame.show() + self.is_done = True self.completeChanged.emit() # cert trust verification 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) |