Пример #1
0
void MainWindow::closeEvent(QCloseEvent *event)
{
  for(LiveCapture *live : m_LiveCaptures)
  {
    if(!live->checkAllowClose())
    {
      event->ignore();
      return;
    }
  }

  if(!PromptCloseLog())
  {
    event->ignore();
    return;
  }

  for(LiveCapture *live : m_LiveCaptures)
  {
    live->cleanItems();
    live->close();
  }

  SaveLayout(0);
}
Пример #2
0
Addlayoutdialog::Addlayoutdialog(QWidget *parent, Layout *lay)
	: QDialog(parent)
{
	new_layout = lay;
	ui.setupUi(this);
	connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(SaveLayout()));

}
Пример #3
0
void wxGD::MainFrame::OnClose( wxCloseEvent &event )
{
    if( !SaveWarning() )
        return;

    SaveLayout();

    event.Skip();
}
Пример #4
0
void MainWindow::LoadSaveLayout(QAction *action, bool save)
{
  if(action == NULL)
  {
    qWarning() << "NULL action passed to LoadSaveLayout - bad signal?";
    return;
  }

  bool success = false;

  if(action == ui->action_Save_Default_Layout)
  {
    success = SaveLayout(0);
  }
  else if(action == ui->action_Load_Default_Layout)
  {
    success = LoadLayout(0);
  }
  else
  {
    QString name = action->objectName();
    name.remove(0, name.size() - 1);
    int idx = name.toInt();

    if(idx > 0)
    {
      if(save)
        success = SaveLayout(idx);
      else
        success = LoadLayout(idx);
    }
  }

  if(!success)
  {
    if(save)
      RDDialog::critical(this, "Error saving layout", "Couldn't save layout");
    else
      RDDialog::critical(this, "Error loading layout", "Couldn't load layout");
  }
}
Пример #5
0
void FormEdit::DockInit()
{
	WindowButtons(false, false, true);

	DockLeft(Dockable(_LayoutList, t_("Layouts")).SizeHint(Size(200, 200)));
	DockRight(Dockable(_ItemList, t_("Items")).SizeHint(Size(250, 200)));
	DockRight(Dockable(_ItemProperties, t_("Item properties")).SizeHint(Size(250, 300)));

	if (!FileExists(ConfigFile("Layouts.bin")))
		SaveLayout(t_(" Default"));
	LoadGUILayouts(true);
	UpdateTools();
	UpdateGUILayout();
}
bool
CFormBackendImp::SaveLayout( const GUCEF::CORE::CString& layoutStoragePath )
{GUCEF_TRACE;

    VFS::CVFS& vfs = VFS::CVfsGlobal::Instance()->GetVfs();
    VFS::CVFS::CVFSHandlePtr file = vfs.GetFile( layoutStoragePath, "wb", true );
    if ( !file.IsNULL() )
    {
        CORE::CIOAccess* fileAccess = file->GetAccess();
        if ( NULL != fileAccess )
        {
            return SaveLayout( *fileAccess );
        }
    }
    return false;
}