mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Resolves #96
Adds capability to disable spectral display. Adds right-click context menu items to disable display and/or reenable display by selecting another tuner. Adds view menu items to disable spectral display or show a tuner. Persists spectral display enabled state across application run sessions.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package io.github.dsheirer.source.tuner;
|
||||
|
||||
import io.github.dsheirer.properties.SystemProperties;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.source.Source;
|
||||
import io.github.dsheirer.source.SourceException;
|
||||
@@ -9,6 +10,7 @@ import io.github.dsheirer.source.tuner.channel.TunerChannel;
|
||||
import io.github.dsheirer.source.tuner.channel.TunerChannelSource;
|
||||
import io.github.dsheirer.source.tuner.configuration.TunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel;
|
||||
import io.github.dsheirer.spectrum.SpectralDisplayPanel;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -177,10 +179,16 @@ public class TunerModel extends AbstractTableModel implements Listener<TunerEven
|
||||
*/
|
||||
public void requestFirstTunerDisplay()
|
||||
{
|
||||
if(mTuners.size() > 0)
|
||||
SystemProperties properties = SystemProperties.getInstance();
|
||||
boolean enabled = properties.get(SpectralDisplayPanel.SPECTRAL_DISPLAY_ENABLED, true);
|
||||
|
||||
if(enabled && mTuners.size() > 0)
|
||||
{
|
||||
broadcast(new TunerEvent(mTuners.get(0),
|
||||
Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
|
||||
broadcast(new TunerEvent(mTuners.get(0), Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcast(new TunerEvent(null, Event.CLEAR_MAIN_SPECTRAL_DISPLAY));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user