mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
#1190 Tuner management redesign. Updates all tuners with direct threaded support. Incorporates USB Hotplug support. Adds black/white listing of tuners. Updates all tuner editors to have a common look and feel. Changes location of tuner configuration file and changes format to JSON. (#1208)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* ******************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* *****************************************************************************
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.preference;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* ******************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* *****************************************************************************
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.preference.directory;
|
||||
@@ -41,6 +40,7 @@ public class DirectoryPreference extends Preference
|
||||
|
||||
private static final String DIRECTORY_APPLICATION_ROOT = "SDRTrunk";
|
||||
private static final String DIRECTORY_APPLICATION_LOG = "logs";
|
||||
private static final String DIRECTORY_CONFIGURATION = "configuration";
|
||||
private static final String DIRECTORY_EVENT_LOG = "event_logs";
|
||||
private static final String DIRECTORY_JMBE = "jmbe";
|
||||
private static final String DIRECTORY_PLAYLIST = "playlist";
|
||||
@@ -50,6 +50,7 @@ public class DirectoryPreference extends Preference
|
||||
|
||||
private static final String PREFERENCE_KEY_DIRECTORY_APPLICATION_ROOT = "directory.application.root";
|
||||
private static final String PREFERENCE_KEY_DIRECTORY_APPLICATION_LOGS = "directory.application.logs";
|
||||
private static final String PREFERENCE_KEY_DIRECTORY_CONFIGURATION = "directory.configuration";
|
||||
private static final String PREFERENCE_KEY_DIRECTORY_EVENT_LOGS = "directory.event.logs";
|
||||
private static final String PREFERENCE_KEY_DIRECTORY_JMBE = "directory.jmbe";
|
||||
private static final String PREFERENCE_KEY_DIRECTORY_PLAYLIST = "directory.playlist";
|
||||
@@ -59,6 +60,7 @@ public class DirectoryPreference extends Preference
|
||||
|
||||
private Path mDirectoryApplicationRoot;
|
||||
private Path mDirectoryApplicationLogs;
|
||||
private Path mDirectoryConfiguration;
|
||||
private Path mDirectoryEventLogs;
|
||||
private Path mDirectoryJmbe;
|
||||
private Path mDirectoryPlaylist;
|
||||
@@ -174,6 +176,40 @@ public class DirectoryPreference extends Preference
|
||||
notifyPreferenceUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
* Path to the folder for storing configuration files
|
||||
*/
|
||||
public Path getDirectoryConfiguration()
|
||||
{
|
||||
if(mDirectoryConfiguration == null)
|
||||
{
|
||||
mDirectoryConfiguration = getPath(PREFERENCE_KEY_DIRECTORY_CONFIGURATION, getDefaultConfigurationDirectory());
|
||||
createDirectory(mDirectoryConfiguration);
|
||||
}
|
||||
|
||||
return mDirectoryConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the path to the configuration files folder
|
||||
*/
|
||||
public void setDirectoryConfiguration(Path path)
|
||||
{
|
||||
mDirectoryConfiguration = path;
|
||||
mPreferences.put(PREFERENCE_KEY_DIRECTORY_CONFIGURATION, path.toString());
|
||||
notifyPreferenceUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a stored configuration directory preference so that the default path can be used again
|
||||
*/
|
||||
public void resetDirectoryConfiguration()
|
||||
{
|
||||
mPreferences.remove(PREFERENCE_KEY_DIRECTORY_CONFIGURATION);
|
||||
mDirectoryConfiguration = null;
|
||||
notifyPreferenceUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
* Path to the folder for storing event logs
|
||||
*/
|
||||
@@ -199,7 +235,7 @@ public class DirectoryPreference extends Preference
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a stored playlist directory preference so that the default path can be used again
|
||||
* Removes a stored event logs directory preference so that the default path can be used again
|
||||
*/
|
||||
public void resetDirectoryEventLogs()
|
||||
{
|
||||
@@ -394,6 +430,14 @@ public class DirectoryPreference extends Preference
|
||||
return getDirectoryApplicationRoot().resolve(DIRECTORY_APPLICATION_LOG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default configuration directory
|
||||
*/
|
||||
public Path getDefaultConfigurationDirectory()
|
||||
{
|
||||
return getDirectoryApplicationRoot().resolve(DIRECTORY_CONFIGURATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default event logs directory
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* ******************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2019 Dennis Sheirer
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* *****************************************************************************
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.preference.source;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* ******************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2019 Dennis Sheirer
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* *****************************************************************************
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.preference.source;
|
||||
|
||||
Reference in New Issue
Block a user