diff --git a/not1mm/__main__.py b/not1mm/__main__.py index 071361fe..86bafa79 100644 --- a/not1mm/__main__.py +++ b/not1mm/__main__.py @@ -42,7 +42,13 @@ QCloseEvent, QKeyEvent, ) -from PyQt6.QtWidgets import QFileDialog, QSplashScreen, QApplication, QPushButton +from PyQt6.QtWidgets import ( + QFileDialog, + QSplashScreen, + QApplication, + QPushButton, + QLineEdit, +) from PyQt6.QtCore import QT_VERSION_STR, PYQT_VERSION_STR from not1mm.lib.about import About @@ -2822,6 +2828,7 @@ def keyPressEvent(self, event: QKeyEvent) -> None: # pylint: disable=invalid-na next_tab.setFocus() next_tab.deselect() next_tab.end(False) + self.highlight_599(next_tab) return if self.receive.hasFocus(): logger.debug("From receive") @@ -2830,6 +2837,7 @@ def keyPressEvent(self, event: QKeyEvent) -> None: # pylint: disable=invalid-na prev_tab.setFocus() prev_tab.deselect() prev_tab.end(False) + self.highlight_599(prev_tab) else: next_tab = self.tab_next.get(self.receive) next_tab.setFocus() @@ -2843,6 +2851,7 @@ def keyPressEvent(self, event: QKeyEvent) -> None: # pylint: disable=invalid-na prev_tab.setFocus() prev_tab.deselect() prev_tab.end(False) + self.highlight_599(prev_tab) else: next_tab = self.tab_next.get(self.other_1) next_tab.setFocus() @@ -2856,6 +2865,7 @@ def keyPressEvent(self, event: QKeyEvent) -> None: # pylint: disable=invalid-na prev_tab.setFocus() prev_tab.deselect() prev_tab.end(False) + self.highlight_599(prev_tab) else: next_tab = self.tab_next.get(self.other_2) next_tab.setFocus() @@ -2883,6 +2893,7 @@ def keyPressEvent(self, event: QKeyEvent) -> None: # pylint: disable=invalid-na next_tab.setFocus() next_tab.deselect() next_tab.end(False) + self.highlight_599(next_tab) return if event.key() == Qt.Key.Key_F1: if event.modifiers() == Qt.KeyboardModifier.ShiftModifier: @@ -2932,6 +2943,10 @@ def keyPressEvent(self, event: QKeyEvent) -> None: # pylint: disable=invalid-na if event.key() == Qt.Key.Key_F12: self.process_function_key(self.F12) + def highlight_599(self, field: QLineEdit) -> None: + if field.text() == "599" and self.pref.get("edit_rst", False): + field.setSelection(1, 1) + def set_window_title(self) -> None: """ Set window title based on current state. diff --git a/not1mm/data/configuration.ui b/not1mm/data/configuration.ui index 9ca3b792..b61081ec 100644 --- a/not1mm/data/configuration.ui +++ b/not1mm/data/configuration.ui @@ -6,7 +6,7 @@ 0 0 - 684 + 699 499 @@ -1745,7 +1745,7 @@ 5 25 - 639 + 670 378 @@ -2433,6 +2433,13 @@ + + + + Select the S in RST when field entered + + + diff --git a/not1mm/lib/settings.py b/not1mm/lib/settings.py index 05fae47d..4dab079e 100644 --- a/not1mm/lib/settings.py +++ b/not1mm/lib/settings.py @@ -63,6 +63,8 @@ def setup(self): self.qsy_on_change.setChecked(bool(self.preference.get("sandpqsy", False))) + self.edit_rst.setChecked(bool(self.preference.get("edit_rst", False))) + self.use_esm.setChecked(bool(self.preference.get("use_esm", False))) value = self.preference.get("esm_agn", "DISABLED") @@ -253,6 +255,8 @@ def save_changes(self): self.preference["sandpqsy"] = self.qsy_on_change.isChecked() + self.preference["edit_rst"] = self.edit_rst.isChecked() + self.preference["use_esm"] = self.use_esm.isChecked() self.preference["esm_cq"] = self.esm_cq.currentText() self.preference["esm_agn"] = self.esm_agn.currentText() diff --git a/parse_gitlog.sh b/parse_gitlog.sh new file mode 100755 index 00000000..e3ab1a30 --- /dev/null +++ b/parse_gitlog.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# call git log, requesting just the commit date and commit message and direct the output to a temporary file. + +#If no date passed in, use today. +thevar="" +if [$1 -eq ""]; then + thevar=`date +"%F"` +else + thevar=$1 +fi + +git log --since=$thevar --pretty=format:"%ad %s" --date=short > scratch.txt +python process-scratch.py diff --git a/process-scratch.py b/process-scratch.py new file mode 100644 index 00000000..47e188f9 --- /dev/null +++ b/process-scratch.py @@ -0,0 +1,11 @@ +with open("scratch.txt", "r", encoding="utf-8") as fh: + prevdate = "" + for raw in fh: + line = raw.strip() + if not line: + continue + if prevdate != line[0:10]: + print(f"- [{line[0:10]}] {line[11:]}") + else: + print(f" - {line[11:]}") + prevdate = line[0:10]