@@ -348,6 +348,9 @@ private void setupIrpDatabase() throws IOException, IrpParseException, SAXExcept
348
348
349
349
irpDatabase = new IrpDatabase(configFiles);
350
350
Command.setIrpDatabase(irpDatabase);
351
+ properties.addSecondaryIrpProtocolsPathChangeListener((String name1, Object oldValue, Object newValue) -> {
352
+ secondaryRemoveMenuItem.setEnabled(!((String) newValue).isEmpty());
353
+ });
351
354
}
352
355
353
356
private void setupImporters() throws MalformedURLException, IrpParseException {
@@ -2610,6 +2613,7 @@ private void initComponents() {
2610
2613
jSeparator45 = new javax.swing.JPopupMenu.Separator();
2611
2614
secondaryIrpProtocolsSelectMenuItem = new javax.swing.JMenuItem();
2612
2615
secondaryIrpProtocolsEditMenuItem = new javax.swing.JMenuItem();
2616
+ secondaryRemoveMenuItem = new javax.swing.JMenuItem();
2613
2617
jSeparator46 = new javax.swing.JPopupMenu.Separator();
2614
2618
irpProtocolsReloadMenuItem = new javax.swing.JMenuItem();
2615
2619
exportFormatsMenu = new javax.swing.JMenu();
@@ -6545,7 +6549,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
6545
6549
irpProtocolsIniMenu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/apps/database.png"))); // NOI18N
6546
6550
irpProtocolsIniMenu.setText("IRP protocol database");
6547
6551
6548
- irpProtocolsSelectMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/actions/fileopen .png"))); // NOI18N
6552
+ irpProtocolsSelectMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/apps/database .png"))); // NOI18N
6549
6553
irpProtocolsSelectMenuItem.setText("Select...");
6550
6554
irpProtocolsSelectMenuItem.setToolTipText("Select IrpProtocols.xml to use.");
6551
6555
irpProtocolsSelectMenuItem.addActionListener(new java.awt.event.ActionListener() {
@@ -6566,7 +6570,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
6566
6570
irpProtocolsIniMenu.add(irpProtocolsEditMenuItem);
6567
6571
irpProtocolsIniMenu.add(jSeparator45);
6568
6572
6569
- secondaryIrpProtocolsSelectMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/actions/fileopen .png"))); // NOI18N
6573
+ secondaryIrpProtocolsSelectMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/actions/db_add .png"))); // NOI18N
6570
6574
secondaryIrpProtocolsSelectMenuItem.setText("Select secondary...");
6571
6575
secondaryIrpProtocolsSelectMenuItem.setToolTipText("Select a private version of IrpProtocols. to extend the standard one.");
6572
6576
secondaryIrpProtocolsSelectMenuItem.addActionListener(new java.awt.event.ActionListener() {
@@ -6585,10 +6589,21 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
6585
6589
}
6586
6590
});
6587
6591
irpProtocolsIniMenu.add(secondaryIrpProtocolsEditMenuItem);
6592
+
6593
+ secondaryRemoveMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/actions/db_remove.png"))); // NOI18N
6594
+ secondaryRemoveMenuItem.setText("Remove secondary");
6595
+ secondaryRemoveMenuItem.setToolTipText("Remove the secondary data base. Does not delete any disk files.");
6596
+ secondaryRemoveMenuItem.setEnabled(!properties.getSecondaryIrpProtocolsPath().isEmpty());
6597
+ secondaryRemoveMenuItem.addActionListener(new java.awt.event.ActionListener() {
6598
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
6599
+ secondaryRemoveMenuItemActionPerformed(evt);
6600
+ }
6601
+ });
6602
+ irpProtocolsIniMenu.add(secondaryRemoveMenuItem);
6588
6603
irpProtocolsIniMenu.add(jSeparator46);
6589
6604
6590
6605
irpProtocolsReloadMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Crystal-Clear/22x22/actions/reload.png"))); // NOI18N
6591
- irpProtocolsReloadMenuItem.setText("Reload");
6606
+ irpProtocolsReloadMenuItem.setText("Reload IRP data base ");
6592
6607
irpProtocolsReloadMenuItem.addActionListener(new java.awt.event.ActionListener() {
6593
6608
public void actionPerformed(java.awt.event.ActionEvent evt) {
6594
6609
irpProtocolsReloadMenuItemActionPerformed(evt);
@@ -9162,9 +9177,10 @@ private void secondaryIrpProtocolsSelectMenuItemActionPerformed(java.awt.event.A
9162
9177
return;
9163
9178
if (f.toString().equals("/dev/null") || f.getName().equalsIgnoreCase("NULL:")) {
9164
9179
properties.setSecondaryIrpProtocolsPath("");
9165
- guiUtils.message("secondary IrpProtocol was removed.");
9180
+ guiUtils.message("Secondary IrpProtocol file removed.");
9166
9181
} else {
9167
9182
properties.setSecondaryIrpProtocolsPath(f.getAbsolutePath());
9183
+ guiUtils.message("Secondary IrpProtocol file set to " + f.getAbsolutePath() + ".");
9168
9184
}
9169
9185
try {
9170
9186
setupIrpDatabase();
@@ -9229,6 +9245,11 @@ private void ControlTowerBrowserMenuItemActionPerformed(java.awt.event.ActionEve
9229
9245
HarcletFrame.newHarcletFrame(this, new ControlTowerBrowser(), false, lookAndFeelManager.getCurrentLAFClassName());
9230
9246
}//GEN-LAST:event_ControlTowerBrowserMenuItemActionPerformed
9231
9247
9248
+ private void secondaryRemoveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_secondaryRemoveMenuItemActionPerformed
9249
+ properties.setSecondaryIrpProtocolsPath("");
9250
+ guiUtils.message("Secondary IrpProtocol file removed.");
9251
+ }//GEN-LAST:event_secondaryRemoveMenuItemActionPerformed
9252
+
9232
9253
private void tableKeyReleased(JTable table, KeyEvent evt) {
9233
9254
if (evt.getModifiersEx() == java.awt.event.InputEvent.CTRL_DOWN_MASK
9234
9255
&& evt.getExtendedKeyCode() == java.awt.event.KeyEvent.VK_F ) {
@@ -9692,6 +9713,7 @@ private void tableKeyReleased(JTable table, KeyEvent evt) {
9692
9713
private javax.swing.JMenuItem secondaryExportFormatsSelectMenuItem;
9693
9714
private javax.swing.JMenuItem secondaryIrpProtocolsEditMenuItem;
9694
9715
private javax.swing.JMenuItem secondaryIrpProtocolsSelectMenuItem;
9716
+ private javax.swing.JMenuItem secondaryRemoveMenuItem;
9695
9717
private javax.swing.JMenuItem sendMenuItem;
9696
9718
private javax.swing.JButton sendingCommandFusionHelpButton;
9697
9719
private javax.swing.JButton sendingDevLircHardwareHelpButton;
0 commit comments