diff --git a/app/ui/timestamp.ui b/app/ui/timestamp.ui index 4ac116d..58cfee4 100644 --- a/app/ui/timestamp.ui +++ b/app/ui/timestamp.ui @@ -66,7 +66,7 @@ - false + true @@ -118,7 +118,7 @@ - false + true @@ -183,7 +183,7 @@ - false + true @@ -226,50 +226,72 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - Roboto Light - - - - Reset - - - - - - - - Roboto Light - - - - Register Timestamp - - - - - + + + + + 0 + 0 + + + + + Roboto Light + 10 + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + Roboto Light + + + + Reset + + + + + + + false + + + + Roboto Light + + + + Register Timestamp + + + + + diff --git a/app/widgets/timestamp.py b/app/widgets/timestamp.py index c8af23b..fc6b793 100644 --- a/app/widgets/timestamp.py +++ b/app/widgets/timestamp.py @@ -52,6 +52,8 @@ def __init__(self, *args, **kwargs): self.current_filepath = None self.current_comment = None + self.lbl_registration_feedback.setWordWrap(True) + # Ui Tweaks self.table_verification.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents) @@ -67,7 +69,7 @@ def process_file(self, file_path): log.debug('proccess file %s' % file_path) self.current_filepath = file_path self.button_dropzone.setText("Current File: %s" % os.path.basename(file_path)) - self.gbox_processing_status.setEnabled(True) + self.gbox_processing_status.setVisible(True) self.progress_bar.setMaximum(os.path.getsize(file_path)) self.progress_bar.setValue(0) self.progress_bar.show() @@ -79,6 +81,7 @@ def process_file(self, file_path): # Disable dropzone self.gbox_dropzone.setDisabled(True) self.button_dropzone.setDisabled(True) + self.button_reset.setEnabled(True) self.hash_thread.start() @@ -103,7 +106,7 @@ def hash_thread_finished(self): if timestamps: self.label_verification.setText('Found existing timestamps for document:') - self.gbox_verification.setEnabled(True) + self.gbox_verification.setVisible(True) self.table_verification.setRowCount(len(timestamps)) for row_id, row in enumerate(timestamps): for col_id, col in enumerate(row): @@ -118,21 +121,21 @@ def hash_thread_finished(self): self.progress_bar.hide() self.label_processing_status.setText('Fingerprint: %s' % self.current_fingerprint) - self.gbox_timestamp.setEnabled(True) + self.gbox_timestamp.setVisible(True) + self.button_register.setEnabled(True) @pyqtSlot() def register_timestamp(self): self.button_register.setDisabled(True) self.edit_comment.setDisabled(True) + self.lbl_registration_feedback.setVisible(True) try: txid = put_timestamp(self.current_fingerprint, self.edit_comment.text()) - self.edit_comment.hide() - self.label_register_comment.setText( + self.lbl_registration_feedback.setText( 'Timestamp registered. Transaction ID is: %s' % txid ) except Exception as e: - self.edit_comment.hide() - self.label_register_comment.setText( + self.lbl_registration_feedback.setText( 'Registration failed: %s' % e ) @@ -204,27 +207,28 @@ def reset(self): # Processing Status self.gbox_processing_status.show() - self.gbox_processing_status.setDisabled(True) + self.gbox_processing_status.setVisible(False) self.label_processing_status.setText('Waiting for document to process') self.progress_bar.hide() # Verification results - self.gbox_verification.setDisabled(True) + self.gbox_verification.setVisible(False) self.label_verification.setText('Waiting for document to verify') self.table_verification.clearContents() self.table_verification.setRowCount(0) self.table_verification.show() + self.lbl_registration_feedback.setVisible(False) + # Timestamp Form - self.gbox_timestamp.setDisabled(True) + self.gbox_timestamp.setVisible(False) self.label_register_comment.setText( 'You may add a public comment to your timestamp if you wish' ) self.edit_comment.clear() - self.edit_comment.show() self.edit_comment.setEnabled(True) - self.button_reset.setEnabled(True) - self.button_register.setEnabled(True) + self.button_reset.setEnabled(False) + self.button_register.setEnabled(False) if __name__ == '__main__':