Skip to content

Commit

Permalink
changed same small thing in OMShell and OMNotebook. Both applications…
Browse files Browse the repository at this point in the history
… are using Qt 4.1, Open Source license now.

// Anders Fernström

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2152 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x05andfe committed Feb 21, 2006
1 parent 8cc469c commit d4864b6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 12 deletions.
2 changes: 1 addition & 1 deletion OMNotebook/OMNotebookQT4/cellapplication.cpp
Expand Up @@ -180,7 +180,7 @@ namespace IAEX

//open(QString("WelcomeToOMNotebook.onb"));
// 2006-02-02 AF, open DrModelica from the begining - release stuff
/*/if( dir.exists( "DrModelica/DrModelica.nb" ))
/*if( dir.exists( "DrModelica/DrModelica.nb" ))
open(QString("DrModelica/DrModelica.nb"));
else*/
open(QString::null);
Expand Down
4 changes: 3 additions & 1 deletion OMNotebook/OMNotebookQT4/cellcursor.cpp
Expand Up @@ -502,7 +502,9 @@ namespace IAEX
palette.setColor(this->backgroundRole(), QColor(0,0,0));
this->setPalette(palette);

painter.setPen(QPen(black,1, SolidLine));
// changed from 1 to 3, don\t know way, but something must have
// changed between qt 4 and qt 4.1
painter.setPen(QPen(black,3, SolidLine));

QWidget::paintEvent(event);

Expand Down
24 changes: 18 additions & 6 deletions OMNotebook/OMNotebookQT4/inputcell.cpp
Expand Up @@ -978,7 +978,9 @@ namespace IAEX

// 2006-02-17 AF, set text '{evaluation expression}" during
// evaluation of expressiuon
output_->setPlainText( "{evaluating expression}" );
output_->selectAll();
output_->textCursor().insertText( "{evaluating expression}" );
//output_->setPlainText( "{evaluating expression}" );
output_->update();
QCoreApplication::processEvents();

Expand Down Expand Up @@ -1036,7 +1038,9 @@ namespace IAEX
// output part of the cell.
if( isPlot() && error.isEmpty() )
{
output_->setPlainText( "{creating plot}" );
output_->selectAll();
output_->textCursor().insertText( "{creating plot}" );
//output_->setPlainText( "{creating plot}" );
output_->update();
QCoreApplication::processEvents();

Expand All @@ -1059,7 +1063,9 @@ namespace IAEX
imageformat.setName( newname );

// 2006-02-13 AF, set {Plot} first in output
output_->setPlainText("{Plot}\n");
output_->selectAll();
output_->textCursor().insertText( "{Plot - Generated by PtPlot}" );
//output_->setPlainText("{Plot}\n");
QTextCursor outCursor = output_->textCursor();
outCursor.movePosition( QTextCursor::End );
outCursor.insertImage( imageformat );
Expand All @@ -1074,15 +1080,19 @@ namespace IAEX
}
else
{
output_->setPlainText( "[Error] Unable to read plot image \"" + imagename + "\". Please retry." );
output_->selectAll();
output_->textCursor().insertText( "[Error] Unable to read plot image \"" + imagename + "\". Please retry." );
//output_->setPlainText( "[Error] Unable to read plot image \"" + imagename + "\". Please retry." );
break;
}
}
}

if( sleepTime > 25 )
{
output_->setPlainText( "[Error] Unable to found plot image \"" + imagename + "\"" );
output_->selectAll();
output_->textCursor().insertText( "[Error] Unable to found plot image \"" + imagename + "\"" );
// output_->setPlainText( "[Error] Unable to found plot image \"" + imagename + "\"" );
break;
}

Expand All @@ -1100,7 +1110,9 @@ namespace IAEX
if( !error.isEmpty() )
res += QString("\n") + error;

output_->setPlainText( res );
output_->selectAll();
output_->textCursor().insertText( res );
//output_->setPlainText( res );
}

++numEvals_;
Expand Down
20 changes: 20 additions & 0 deletions OMNotebook/OMNotebookQT4/notebook.cpp
Expand Up @@ -278,6 +278,7 @@ namespace IAEX

delete aboutAction;
delete helpAction;
delete aboutQtAction;

delete facePlain;
delete faceBold;
Expand Down Expand Up @@ -1377,10 +1378,18 @@ namespace IAEX
connect( helpAction, SIGNAL( triggered() ),
this, SLOT( helpText() ));

// 2006-02-21 AF, Added a about qt action
aboutQtAction = new QAction( tr("About &Qt"), this );
aboutQtAction->setStatusTip( tr("Display information about Qt") );
connect( aboutQtAction, SIGNAL( triggered() ),
this, SLOT( aboutQT() ));


// 2005-10-07 AF, Porting, new code for creating menu
aboutMenu = menuBar()->addMenu( tr("&Help") );
aboutMenu->addAction( aboutAction );
aboutMenu->addAction( aboutQtAction );
aboutMenu->addSeparator();
aboutMenu->addAction( helpAction );

/* Old menu code //AF
Expand Down Expand Up @@ -2226,6 +2235,17 @@ namespace IAEX
QMessageBox::about( this, "OMNotebook", abouttext );
}

/*!
* \author Anders Fernström
*
* \brief display an ABOUT message box with information about
* Qt.
*/
void NotebookWindow::aboutQT()
{
QMessageBox::aboutQt( this );
}

/*!
* \author Anders Fernström
* \date 2006-02-03
Expand Down
4 changes: 3 additions & 1 deletion OMNotebook/OMNotebookQT4/notebook.h
Expand Up @@ -120,6 +120,7 @@ namespace IAEX
void closeFile();
void closeEvent( QCloseEvent *event ); // Added 2006-01-19 AF
void aboutQTNotebook();
void aboutQT(); // Added 2006-02-21 AF
void helpText(); // Added 2006-02-03 AF
void saveas();
void save();
Expand Down Expand Up @@ -242,7 +243,8 @@ namespace IAEX
QAction *inputAction;

QAction *aboutAction;
QAction *helpAction;
QAction *helpAction; // Added 2006-02-03 AF
QAction *aboutQtAction; // Added 2006-02-21 AF

QAction *facePlain;
QAction *faceBold;
Expand Down
10 changes: 7 additions & 3 deletions OMNotebook/ReadMe.txt
Expand Up @@ -7,8 +7,12 @@ Antlr and its code library is needed to create the files for the projects parser
Version 2.7.5 of antlr dosen't work correctly with this project.

QT
Qt version 4 has to be installed to compile the project. Qt version 4.0 works
fine with the project.
Qt version 4 has to be installed to compile the project. Currently version 4.1,
open source is used. Version 4.1 open soure don't have any support for visual
studio, but a patch can be downloaded from sourceforge.net that allows you to
compile qt to be used together with visual studio. For more information about
this patch: http://sourceforge.net/projects/qtwin/


MICO CORBA
Mico Corba is needed to communicate with OMC. Currently the project is using
Expand All @@ -32,7 +36,7 @@ This environment variables are needed:
> used like "$(ANTLRHOME)\lib\cpp".

> QTHOME : Should point at the home folder for Qt,
for example "C:\Qt\4.0.1".
for example "C:\Qt\qt-win-opensource-src-4.1.0".

> MICOHOME : Should point at the folder containing Mico Corba
for example "C:\Program\mico",
Expand Down

0 comments on commit d4864b6

Please sign in to comment.