@@ -1289,6 +1289,11 @@ ExportFigaroDialog::ExportFigaroDialog(MainWindow *pMainWindow, LibraryTreeNode
12891289 mpFigaroModeComboBox = new QComboBox;
12901290 mpFigaroModeComboBox->addItem (" figaro0" , " figaro0" );
12911291 mpFigaroModeComboBox->addItem (" fault-tree" , " fault-tree" );
1292+ // working directory
1293+ mpWorkingDirectoryLabel = new Label (Helper::workingDirectory);
1294+ mpWorkingDirectoryTextBox = new QLineEdit (OpenModelica::tempDirectory ());
1295+ mpWorkingDirectoryBrowseButton = new QPushButton (Helper::browse);
1296+ connect (mpWorkingDirectoryBrowseButton, SIGNAL (clicked ()), SLOT (browseWorkingDirectory ()));
12921297 // create the export button
12931298 mpExportFigaroButton = new QPushButton (Helper::exportFigaro);
12941299 mpExportFigaroButton->setAutoDefault (true );
@@ -1305,11 +1310,19 @@ ExportFigaroDialog::ExportFigaroDialog(MainWindow *pMainWindow, LibraryTreeNode
13051310 QGridLayout *pMainGridLayout = new QGridLayout;
13061311 pMainGridLayout->setAlignment (Qt::AlignTop);
13071312 pMainGridLayout->addWidget (mpFigaroModeLabel, 0 , 0 );
1308- pMainGridLayout->addWidget (mpFigaroModeComboBox, 0 , 1 );
1309- pMainGridLayout->addWidget (mpButtonBox, 1 , 0 , 2 , Qt::AlignRight);
1313+ pMainGridLayout->addWidget (mpFigaroModeComboBox, 0 , 1 , 1 , 2 );
1314+ pMainGridLayout->addWidget (mpWorkingDirectoryLabel, 1 , 0 );
1315+ pMainGridLayout->addWidget (mpWorkingDirectoryTextBox, 1 , 1 );
1316+ pMainGridLayout->addWidget (mpWorkingDirectoryBrowseButton, 1 , 2 );
1317+ pMainGridLayout->addWidget (mpButtonBox, 2 , 0 , 1 , 3 , Qt::AlignRight);
13101318 setLayout (pMainGridLayout);
13111319}
13121320
1321+ void ExportFigaroDialog::browseWorkingDirectory ()
1322+ {
1323+ mpWorkingDirectoryTextBox->setText (StringHandler::getExistingDirectory (this , QString (Helper::applicationName).append (" - " ).append (Helper::chooseDirectory), NULL ));
1324+ }
1325+
13131326void ExportFigaroDialog::exportModelFigaro ()
13141327{
13151328 // set the status message.
@@ -1318,11 +1331,12 @@ void ExportFigaroDialog::exportModelFigaro()
13181331 mpMainWindow->getProgressBar ()->setRange (0 , 0 );
13191332 mpMainWindow->showProgressBar ();
13201333 FigaroPage *pFigaroPage = mpMainWindow->getOptionsDialog ()->getFigaroPage ();
1334+ QString directory = mpWorkingDirectoryTextBox->text ();
13211335 QString library = pFigaroPage->getFigaroDatabaseFileTextBox ()->text ();
13221336 QString mode = mpFigaroModeComboBox->currentText ();
13231337 QString options = pFigaroPage->getFigaroOptionsTextBox ()->text ();
13241338 QString processor = pFigaroPage->getFigaroProcessTextBox ()->text ();
1325- if (mpMainWindow->getOMCProxy ()->exportToFigaro (mpLibraryTreeNode->getNameStructure (), library, mode, options, processor)) {
1339+ if (mpMainWindow->getOMCProxy ()->exportToFigaro (mpLibraryTreeNode->getNameStructure (), directory, library, mode, options, processor)) {
13261340 mpMainWindow->getMessagesWidget ()->addGUIMessage (new MessageItem (" " , false , 0 , 0 , 0 , 0 ,
13271341 GUIMessages::getMessage (GUIMessages::FIGARO_GENERATED),
13281342 Helper::scriptingKind, Helper::notificationLevel, 0 ));
0 commit comments