示例#1
0
void MainWindow::loadConfigFromFile(const QString & fileName)
{
  m_expert->loadConfig(fileName);
  m_wizard->refresh();
  updateConfigFileName(fileName);
  updateLaunchButtonState();
  m_modified = false;
  updateTitle();
}
示例#2
0
void MainWindow::loadConfigFromFile(const QString & fileName)
{
  // save full path info of original file
  QString absFileName = QFileInfo(fileName).absoluteFilePath();
  // updates the current directory
  updateConfigFileName(fileName);
  // open the specified configuration file
  m_expert->loadConfig(absFileName);
  m_wizard->refresh();
  updateLaunchButtonState();
  m_modified = false;
  updateTitle();
}
示例#3
0
void MainWindow::saveConfig(const QString &fileName)
{
  if (fileName.isEmpty()) return;
  QFile f(fileName);
  if (!f.open(QIODevice::WriteOnly)) 
  {
    QMessageBox::warning(this,
        tr("Error saving"),
        tr("Error: cannot open the file ")+fileName+tr(" for writing!\n")+
        tr("Reason given: ")+f.error());
    return;
  }
  QTextStream t(&f);
  m_expert->writeConfig(t,false);
  updateConfigFileName(fileName);
  m_modified = false;
  updateTitle();
}