'Imports data for view save/restore'

def apply_state(self, state):

    result = True
    try:
        (width, height) = (int(state[u'width']), int(state[u'height']))
        self.resize(width, height)
        (x, y) = (int(state[u'x']), int(state[u'y']))
        self.move(x, y)
        self._unmaximized_rect = (x, y, width, height)
    except:
        result = False
    try:
        if state[u'maximized']:
            try:
                if (utils.is_win32() or utils.is_darwin()):
                    self.resize_to_desktop()
                else:
                    self.showMaximized()
            except:
                pass
    except:
        result = False
    self._apply_state_applied = result
    return result
