Fix to RMIR for direct GUI access to rmaster.err
Posted: Thu May 15, 2025 10:20 am
The enclosed fix adds an entry "Advanced -> Display the errors file rmaster.err" to the menu bar of RMIR. When invoked, it opens a popup window showing the current content of the errors file, per default rmaster.err, but can also be renamed using the -errors command line option.
On request, I will be happy to check it in.
On request, I will be happy to check it in.
Code: Select all
Index: src/main/java/com/hifiremote/jp1/RMIRSetup.java
===================================================================
--- src/main/java/com/hifiremote/jp1/RMIRSetup.java (revision 2187)
+++ src/main/java/com/hifiremote/jp1/RMIRSetup.java (working copy)
@@ -170,6 +170,7 @@
private static JMenuItem extractSSItem = null;
private static JMenuItem analyzeMAXQprotocols = null;
private static JMenuItem importIctAsLearned = null;
+ private static JMenuItem openRmasterErr = null;
private static String scaling = null;
public enum WavOp { NEW, MERGE, SAVE, PLAY };
@@ -3529,6 +3530,16 @@
importIctAsLearned.addActionListener( this );
menu.add( importIctAsLearned );
+ if ( desktopUsable() )
+ {
+ menu.addSeparator();
+ openRmasterErr = new JMenuItem( "Display the errors file rmaster.err", KeyEvent.VK_E );
+ openRmasterErr.setToolTipText( JTableX.getHtmlToolTip(
+ "Opens a popup window showing the current content of the error file, in general <code>rmaster.err</code>.<br><b>Note:</b> will not update!" ) );
+ openRmasterErr.addActionListener( this );
+ menu.add( openRmasterErr );
+ }
+
menu = new JMenu( "Help" );
menu.setMnemonic( KeyEvent.VK_H );
menuBar.add( menu );
@@ -6661,6 +6672,10 @@
{
DeviceUpgradeConverter.importIctAsLearned( this );
}
+ else if ( source == openRmasterErr )
+ {
+ JP1Frame.browse(RemoteMaster.getErrorsFile().toURI());
+ }
else if ( source == aboutItem )
{
StringBuilder sb = new StringBuilder( 1000 );
Index: src/main/java/com/hifiremote/jp1/RemoteMaster.java
===================================================================
--- src/main/java/com/hifiremote/jp1/RemoteMaster.java (revision 2187)
+++ src/main/java/com/hifiremote/jp1/RemoteMaster.java (working copy)
@@ -33,6 +33,7 @@
{
private static File workDir = null;
private static PropertyFile properties = null;
+ private static File errorsFile = null;
private static JCommander argumentParser;
private static File addonDir = null;
private static String irpTransmogrifierCommitId = null;
@@ -185,6 +186,11 @@
{
return "v" + version + buildSeparator + buildVer;
}
+
+ public static File getErrorsFile()
+ {
+ return errorsFile;
+ }
public final static String version = "3.2";
/*
@@ -340,7 +346,7 @@
rmduSys = new File( workDir, "RMDU.sys" );
rmpbSys = new File( workDir, "RMPB.sys" );
- File errorsFile = commandLineArgs.errorsFile;
+ errorsFile = commandLineArgs.errorsFile;
if ( errorsFile == null )
errorsFile = getWritableFile( workDir, "rmaster.err" );