Fix edit mode

Changed the edit handling so that it works also for widgets extended
from WidgetBase. This will just store the title but that's of course
better than throwing errors.