diff --git a/htdocs/lib/BookmarkBar.js b/htdocs/lib/BookmarkBar.js
index cb3e3a73..6237e2e5 100644
--- a/htdocs/lib/BookmarkBar.js
+++ b/htdocs/lib/BookmarkBar.js
@@ -1,5 +1,6 @@
function BookmarkBar() {
var me = this;
+ me.toScan = ['lsb', 'usb', 'usbd', 'cw', 'am', 'sam', 'nfm'];
me.localBookmarks = new BookmarkLocalStorage();
me.$container = $("#openwebrx-bookmarks-container");
me.bookmarks = {};
@@ -107,10 +108,12 @@ BookmarkBar.prototype.render = function(){
BookmarkBar.prototype.showEditDialog = function(bookmark) {
if (!bookmark) {
+ var mode = this.getDemodulator().get_secondary_demod() || this.getDemodulator().get_modulation();
bookmark = {
name: "",
frequency: center_freq + this.getDemodulator().get_offset_frequency(),
- modulation: this.getDemodulator().get_secondary_demod() || this.getDemodulator().get_modulation()
+ modulation: mode,
+ scannable : this.toScan.indexOf(mode) >= 0
}
}
this.$dialog.bookmarkDialog().setValues(bookmark);
diff --git a/htdocs/lib/Scanner.js b/htdocs/lib/Scanner.js
index 02a6e273..e6b5c0f2 100644
--- a/htdocs/lib/Scanner.js
+++ b/htdocs/lib/Scanner.js
@@ -1,5 +1,5 @@
function Scanner(bookmarkBar, msec) {
- this.modes = ['lsb', 'usb', 'cw', 'am', 'sam', 'nfm'];
+ this.modes = ['lsb', 'usb', 'usbd', 'cw', 'am', 'sam', 'nfm'];
this.bbar = bookmarkBar;
this.bookmarks = null;
this.msec = msec;
diff --git a/htdocs/lib/settings/BookmarkTable.js b/htdocs/lib/settings/BookmarkTable.js
index ab0c9056..5a724630 100644
--- a/htdocs/lib/settings/BookmarkTable.js
+++ b/htdocs/lib/settings/BookmarkTable.js
@@ -198,12 +198,35 @@ DescriptionEditor.prototype.getInputHtml = function() {
return '';
};
+function ScannableEditor(table) {
+ Editor.call(this, table);
+}
+
+ScannableEditor.prototype = new Editor();
+
+ScannableEditor.prototype.getInputHtml = function() {
+ return '';
+};
+
+ScannableEditor.prototype.getValue = function() {
+ return this.input.prop('checked');
+};
+
+ScannableEditor.prototype.setValue = function(value) {
+ this.input.prop('checked', value);
+};
+
+ScannableEditor.prototype.getHtml = function() {
+ return this.getValue()? '✓' : '';
+};
+
$.fn.bookmarktable = function() {
var editors = {
name: NameEditor,
frequency: FrequencyEditor,
modulation: ModulationEditor,
- description: DescriptionEditor
+ description: DescriptionEditor,
+ scannable: ScannableEditor
};
$.each(this, function(){
@@ -400,6 +423,7 @@ $.fn.bookmarktable = function() {
'
' + renderFrequency(bookmark.frequency) +' | ' +
'' + modulation_name + ' | ' +
'' + bookmark.description + ' | ' +
+ '' + (bookmark.scannable? '✓':'') + ' | ' +
'' +
'' +
' | ' +
diff --git a/owrx/bookmarks.py b/owrx/bookmarks.py
index 2653294f..80130e66 100644
--- a/owrx/bookmarks.py
+++ b/owrx/bookmarks.py
@@ -15,7 +15,7 @@ class Bookmark(object):
self.frequency = j["frequency"]
self.modulation = j["modulation"]
self.description = j["description"] if "description" in j else ""
- self.scannable = j["scan"] if "scannable" in j else True
+ self.scannable = j["scannable"] if "scannable" in j else True
self.srcFile = srcFile
def getName(self):
diff --git a/owrx/controllers/settings/bookmarks.py b/owrx/controllers/settings/bookmarks.py
index 41f69776..7602fe26 100644
--- a/owrx/controllers/settings/bookmarks.py
+++ b/owrx/controllers/settings/bookmarks.py
@@ -36,6 +36,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
Frequency |
Modulation |
Description |
+ Scan |
Actions |
{bookmarks}
@@ -65,12 +66,14 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
return "{num:g} {suffix}Hz".format(num=num, suffix=suffix)
mode = Modes.findByModulation(bookmark.getModulation())
+ scan = bookmark.isScannable()
return """
| {name} |
{rendered_frequency} |
{modulation_name} |
{description} |
+ {scannable_check} |
|
@@ -84,6 +87,8 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
modulation=bookmark.getModulation() if mode is None else mode.modulation,
modulation_name=bookmark.getModulation() if mode is None else mode.name,
description=bookmark.getDescription(),
+ scannable="true" if scan else "false",
+ scannable_check="✓" if scan else "",
)
def _findBookmark(self, bookmark_id):
@@ -101,7 +106,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
return
try:
data = json.loads(self.get_body().decode("utf-8"))
- for key in ["name", "frequency", "modulation", "description"]:
+ for key in ["name", "frequency", "modulation", "description", "scannable"]:
if key in data:
value = data[key]
if key == "frequency":
@@ -124,6 +129,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
"frequency": int(bookmark_data["frequency"]),
"modulation": bookmark_data["modulation"],
"description": bookmark_data["description"],
+ "scannable": bookmark_data["scannable"],
}
bookmark = Bookmark(data)
bookmarks.addBookmark(bookmark)