From 45e9bd12a57465053e5460ede743f5c7604dae55 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 5 Mar 2021 17:51:19 +0100 Subject: [PATCH] hightlight "new profile" link --- owrx/controllers/settings/sdr.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/owrx/controllers/settings/sdr.py b/owrx/controllers/settings/sdr.py index 4966c41..a61a1e8 100644 --- a/owrx/controllers/settings/sdr.py +++ b/owrx/controllers/settings/sdr.py @@ -126,13 +126,14 @@ class SdrFormController(SettingsFormController, metaclass=ABCMeta): {profile_tabs} """.format( device_link="{}settings/sdr/{}".format(self.get_document_root(), quote(self.device_id)), device_name=self.device["name"], device_active="active" if self.isDeviceActive() else "", + new_profile_active="active" if self.isNewProfileActive() else "", new_profile_link="{}settings/sdr/{}/newprofile".format(self.get_document_root(), quote(self.device_id)), profile_tabs="".join( """ @@ -156,6 +157,9 @@ class SdrFormController(SettingsFormController, metaclass=ABCMeta): def isProfileActive(self, profile_id) -> bool: return False + def isNewProfileActive(self) -> bool: + return False + def store(self): # need to overwrite the existing key in the config since the layering won't capture the changes otherwise config = Config.get() @@ -383,6 +387,9 @@ class NewProfileController(SdrFormController): def getTitle(self): return "New profile" + def isNewProfileActive(self) -> bool: + return True + def store(self): if self.stack["id"] in self.device["profiles"]: raise ValueError("Profile {} already exists!".format(self.stack["id"]))