Skip to content

Commit

Permalink
Fixed #4275
Browse files Browse the repository at this point in the history
  • Loading branch information
alash325 committed Feb 17, 2017
1 parent bab1d1f commit 4e6c9ec
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -3969,24 +3969,24 @@ bool LibraryWidget::saveModelicaLibraryTreeItemOneFile(LibraryTreeItem *pLibrary
}
mpLibraryTreeModel->updateLibraryTreeItem(pLibraryTreeItem);
/* Stage the file for the next commit. */
if(MainWindow::instance()->getGitCommands()->isSavedUnderGitRepository(pLibraryTreeItem->getFileName())){
QMessageBox *pMessageBox = new QMessageBox(this);
pMessageBox->setWindowTitle(QString(Helper::applicationName).append(" - ").append("Stage File"));
pMessageBox->setIcon(QMessageBox::Question);
pMessageBox->setAttribute(Qt::WA_DeleteOnClose);
pMessageBox->setText("Do you want to stage the file for the next commit");
pMessageBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
pMessageBox->setDefaultButton(QMessageBox::Yes);
int answer = pMessageBox->exec();
switch (answer) {
case QMessageBox::Yes:
MainWindow::instance()->getGitCommands()->stageCurrentFileForCommit(pLibraryTreeItem->getFileName());
break;
case QMessageBox::No:
default:
break;
if(MainWindow::instance()->getGitCommands()->isSavedUnderGitRepository(pLibraryTreeItem->getFileName()) && OptionsDialog::instance()->getTraceabilityPage()->getTraceabilityGroupBox()->isChecked() ){
QMessageBox *pMessageBox = new QMessageBox(this);
pMessageBox->setWindowTitle(QString(Helper::applicationName).append(" - ").append("Stage File"));
pMessageBox->setIcon(QMessageBox::Question);
pMessageBox->setAttribute(Qt::WA_DeleteOnClose);
pMessageBox->setText("Do you want to stage the file for the next commit ?");
pMessageBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
pMessageBox->setDefaultButton(QMessageBox::Yes);
int answer = pMessageBox->exec();
switch (answer) {
case QMessageBox::Yes:
MainWindow::instance()->getGitCommands()->stageCurrentFileForCommit(pLibraryTreeItem->getFileName());
break;
case QMessageBox::No:
default:
break;
}
}
}
} else {
return false;
}
Expand Down

0 comments on commit 4e6c9ec

Please sign in to comment.