Skip to content

Commit

Permalink
removed log/error area from omshell
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2343 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x05andfe committed Apr 25, 2006
1 parent a540fb5 commit fbb5645
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 22 deletions.
25 changes: 15 additions & 10 deletions OMShell/QWinMosh.vcproj
Expand Up @@ -249,15 +249,6 @@
Name="Generated Files"
Filter="moc;h;cpp"
UniqueIdentifier="{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}">
<File
RelativePath=".\generatedfiles\release\moc_omc_communicator.cpp">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\generatedfiles\debug\moc_omc_communicator.cpp">
<FileConfiguration
Expand All @@ -275,7 +266,7 @@
</FileConfiguration>
</File>
<File
RelativePath=".\GeneratedFiles\release\moc_oms.cpp">
RelativePath=".\generatedfiles\release\moc_omc_communicator.cpp">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
Expand All @@ -299,6 +290,20 @@
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
</File>
<File
RelativePath=".\GeneratedFiles\release\moc_oms.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\GeneratedFiles\qrc_oms.cpp">
</File>
Expand Down
43 changes: 33 additions & 10 deletions OMShell/oms.cpp
Expand Up @@ -52,6 +52,8 @@ licence: http://www.trolltech.com/products/qt/licensing.html
* \date 2005-11-10 (created)
*/

// 2006-04-25 AF, removed error editor


#ifdef WIN32
#include "windows.h"
Expand Down Expand Up @@ -251,7 +253,7 @@ OMS::OMS( QWidget* parent )

fontSize_ = 11;
createMoshEdit();
createMoshError();
//createMoshError();
createAction();
createMenu();
createToolbar();
Expand Down Expand Up @@ -378,6 +380,7 @@ void OMS::createMoshEdit()
this, SLOT( codeCompletion(bool) ));
}

/*
void OMS::createMoshError()
{
moshError_ = new QTextEdit( mainFrame_ );
Expand Down Expand Up @@ -405,6 +408,7 @@ void OMS::createMoshError()
moshError_->setFontWeight( QFont::Normal );
moshError_->setFontPointSize( fontSize_ );
}
*/

void OMS::createAction()
{
Expand Down Expand Up @@ -660,14 +664,26 @@ void OMS::returnPressed()
QString error = delegate_->getResult();
if( error.size() > 2 )
{
cursor_.insertText( error.mid( 1, error.size() - 2 ) );
/*
QTextCursor errorCursor = moshError_->textCursor();
errorCursor.insertText( "\n" + error.mid( 0, error.size() - 1 ) );

moshError_->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
*/
}
}
else
{
if( startServer() )
{
cursor_.insertText("[ERROR] No OMC serer started - restarted OMC\n" );
goto eval;
}
else
cursor_.insertText("[ERROR] No OMC serer started - unable to restart OMC\n" );


/*
QTextCursor cursor = moshError_->textCursor();
if( startServer() )
Expand All @@ -677,6 +693,7 @@ void OMS::returnPressed()
}
else
cursor.insertText("[ERROR] No OMC serer started - unable to restart OMC\n" );
*/
}

// add new command line
Expand Down Expand Up @@ -958,28 +975,28 @@ void OMS::exit()

void OMS::cut()
{
if( moshEdit_->hasFocus() )
{
/* if( moshEdit_->hasFocus() )
{*/
QKeyEvent* key = new QKeyEvent( QEvent::KeyPress, Qt::Key_X, Qt::ControlModifier, "x" );
((MyTextEdit*)moshEdit_)->sendKey( key );
}
/* }
else if( moshError_->hasFocus() )
{
moshError_->copy();
}
}*/
}

void OMS::copy()
{
if( moshEdit_->hasFocus() )
{
/* if( moshEdit_->hasFocus() )
{*/
QKeyEvent* key = new QKeyEvent( QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier, "c" );
((MyTextEdit*)moshEdit_)->sendKey( key );
}
/* }
else if( moshError_->hasFocus() )
{
moshError_->copy();
}
}*/
}

void OMS::paste()
Expand Down Expand Up @@ -1007,8 +1024,12 @@ void OMS::fontSize()
}
else
{
cursor_.movePosition( QTextCursor::End );
cursor_.insertText( "[ERROR] Selected fontsize not between 8 and 120.\n" );
/*
QTextCursor cursor = moshError_->textCursor();
cursor.insertText( "[ERROR] Selected fontsize not between 8 and 120.\n" );
*/
}
}

Expand Down Expand Up @@ -1100,6 +1121,7 @@ void OMS::clear()
addCommandLine();


/*
moshError_->clear();
// set backgroundcolor
Expand All @@ -1111,6 +1133,7 @@ void OMS::clear()
moshError_->setFontFamily( "Courier New" );
moshError_->setFontWeight( QFont::Normal );
moshError_->setFontPointSize( fontSize_ );
*/
}

void OMS::closeEvent( QCloseEvent *event )
Expand Down
4 changes: 2 additions & 2 deletions OMShell/oms.h
Expand Up @@ -115,7 +115,7 @@ private slots:

private:
void createMoshEdit();
void createMoshError();
//void createMoshError();
void createAction();
void createMenu();
void createToolbar();
Expand All @@ -127,7 +127,7 @@ private slots:
QFrame* mainFrame_;
QTextCursor cursor_;
QTextEdit* moshEdit_;
QTextEdit* moshError_;
//QTextEdit* moshError_;
QVBoxLayout* layout_;
QString clipboard_;

Expand Down

0 comments on commit fbb5645

Please sign in to comment.