Skip to content

Commit 4907d2a

Browse files
committed
feat(gui-hex2str): show input and output char counts in window title
1 parent bd08612 commit 4907d2a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎hex2str/gui.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ def log_uncaught_exceptions(ex_cls, ex, tb) -> None:
3737
sys.excepthook = log_uncaught_exceptions
3838

3939

40+
WINDOW_TITLE: str = f"hex2str. Qt v{qVersion()}"
41+
42+
4043
class Widget(QWidget):
4144
def __init__(self) -> None:
4245
super().__init__()
4346

44-
self.setWindowTitle("hex2str")
47+
self.setWindowTitle(WINDOW_TITLE)
4548

4649
self.radio_button_hex2str = QRadioButton("hex2str")
4750
self.radio_button_hex2str.setChecked(True)
@@ -226,6 +229,12 @@ def _convert(self) -> None:
226229

227230
self.label_error.setText("Error: " + self.last_error_message)
228231

232+
input_chars: int = len(self.text_edit_input.toPlainText())
233+
output_chars: int = len(self.text_edit_output.toPlainText())
234+
self.setWindowTitle(
235+
f"{WINDOW_TITLE}. Input {input_chars} chars, output {output_chars} chars"
236+
)
237+
229238

230239
if __name__ == "__main__":
231240
app = QApplication([])

0 commit comments

Comments
 (0)