'Save current window settings with *prefix* in
the userconfig-based configuration, under *section*'

def save_current_window_settings(self, prefix, section='main'):

    win_size = self.window_size
    prefs_size = self.prefs_dialog_size
    CONF.set(section, (prefix + 'size'), (win_size.width(), win_size.height()))
    CONF.set(section, (prefix + 'prefs_dialog_size'), (prefs_size.width(), prefs_size.height()))
    CONF.set(section, (prefix + 'is_maximized'), self.isMaximized())
    CONF.set(section, (prefix + 'is_fullscreen'), self.isFullScreen())
    pos = self.window_position
    CONF.set(section, (prefix + 'position'), (pos.x(), pos.y()))
    self.maximize_dockwidget(restore=True)
    qba = self.saveState()
    CONF.set(section, (prefix + 'state'), qbytearray_to_str(qba))
    CONF.set(section, (prefix + 'statusbar'), (not self.statusBar().isHidden()))
