Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 9 additions & 2 deletions not1mm/data/configuration.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>684</width>
<width>699</width>
<height>499</height>
</rect>
</property>
Expand Down Expand Up @@ -1745,7 +1745,7 @@
<rect>
<x>5</x>
<y>25</y>
<width>639</width>
<width>670</width>
<height>378</height>
</rect>
</property>
Expand Down Expand Up @@ -2433,6 +2433,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="edit_rst">
<property name="text">
<string>Select the S in RST when field entered</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_8">
<property name="orientation">
Expand Down
4 changes: 4 additions & 0 deletions not1mm/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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()
Expand Down
14 changes: 14 additions & 0 deletions parse_gitlog.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions process-scratch.py
Original file line number Diff line number Diff line change
@@ -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]