Skip to content

Commit

Permalink
Fixed flickering of duplicate dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed May 14, 2018
1 parent afcb605 commit 09fcdbc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
30 changes: 20 additions & 10 deletions OMEdit/OMEditGUI/Modeling/ModelicaClassDialog.cpp
Expand Up @@ -748,16 +748,6 @@ DuplicateClassDialog::DuplicateClassDialog(bool saveAs, LibraryTreeItem *pLibrar
connect(mpPathBrowseButton, SIGNAL(clicked()), SLOT(browsePath()));
// save contents in one file
mpSaveContentsInOneFileCheckBox = new QCheckBox(Helper::saveContentsInOneFile);
if (mpLibraryTreeItem->getRestriction() == StringHandler::Package) {
mpSaveContentsInOneFileCheckBox->setVisible(true);
if (mpLibraryTreeItem->getSaveContentsType() == LibraryTreeItem::SaveInOneFile) {
mpSaveContentsInOneFileCheckBox->setChecked(true);
} else {
mpSaveContentsInOneFileCheckBox->setChecked(false);
}
} else {
mpSaveContentsInOneFileCheckBox->setVisible(false);
}
// Create the buttons
mpOkButton = new QPushButton(Helper::ok);
mpOkButton->setAutoDefault(true);
Expand Down Expand Up @@ -798,6 +788,26 @@ void DuplicateClassDialog::setSaveContentsTypeAsFolderStructure(LibraryTreeItem
}
}

/*!
* \brief DuplicateClassDialog::exec
* Reimplementation of QDialog::exec
* \return
*/
int DuplicateClassDialog::exec()
{
if (mpLibraryTreeItem->getRestriction() == StringHandler::Package) {
mpSaveContentsInOneFileCheckBox->setVisible(true);
if (mpLibraryTreeItem->getSaveContentsType() == LibraryTreeItem::SaveInOneFile) {
mpSaveContentsInOneFileCheckBox->setChecked(true);
} else {
mpSaveContentsInOneFileCheckBox->setChecked(false);
}
} else {
mpSaveContentsInOneFileCheckBox->setVisible(false);
}
return QDialog::exec();
}

void DuplicateClassDialog::browsePath()
{
LibraryBrowseDialog *pLibraryBrowseDialog = new LibraryBrowseDialog(tr("Select Path"), mpPathTextBox, MainWindow::instance()->getLibraryWidget());
Expand Down
1 change: 1 addition & 0 deletions OMEdit/OMEditGUI/Modeling/ModelicaClassDialog.h
Expand Up @@ -172,6 +172,7 @@ class DuplicateClassDialog : public QDialog

void setSaveContentsTypeAsFolderStructure(LibraryTreeItem *pLibraryTreeItem);
public slots:
int exec();
void browsePath();
void duplicateClass();
};
Expand Down

0 comments on commit 09fcdbc

Please sign in to comment.