mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
preferences: support a pre-defined list of date formats
Add a combo-box in place of the single line text field and support some pre-defined date formats, such as: MM/dd/yyyy Each long format has a corresponding short variant stored in the QMap dateFormatShortMap and it's updated automatically once the user selects a combo box item for the long format. The regex for dates is slighly modified: [^dMy/\\s:;\\.,\\-] The user is still allowed to enter custom long / short date foramats. Fixes #276 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
f1437cfec7
commit
2c06cb027f
3 changed files with 47 additions and 27 deletions
|
|
@ -74,13 +74,6 @@
|
|||
<string>Date format</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="dateFormatEntry">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Preferred date format. Commonly used fields are</p><p>d (day of month)</p><p>ddd (abbr. day name)</p><p>M (month number)</p><p>MMM (abbr. month name)</p><p>yy/yyyy (2/4 digit year)</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="dateFormatSystemDefault">
|
||||
<property name="text">
|
||||
|
|
@ -114,6 +107,16 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="dateFormatEntry">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Preferred date format. Commonly used fields are</p><p>d (day of month)</p><p>ddd (abbr. day name)</p><p>M (month number)</p><p>MMM (abbr. month name)</p><p>yy/yyyy (2/4 digit year)</p></body></html></string>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -208,22 +211,6 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>dateFormatSystemDefault</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>dateFormatEntry</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>79</x>
|
||||
<y>132</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>264</x>
|
||||
<y>132</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>timeFormatSystemDefault</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
|
|
@ -256,5 +243,21 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>dateFormatSystemDefault</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>dateFormatEntry</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>89</x>
|
||||
<y>103</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>273</x>
|
||||
<y>103</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue