diff --git a/package.nw/GridTracker.html b/package.nw/GridTracker.html
index 21c31783..d00d9f08 100644
--- a/package.nw/GridTracker.html
+++ b/package.nw/GridTracker.html
@@ -695,9 +695,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/package.nw/lib/adif.js b/package.nw/lib/adif.js
index 5d2515aa..7c9b2ea9 100644
--- a/package.nw/lib/adif.js
+++ b/package.nw/lib/adif.js
@@ -1827,7 +1827,7 @@ function sendToLogger(ADIF)
record.GRIDSQUARE = g_liveCallsigns[localHash].grid.substr(0, 4);
}
- if (g_potaEnabled == 1 && localHash in g_liveCallsigns && g_liveCallsigns[localHash].pota.length > 0)
+ if (g_appSettings.potaEnabled == 1 && localHash in g_liveCallsigns && g_liveCallsigns[localHash].pota.length > 0)
{
let pota = g_liveCallsigns[localHash].pota[0];
if (pota != "?-????")
@@ -1948,7 +1948,7 @@ function finishSendingReport(record, localMode)
{
g_lastReport = report;
- if (g_potaEnabled == 1 && "POTA" in record)
+ if (g_appSettings.potaEnabled == 1 && "POTA" in record)
{
reportPotaQSO(record);
addLastTraffic("Spotted to POTA");
diff --git a/package.nw/lib/defaults.js b/package.nw/lib/defaults.js
index 0d3e1a65..57a0ba7e 100644
--- a/package.nw/lib/defaults.js
+++ b/package.nw/lib/defaults.js
@@ -75,7 +75,9 @@ var def_appSettings = {
myRawFreq: "",
myRawGrid: "",
pathWidthWeight: 1.0,
- potaEnabled: 0,
+ potaEnabled: 1,
+ potaShowMenu: true,
+ potaMapEnabled: false,
pushPinMode: false,
qrzPathWidthWeight: 1.2,
sixWideMode: 0,
diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js
index 592c446d..878788f9 100644
--- a/package.nw/lib/gt.js
+++ b/package.nw/lib/gt.js
@@ -180,7 +180,6 @@ var g_flightDuration = 30;
var g_crScript = g_appSettings.crScript;
var g_spotsEnabled = g_appSettings.spotsEnabled;
-var g_potaEnabled = g_appSettings.potaEnabled;
var g_heatEnabled = g_appSettings.heatEnabled;
var g_myLat = g_mapSettings.latitude;
@@ -7165,7 +7164,7 @@ function handleWsjtxDecode(newMessage)
}
}
- if (g_potaEnabled == 1)
+ if (g_appSettings.potaEnabled == 1)
{
if (callsign.DEcall in g_pota.callSpots || callsign.DEcall in g_pota.callSchedule)
{
diff --git a/package.nw/lib/pota.js b/package.nw/lib/pota.js
index f3b7cc01..98015715 100644
--- a/package.nw/lib/pota.js
+++ b/package.nw/lib/pota.js
@@ -62,36 +62,62 @@ var g_gtParkIconInactive = new ol.style.Icon({
function initPota()
{
- potaImg.style.filter = g_potaEnabled == 1 ? "" : "grayscale(1)";
+ potaEnabled.checked = (g_appSettings.potaEnabled == 1);
+ potaMenu.checked = g_appSettings.potaShowMenu;
+ potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu) ? "" : "none";
+ potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
- getPotaParks();
-}
-
-function togglePota()
-{
- g_potaEnabled ^= 1;
- g_appSettings.potaEnabled = g_potaEnabled;
- potaImg.style.filter = g_potaEnabled == 1 ? "" : "grayscale(1)";
-
- saveAppSettings();
-
- if (g_potaEnabled == 1)
+ g_layerSources.pota.clear();
+ g_pota.mapParks = {};
+
+ if (g_appSettings.potaEnabled == 1)
{
getPotaParks();
}
- else
+}
+
+function changePotaEnable()
+{
+ g_appSettings.potaEnabled = (potaEnabled.checked == true) ? 1 : 0;
+ potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu) ? "" : "none";
+ if (!g_appSettings.potaEnabled)
{
g_layerSources.pota.clear();
- g_pota.mapParks = {};
}
+ else
+ {
+ getPotaParks();
+ }
+
+ saveAppSettings();
goProcessRoster();
}
+function changePotaMenu()
+{
+ g_appSettings.potaShowMenu = potaMenu.checked;
+
+ potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu) ? "" : "none";
+ potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
+
+ saveAppSettings();
+}
+
+function togglePotaMap()
+{
+ g_appSettings.potaMapEnabled = !g_appSettings.potaMapEnabled;
+ potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
+
+ saveAppSettings();
+
+ redrawParks();
+}
+
function redrawParks()
{
g_layerSources.pota.clear();
- if (g_potaEnabled == 1)
+ if (g_appSettings.potaEnabled == 1 && g_appSettings.potaMapEnabled)
{
g_pota.mapParks = {};
makeParkFeatures();
@@ -164,7 +190,10 @@ function potaSpotFromDecode(callObj)
}
// may or may not be on screen, so try
- addParkSpotFeature(park, g_pota.parkSpots[park][callObj.DEcall]);
+ if (g_appSettings.potaMapEnabled)
+ {
+ addParkSpotFeature(park, g_pota.parkSpots[park][callObj.DEcall]);
+ }
let hash = park + callObj.DEcall;
if (!(hash in g_pota.rbnReportTimes) || Date.now() > g_pota.rbnReportTimes[hash])
@@ -290,7 +319,7 @@ function addParkSpotFeature(park, report)
function processPotaParks(buffer)
{
- if (g_potaEnabled == 1)
+ if (g_appSettings.potaEnabled == 1)
{
try
{
@@ -332,7 +361,7 @@ function getPotaParks()
g_pota.spotsTimeout = null;
}
- if (g_mapSettings.offlineMode == false && g_potaEnabled == 1)
+ if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
{
getBuffer(
"https://storage.googleapis.com/gt_app/pota.json?cb=" + Date.now(),
@@ -380,7 +409,7 @@ function uniqueArrayFromArray(input)
function processPotaSpots(buffer)
{
- if (g_potaEnabled == 1)
+ if (g_appSettings.potaEnabled == 1)
{
try
{
@@ -439,7 +468,7 @@ function getPotaSpots()
g_pota.spotsTimeout = null;
}
- if (g_mapSettings.offlineMode == false && g_potaEnabled == 1)
+ if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
{
getBuffer(
"https://api.pota.app/spot/activator",
@@ -455,7 +484,7 @@ function getPotaSpots()
function processPotaSchedule(buffer)
{
- if (g_potaEnabled == 1)
+ if (g_appSettings.potaEnabled == 1)
{
try
{
@@ -513,7 +542,7 @@ function getPotaSchedule()
g_pota.scheduleTimeout = null;
}
- if (g_mapSettings.offlineMode == false && g_potaEnabled == 1)
+ if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
{
getBuffer(
"https://api.pota.app/activation",
diff --git a/package.nw/lib/roster.js b/package.nw/lib/roster.js
index 9092573e..236e16e5 100644
--- a/package.nw/lib/roster.js
+++ b/package.nw/lib/roster.js
@@ -68,7 +68,7 @@ var g_defaultSettings = {
callsign: "all",
hunting: "dxcc",
huntNeed: "confirmed",
- requireGrid: true,
+ requireGrid: false,
wantMaxDT: false,
wantMinDB: false,
wantMinFreq: false,
@@ -119,9 +119,9 @@ var g_defaultSettings = {
DXCC: true,
Flag: true,
State: true,
- County: true,
+ County: false,
POTA: false,
- Cont: true,
+ Cont: false,
dB: true,
Freq: false,
DT: false,
@@ -129,7 +129,7 @@ var g_defaultSettings = {
Azim: true,
CQz: false,
ITUz: false,
- PX: true,
+ PX: false,
LoTW: false,
eQSL: false,
OQRS: false,
@@ -145,7 +145,7 @@ var g_defaultSettings = {
settingProfiles: false,
sortColumn: "Age",
- sortReverse: false
+ sortReverse: true
};
const LOGBOOK_LIVE_BAND_LIVE_MODE = "0";
diff --git a/package.nw/lib/roster/processRosterHunting.js b/package.nw/lib/roster/processRosterHunting.js
index 09a5d143..c42d21d8 100644
--- a/package.nw/lib/roster/processRosterHunting.js
+++ b/package.nw/lib/roster/processRosterHunting.js
@@ -15,7 +15,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
const currentYear = new Date().getFullYear();
const currentYearSuffix = `’${currentYear - 2000}`;
- const potaEnabled = (window.opener.g_potaEnabled === 1);
+ const potaEnabled = (window.opener.g_appSettings.potaEnabled === 1);
// TODO: Hunting results might be used to filter, based on the "Callsigns: Only Wanted" option,
// so maybe we can move this loop first, and add a check to the filtering loop?
diff --git a/package.nw/lib/roster/renderRoster.js b/package.nw/lib/roster/renderRoster.js
index 2f5ea9e1..5636d1c8 100644
--- a/package.nw/lib/roster/renderRoster.js
+++ b/package.nw/lib/roster/renderRoster.js
@@ -33,7 +33,7 @@ function renderRoster(callRoster, rosterSettings)
columnOverrides.LoTW = false;
}
- if (window.opener.g_potaEnabled === 1)
+ if (window.opener.g_appSettings.potaEnabled === 1)
{
huntingMatrixPotaDiv.style.display = "";
}