-
Notifications
You must be signed in to change notification settings - Fork 39
Default 24 hour notation for search criteria #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,7 @@ public class EventBrowser extends javax.swing.JPanel { | |||||||
| private EventBrowserAdvancedFilter advancedSearchPopup; | ||||||||
| private Map<Integer, String> userMapById = new LinkedHashMap<Integer, String>(); | ||||||||
| private SwingWorker<Void, Void> worker; | ||||||||
| private boolean use24hourNotation = true; | ||||||||
|
|
||||||||
| /** | ||||||||
| * Constructs the new event browser and sets up its default information/layout. | ||||||||
|
|
@@ -138,6 +139,7 @@ public void mouseReleased(java.awt.event.MouseEvent evt) { | |||||||
| public void propertyChange(PropertyChangeEvent arg0) { | ||||||||
| allDayCheckBox.setEnabled(startDatePicker.getDate() != null || endDatePicker.getDate() != null); | ||||||||
| startTimePicker.setEnabled(startDatePicker.getDate() != null && !allDayCheckBox.isSelected()); | ||||||||
| hourNotation24.setEnabled(startDatePicker.getDate() != null || endDatePicker.getDate() != null); | ||||||||
| } | ||||||||
| }); | ||||||||
|
|
||||||||
|
|
@@ -146,6 +148,7 @@ public void propertyChange(PropertyChangeEvent arg0) { | |||||||
| public void propertyChange(PropertyChangeEvent arg0) { | ||||||||
| allDayCheckBox.setEnabled(startDatePicker.getDate() != null || endDatePicker.getDate() != null); | ||||||||
| endTimePicker.setEnabled(endDatePicker.getDate() != null && !allDayCheckBox.isSelected()); | ||||||||
| hourNotation24.setEnabled(startDatePicker.getDate() != null || endDatePicker.getDate() != null); | ||||||||
| } | ||||||||
| }); | ||||||||
|
|
||||||||
|
|
@@ -207,7 +210,7 @@ public void loadNew(String eventNameFilter) { | |||||||
| } | ||||||||
|
|
||||||||
| private Calendar getCalendar(MirthDatePicker datePicker, MirthTimePicker timePicker) throws ParseException { | ||||||||
| DateFormatter timeFormatter = new DateFormatter(new SimpleDateFormat("hh:mm aa")); | ||||||||
| DateFormatter timeFormatter = new DateFormatter(new SimpleDateFormat(use24hourNotation ? "HH:mm" : "hh:mm aa")); | ||||||||
| Date date = datePicker.getDate(); | ||||||||
| String time = timePicker.getDate(); | ||||||||
|
|
||||||||
|
|
@@ -582,6 +585,7 @@ public void resetSearchCriteria() { | |||||||
| endDatePicker.setDate(null); | ||||||||
| nameField.setText(""); | ||||||||
| allDayCheckBox.setSelected(false); | ||||||||
| hourNotation24.setSelected(true); | ||||||||
| levelBoxInformation.setSelected(false); | ||||||||
| levelBoxWarning.setSelected(false); | ||||||||
| levelBoxError.setSelected(false); | ||||||||
|
|
@@ -892,6 +896,7 @@ private void initComponents() { | |||||||
| eventAttributesTable = null; | ||||||||
| resetButton = new javax.swing.JButton(); | ||||||||
| allDayCheckBox = new com.mirth.connect.client.ui.components.MirthCheckBox(); | ||||||||
| hourNotation24 = new com.mirth.connect.client.ui.components.MirthCheckBox(); | ||||||||
| lastSearchCriteriaPane = new javax.swing.JScrollPane(); | ||||||||
| lastSearchCriteria = new javax.swing.JTextArea(); | ||||||||
| nextPageButton = new javax.swing.JButton(); | ||||||||
|
|
@@ -909,8 +914,8 @@ private void initComponents() { | |||||||
| endDatePicker = new com.mirth.connect.client.ui.components.MirthDatePicker(); | ||||||||
| startDatePicker = new com.mirth.connect.client.ui.components.MirthDatePicker(); | ||||||||
| nameField = new javax.swing.JTextField(); | ||||||||
| startTimePicker = new com.mirth.connect.client.ui.components.MirthTimePicker(); | ||||||||
| endTimePicker = new com.mirth.connect.client.ui.components.MirthTimePicker(); | ||||||||
| startTimePicker = new com.mirth.connect.client.ui.components.MirthTimePicker((use24hourNotation ? "HH:mm" : "hh:mm aa"), Calendar.MINUTE); | ||||||||
| endTimePicker = new com.mirth.connect.client.ui.components.MirthTimePicker((use24hourNotation ? "HH:mm" : "hh:mm aa"), Calendar.MINUTE); | ||||||||
| filterButton = new javax.swing.JButton(); | ||||||||
| advSearchButton = new javax.swing.JButton(); | ||||||||
| levelBoxInformation = new com.mirth.connect.client.ui.components.MirthCheckBox(); | ||||||||
|
|
@@ -969,6 +974,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { | |||||||
| } | ||||||||
| }); | ||||||||
|
|
||||||||
| hourNotation24.setSelected(use24hourNotation); | ||||||||
| hourNotation24.setBackground(new java.awt.Color(255, 255, 255)); | ||||||||
| hourNotation24.setText("24 hour"); | ||||||||
| hourNotation24.setToolTipText("Use 24 hour notation"); | ||||||||
| hourNotation24.setFont(new java.awt.Font("Lucida Grande", 0, 11)); // NOI18N | ||||||||
| hourNotation24.addItemListener(new java.awt.event.ItemListener() { | ||||||||
|
||||||||
| hourNotation24.addItemListener(new java.awt.event.ItemListener() { | |
| hourNotation24.addItemListener(new java.awt.event.ItemListener() { | |
| @Override |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -838,6 +838,7 @@ | |||||||
| <EmptySpace max="-2" attributes="0"/> | ||||||||
| <Group type="103" groupAlignment="0" attributes="0"> | ||||||||
| <Component id="allDayCheckBox" min="-2" max="-2" attributes="0"/> | ||||||||
| <Component id="hourNotation24" min="-2" max="-2" attributes="0"/> | ||||||||
| <Component id="filterButton" alignment="0" min="-2" pref="63" max="-2" attributes="0"/> | ||||||||
| <Component id="regexTextSearchCheckBox" min="-2" max="-2" attributes="0"/> | ||||||||
| </Group> | ||||||||
|
|
@@ -954,7 +955,10 @@ | |||||||
| <Component id="allDayCheckBox" alignment="3" min="-2" max="-2" attributes="0"/> | ||||||||
| </Group> | ||||||||
| <EmptySpace max="-2" attributes="0"/> | ||||||||
| <Component id="statusBoxTransformed" min="-2" pref="16" max="-2" attributes="0"/> | ||||||||
| <Group type="103" groupAlignment="3" attributes="0"> | ||||||||
| <Component id="statusBoxTransformed" min="-2" pref="16" max="-2" attributes="0"/> | ||||||||
| <Component id="hourNotation24" alignment="3" min="-2" max="-2" attributes="0"/> | ||||||||
| </Group> | ||||||||
| <EmptySpace max="-2" attributes="0"/> | ||||||||
| <Component id="statusBoxFiltered" pref="16" max="-2" attributes="0"/> | ||||||||
| <EmptySpace max="-2" attributes="0"/> | ||||||||
|
|
@@ -1237,6 +1241,20 @@ | |||||||
| <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="allDayCheckBoxActionPerformed"/> | ||||||||
| </Events> | ||||||||
| </Component> | ||||||||
| <Component class="com.mirth.connect.client.ui.components.MirthCheckBox" name="hourNotation24"> | ||||||||
| <Properties> | ||||||||
| <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> | ||||||||
| <Color blue="ff" green="ff" red="ff" type="rgb"/> | ||||||||
| </Property> | ||||||||
| <Property name="text" type="java.lang.String" value="24 hour"/> | ||||||||
| <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> | ||||||||
| <Font name="Lucida Grande" size="11" style="0"/> | ||||||||
| </Property> | ||||||||
|
||||||||
| </Property> | |
| </Property> | |
| <Property name="toolTipText" type="java.lang.String" value="Use 24 hour notation"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
hourNotation24checkbox is missing atoolTipTextproperty in the .form file. The Java code sets it at line 980, but it should also be defined here for consistency with the design pattern used for other checkboxes in the form.Suggestion: Add a
toolTipTextproperty with value "Use 24 hour notation" to match the Java code.