hyperspy/hyperspyUI

Another styles plugin issue

thomasaarholt opened this issue · 4 comments

Error shown during launch of hyperspyui.
I think this occured after I saved the styles within the plugin, but I am unsure:

DEBUG:hyperspyui:Initializing plugin: <class 'hyperspyui.plugins.stylesheet.StylePlugin'>
/Users/thomas/Dropbox/0_Git/hyperspyUI/hyperspyui/pluginmanager.py:248: RuntimeWarning: Exception in load of hyperspyui plugin "<class 'hyperspyui.plugins.stylesheet.StylePlugin'>" error:
  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 63, in apply_styles
    QApplication.setPalette(QPalette(palette))
TypeError: QPalette(): argument 1 has unexpected type 'str'

  self.warn(sys._getframe().f_code.co_name, plugin_type)

Fixed in master (9de9f8d).

Oh, I screwed up (drive by coding is never good).

Could you call the following in the Console, and open the file specified:

from PyQt4 import QtCore
QtCore.QSettings(parent=ui).fileName()

If you could copy the value of the setting under 'General' called '_palette', and paste it here.

No, not 'General._palette', 'plugins.Style._palette'...