Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New plugin: Style editor #133

Merged
merged 10 commits into from
Apr 21, 2017
Merged

New plugin: Style editor #133

merged 10 commits into from
Apr 21, 2017

Conversation

vidartf
Copy link
Member

@vidartf vidartf commented Apr 16, 2017

Adds a style editor (Settings -> Edit style).

@thomasaarholt
Copy link
Contributor

I checked this out on Windows and it worked fine, but on Mac I couldn't see the plugin at first. I tried unchecking it in the plugin manager and then rechecking it, but it won't recheck. The terminal shows this error:

DEBUG:hyperspyui:Initializing plugin: <class 'hyperspyui.plugins.stylesheet.StylePlugin'>
Traceback (most recent call last):
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/pluginmanager.py", line 238, in load
    p = self._load_if_enabled(plugin_type)
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/pluginmanager.py", line 230, in _load_if_enabled
    p = p_type(self.ui)
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/plugins/stylesheet.py", line 49, in __init__
    self.apply_styles()
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/plugins/stylesheet.py", line 64, in apply_styles
    QApplication.instance().setStyleSheet(self.settings['_style'])
TypeError: setStyleSheet(self, object): argument 1 has unexpected type 'QPyNullVariant'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/widgets/pluginmanagerwidget.py", line 102, in setData
    self.plugin_manager.enable_plugin(name, enabled)
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/pluginmanager.py", line 100, in enable_plugin
    self.load(ptype)
  File "/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/pluginmanager.py", line 248, in load
    self.warn(sys._getframe().f_code.co_name, p.name)
UnboundLocalError: local variable 'p' referenced before assignment

@vidartf
Copy link
Member Author

vidartf commented Apr 18, 2017

I added a commit that should (hopefully) fix that issue.

@vidartf
Copy link
Member Author

vidartf commented Apr 20, 2017

Any luck? :)

@thomasaarholt
Copy link
Contributor

thomasaarholt commented Apr 20, 2017 via email

@thomasaarholt
Copy link
Contributor

thomasaarholt commented Apr 20, 2017

Styles is now shown, but your suggested style didn't do anything. Can you give me a style that should definitely work, just to test that the style editor actually works?

It definitely works, see comments over at #128.

@thomasaarholt
Copy link
Contributor

Style editor definitely working on Mac, tested with
QDockWidget { color: red; }

@vidartf
Copy link
Member Author

vidartf commented Apr 21, 2017

Okies, merging this then.

@vidartf vidartf merged commit 75120ef into hyperspy:master Apr 21, 2017
@vidartf vidartf deleted the style-editor branch April 21, 2017 08:06
@ericpre ericpre added this to the 1.1.0 milestone Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants