@@ -776,11 +776,11 @@ void SaveAsClassDialog::showHideSaveContentsInOneFileCheckBox(QString text)
776776 \param nameStructure - qualified name of Modelica class
777777 \param pParent - pointer to MainWindow
778778 */
779- CopyClassDialog::CopyClassDialog (LibraryTreeNode *pLibraryTreeNode, MainWindow *pMainWindow)
779+ DuplicateClassDialog::DuplicateClassDialog (LibraryTreeNode *pLibraryTreeNode, MainWindow *pMainWindow)
780780 : QDialog(pMainWindow, Qt::WindowTitleHint), mpLibraryTreeNode(pLibraryTreeNode), mpMainWindow(pMainWindow)
781781{
782782 setAttribute (Qt::WA_DeleteOnClose);
783- setWindowTitle (QString (Helper::applicationName).append ( " - Copy " ). append (mpLibraryTreeNode->getNameStructure ()));
783+ setWindowTitle (QString (" %1 - %2 %3 " ). arg ( Helper::applicationName).arg (Helper::duplicate). arg (mpLibraryTreeNode->getNameStructure ()));
784784 mpNameLabel = new Label (Helper::name);
785785 mpNameTextBox = new QLineEdit;
786786 mpPathLabel = new Label (Helper::path);
@@ -791,7 +791,7 @@ CopyClassDialog::CopyClassDialog(LibraryTreeNode *pLibraryTreeNode, MainWindow *
791791 // Create the buttons
792792 mpOkButton = new QPushButton (Helper::ok);
793793 mpOkButton->setAutoDefault (true );
794- connect (mpOkButton, SIGNAL (clicked ()), SLOT (copyClass ()));
794+ connect (mpOkButton, SIGNAL (clicked ()), SLOT (duplicateClass ()));
795795 mpCancelButton = new QPushButton (Helper::cancel);
796796 mpCancelButton->setAutoDefault (false );
797797 connect (mpCancelButton, SIGNAL (clicked ()), SLOT (reject ()));
@@ -811,25 +811,26 @@ CopyClassDialog::CopyClassDialog(LibraryTreeNode *pLibraryTreeNode, MainWindow *
811811 setLayout (pMainLayout);
812812}
813813
814- void CopyClassDialog ::browsePath ()
814+ void DuplicateClassDialog ::browsePath ()
815815{
816816 LibraryBrowseDialog *pLibraryBrowseDialog = new LibraryBrowseDialog (tr (" Select Path" ), mpPathTextBox, mpMainWindow->getLibraryTreeWidget ());
817817 pLibraryBrowseDialog->exec ();
818818}
819819
820- void CopyClassDialog::copyClass ()
820+ /* !
821+ * \brief DuplicateClassDialog::duplicateClass
822+ * Duplicates the class.
823+ */
824+ void DuplicateClassDialog::duplicateClass ()
821825{
822- if (mpNameTextBox->text ().isEmpty ())
823- {
826+ if (mpNameTextBox->text ().isEmpty ()) {
824827 QMessageBox::critical (this , QString (Helper::applicationName).append (" - " ).append (Helper::error),
825828 GUIMessages::getMessage (GUIMessages::ENTER_NAME).arg (" class" ), Helper::ok);
826829 return ;
827830 }
828831 /* if path class doesn't exist. */
829- if (!mpPathTextBox->text ().isEmpty ())
830- {
831- if (!mpMainWindow->getOMCProxy ()->existClass (mpPathTextBox->text ()))
832- {
832+ if (!mpPathTextBox->text ().isEmpty ()) {
833+ if (!mpMainWindow->getOMCProxy ()->existClass (mpPathTextBox->text ())) {
833834 QMessageBox::critical (this , QString (Helper::applicationName).append (" - " ).append (Helper::error), GUIMessages::getMessage (
834835 GUIMessages::INSERT_IN_CLASS_NOT_FOUND).arg (mpPathTextBox->text ()), Helper::ok);
835836 return ;
@@ -843,7 +844,7 @@ void CopyClassDialog::copyClass()
843844 .arg ((mpPathTextBox->text ().isEmpty () ? " Top Level" : mpPathTextBox->text ())), Helper::ok);
844845 return ;
845846 }
846- // if everything is fine then copy the class.
847+ // if everything is fine then duplicate the class.
847848 if (mpMainWindow->getOMCProxy ()->copyClass (mpLibraryTreeNode->getNameStructure (), mpNameTextBox->text (), mpPathTextBox->text ())) {
848849 LibraryTreeWidget *pLibraryTreeWidget = mpMainWindow->getLibraryTreeWidget ();
849850 LibraryTreeNode *pLibraryTreeNode;
0 commit comments