void PerspectivesPreferencePage::RevertPerspective()
{
  PerspectiveDescriptor::Pointer desc = GetSelectedPerspective();
  if (desc.IsNotNull() && !perspToRevert.contains(desc))
  {
    perspToRevert.push_back(desc);
  }
  UpdateButtons();
}
void PerspectivesPreferencePage::MakeDefaultPerspective()
{
  PerspectiveDescriptor::Pointer desc = GetSelectedPerspective();
  if (desc.IsNotNull() && !perspToDelete.contains(desc))
  {
    int row = perspectives.indexOf(desc);
    defaultPerspectiveId = desc->GetId();
    UpdatePerspectivesTable();
    ui->perspectivesListWidget->item(row)->setSelected(true);
  }
  UpdateButtons();
}
void PerspectivesPreferencePage::DeletePerspective()
{
  PerspectiveDescriptor::Pointer desc = GetSelectedPerspective();
  if (desc.IsNotNull() && !perspToDelete.contains(desc))
  {
    if (!FindOpenInstance(desc))
    {
      perspToDelete.push_back(desc);
      perspToRevert.removeAll(desc);
      perspectives.removeAll(desc);
      UpdatePerspectivesTable();
    }
  }
  UpdateButtons();
}