From 2e8d00f8b1282d9c65a6f1acf1b3f181b27e401a Mon Sep 17 00:00:00 2001 From: Ehsan Iran-Nejad Date: Sat, 27 Mar 2021 13:10:01 -0700 Subject: [PATCH] fixed an issue related to #1204 --- .../pyRevit.panel/Settings.smartbutton/script.py | 5 ++++- pyrevitlib/pyrevit/userconfig.py | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/Settings.smartbutton/script.py b/extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/Settings.smartbutton/script.py index 0b1b9d6bd..3d25c1d31 100644 --- a/extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/Settings.smartbutton/script.py +++ b/extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/Settings.smartbutton/script.py @@ -871,8 +871,11 @@ def _save_uiux(self): # output settings output.set_stylesheet(self.cur_stylesheet_tb.Text) - if self.cur_stylesheet_tb.Text != output.get_default_stylesheet(): + default_stylesheet = output.get_default_stylesheet() + if self.cur_stylesheet_tb.Text != default_stylesheet: user_config.output_stylesheet = self.cur_stylesheet_tb.Text + elif user_config.output_stylesheet != default_stylesheet: + user_config.output_stylesheet = None # pyrevit gui settings if self.loadtooltipex_cb.IsChecked != user_config.tooltip_debug_info \ and not self.reload_requested: diff --git a/pyrevitlib/pyrevit/userconfig.py b/pyrevitlib/pyrevit/userconfig.py index f253290bb..04bfddd6a 100644 --- a/pyrevitlib/pyrevit/userconfig.py +++ b/pyrevitlib/pyrevit/userconfig.py @@ -321,10 +321,13 @@ def output_stylesheet(self): @output_stylesheet.setter def output_stylesheet(self, stylesheet_filepath): - self.core.set_option( - CONSTS.ConfigsOutputStyleSheet, - value=stylesheet_filepath - ) + if stylesheet_filepath: + self.core.set_option( + CONSTS.ConfigsOutputStyleSheet, + value=stylesheet_filepath + ) + else: + self.core.remove_option(CONSTS.ConfigsOutputStyleSheet) @property def routes_host(self):