Commit e7aec44b authored by heretik's avatar heretik
Browse files

add dockwidgets

parent 67c459aa
......@@ -13,10 +13,10 @@ find_package( Qt5LinguistTools REQUIRED )
set( ${PROJECT_NAME}_SOURCES
main.cpp
mainwindow.cpp
mainwindow.ui
syntax_highlighter.cpp
block_data.cpp
mainwindow.ui
main.qrc
)
......
......@@ -24,6 +24,8 @@ MainWindow::MainWindow( QWidget *parent )
{
// prepare qt things
ui_ptr_->setupUi( this );
tabifyDockWidget( ui_ptr_->dockWidget_compilation, ui_ptr_->dockWidget_io );
connect( &process_, &QProcess::readyReadStandardOutput, this, &MainWindow::update_std_out );
connect( &process_, &QProcess::readyReadStandardError, this, &MainWindow::update_std_err );
connect( &process_, SIGNAL(finished(int)), this, SLOT(finished(int)));
......@@ -99,7 +101,7 @@ void MainWindow::finished( int exit_code )
is_prepared_ = true;
} else if( current_command_index_ == 3 ) {
plain_text_.reset( ui_ptr_->plainTextEdit_io );
ui_ptr_->tabWidget->setCurrentIndex( 1 );
ui_ptr_->dockWidget_io->raise();
}
}
......@@ -224,7 +226,7 @@ void MainWindow::disable()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
setEnabled( false );
ui_ptr_->tabWidget->setCurrentIndex( 0 );
ui_ptr_->dockWidget_compilation->raise();
ui_ptr_->plainTextEdit_compilation->clear();
ui_ptr_->plainTextEdit_io->clear();
plain_text_.reset( ui_ptr_->plainTextEdit_compilation );
......
......@@ -18,185 +18,193 @@
<normaloff>:/resources/icon-256.png</normaloff>:/resources/icon-256.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,2,0,1">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>C++ code:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTextEdit" name="textEdit_code">
<property name="font">
<font>
<family>Inconsolata</family>
<pointsize>12</pointsize>
</font>
<widget class="QLabel" name="label">
<property name="text">
<string>C++ code:</string>
</property>
<property name="mouseTracking">
<bool>true</bool>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="tabStopWidth">
<number>20</number>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="acceptRichText">
<bool>false</bool>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_run">
<property name="text">
<string>&amp;Run</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
</property>
</widget>
</item>
</layout>
<widget class="QPushButton" name="pushButton_run">
<property name="text">
<string>&amp;Run</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Result:</string>
<widget class="QTextEdit" name="textEdit_code">
<property name="font">
<font>
<family>Inconsolata</family>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="tabStopWidth">
<number>20</number>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
<widget class="QWidget" name="tab_compilation">
<attribute name="title">
<string>Compilation</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPlainTextEdit" name="plainTextEdit_compilation">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>68</red>
<green>68</green>
<blue>68</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_io">
<attribute name="title">
<string>Input/output</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPlainTextEdit" name="plainTextEdit_io">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>68</red>
<green>68</green>
<blue>68</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QDockWidget" name="dockWidget_compilation">
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Compilation</string>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPlainTextEdit" name="plainTextEdit_compilation">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>68</red>
<green>68</green>
<blue>68</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="dockWidget_io">
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Input/output</string>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents_2">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QPlainTextEdit" name="plainTextEdit_io">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>68</red>
<green>68</green>
<blue>68</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<zorder>dockWidget_compilation</zorder>
</widget>
<resources>
<include location="main.qrc"/>
......
......@@ -9,66 +9,61 @@
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="25"/>
<location filename="../src/prototypator/mainwindow.ui" line="27"/>
<source>C++ code:</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="68"/>
<location filename="../src/prototypator/mainwindow.ui" line="50"/>
<source>&amp;Run</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="71"/>
<location filename="../src/prototypator/mainwindow.ui" line="53"/>
<source>Ctrl+R</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="82"/>
<source>Result:</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="93"/>
<location filename="../src/prototypator/mainwindow.ui" line="88"/>
<source>Compilation</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="147"/>
<location filename="../src/prototypator/mainwindow.ui" line="153"/>
<source>Input/output</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="46"/>
<location filename="../src/prototypator/mainwindow.cpp" line="48"/>
<source>testing presence of cmake...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="50"/>
<location filename="../src/prototypator/mainwindow.cpp" line="52"/>
<source>running &apos;cmake&apos;...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="54"/>
<location filename="../src/prototypator/mainwindow.cpp" line="56"/>
<source>running &apos;make&apos;...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="58"/>
<location filename="../src/prototypator/mainwindow.cpp" line="60"/>
<source>running application...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="110"/>
<location filename="../src/prototypator/mainwindow.cpp" line="112"/>
<source> exited with code </source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="217"/>
<location filename="../src/prototypator/mainwindow.cpp" line="219"/>
<source>failed to start &apos;</source>
<translation></translation>
</message>
......
......@@ -9,70 +9,65 @@
<translation>Prototypator</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="25"/>
<location filename="../src/prototypator/mainwindow.ui" line="27"/>
<source>C++ code:</source>
<translation>Code c++ :</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="68"/>
<location filename="../src/prototypator/mainwindow.ui" line="50"/>
<source>&amp;Run</source>
<translation>&amp;Démarrer</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="71"/>
<location filename="../src/prototypator/mainwindow.ui" line="53"/>
<source>Ctrl+R</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="82"/>
<source>Result:</source>
<translation>Résultat :</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="93"/>
<location filename="../src/prototypator/mainwindow.ui" line="88"/>
<source>Compilation</source>
<translation>Compilation</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.ui" line="147"/>
<location filename="../src/prototypator/mainwindow.ui" line="153"/>
<source>Input/output</source>
<translation>Entrée/sortie</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="46"/>
<location filename="../src/prototypator/mainwindow.cpp" line="48"/>
<source>testing presence of cmake...
</source>
<translation>test de la présence de cmake...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="50"/>
<location filename="../src/prototypator/mainwindow.cpp" line="52"/>
<source>running &apos;cmake&apos;...
</source>
<translation>démarrage de &apos;cmake&apos;...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="54"/>
<location filename="../src/prototypator/mainwindow.cpp" line="56"/>
<source>running &apos;make&apos;...
</source>
<translation>démarrage de &apos;make&apos;...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="58"/>
<location filename="../src/prototypator/mainwindow.cpp" line="60"/>
<source>running application...
</source>
<translation>démarrage de l&apos;application...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="110"/>
<location filename="../src/prototypator/mainwindow.cpp" line="112"/>
<source> exited with code </source>
<translation> s&apos;est terminé avec le code </translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="217"/>
<location filename="../src/prototypator/mainwindow.cpp" line="219"/>
<source>failed to start &apos;</source>
<translation>impossible de démarrer &apos;</translation>
</message>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment