Add option for showing console in editor tab
MODIFY
src/edittab.cpp
src/edittab.cpp
@@ -55,7 +55,9 @@ EditTab::EditTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent)
[=](const QVariant& val) { m_ui->registers->setVisible(val.toBool()); });
RipesSettings::getObserver(RIPES_SETTING_EDITORREGS)->trigger();
- RipesSettings::getObserver(RIPES_SETTING_EDITORREGS)->trigger();
+ connect(RipesSettings::getObserver(RIPES_SETTING_EDITORCONSOLE), &SettingObserver::modified,
+ [=](const QVariant& val) { m_ui->console->setVisible(val.toBool()); });
+ RipesSettings::getObserver(RIPES_SETTING_EDITORCONSOLE)->trigger();
connect(m_ui->enableEditor, &QPushButton::clicked, this, &EditTab::enableAssemblyInput);
connect(m_ui->codeEditor, &CodeEditor::timedTextChanged, this, &EditTab::sourceCodeChanged);
@@ -86,9 +88,17 @@ EditTab::EditTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent)
sourceTypeChanged();
enableEditor();
- m_ui->splitter->setStretchFactor(0, 2);
- m_ui->splitter->setStretchFactor(1, 2);
- m_ui->splitter->setStretchFactor(2, 0);
+ // Make left-hand side widgets stretch wrt. registers
+ m_ui->toplevelSplitter->setStretchFactor(0, 2);
+ m_ui->toplevelSplitter->setStretchFactor(1, 0);
+
+ // make editor and program viewer stretch wrt. console
+ m_ui->leftSpliiter->setStretchFactor(0, INT_MAX);
+ m_ui->leftSpliiter->setStretchFactor(1, 0);
+
+ // make editor and program viewer stretch equally wrt. each other
+ m_ui->editorSplitter->setStretchFactor(0, 2);
+ m_ui->editorSplitter->setStretchFactor(1, 2);
// State preservation
connect(RipesSettings::getObserver(RIPES_GLOBALSIGNAL_QUIT), &SettingObserver::modified, this, [=] {

MODIFY
src/edittab.ui
src/edittab.ui
<rect>
<x>0</x>
<y>0</y>
- <width>1185</width>
- <height>610</height>
+ <width>1022</width>
+ <height>606</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>6</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
+ <item row="0" column="0">
+ <widget class="QSplitter" name="toplevelSplitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="bottomMargin">
- <number>0</number>
+ <widget class="QSplitter" name="leftSpliiter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- <item row="0" column="0">
- <widget class="QSplitter" name="splitter">
+ <widget class="QWidget" name="verticalLayoutWidget_3">
+ <layout class="QVBoxLayout" name="leftLayout">
+ <item>
+ <widget class="QSplitter" name="editorSplitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_2">
- <layout class="QVBoxLayout" name="verticalLayout_2">
+ <layout class="QVBoxLayout" name="programViewerLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
</item>
</layout>
</widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="ConsoleWidget" name="console" native="true"/>
+ </widget>
<widget class="RegisterContainerWidget" name="registers" native="true"/>
</widget>
</item>
</layout>
</widget>
<customwidgets>
+ <customwidget>
+ <class>RegisterContainerWidget</class>
+ <extends>QWidget</extends>
+ <header>registercontainerwidget.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>ConsoleWidget</class>
+ <extends>QWidget</extends>
+ <header>consolewidget.h</header>
+ <container>1</container>
+ </customwidget>
<customwidget>
<class>CodeEditor</class>
<extends>QPlainTextEdit</extends>
<extends>QPlainTextEdit</extends>
<header>programviewer.h</header>
</customwidget>
- <customwidget>
- <class>RegisterContainerWidget</class>
- <extends>QWidget</extends>
- <header>registercontainerwidget.h</header>
- <container>1</container>
- </customwidget>
</customwidgets>
<resources/>
<connections/>

MODIFY
src/ripessettings.cpp
src/ripessettings.cpp
@@ -27,6 +27,7 @@ const std::map<QString, QVariant> s_defaultSettings = {
{RIPES_SETTING_ASSEMBLER_BSSSTART, 0x11000000},
{RIPES_SETTING_PERIPHERALS_START, static_cast<unsigned>(0xF0000000)},
{RIPES_SETTING_EDITORREGS, true},
+ {RIPES_SETTING_EDITORCONSOLE, false},
{RIPES_SETTING_PIPEDIAGRAM_MAXCYCLES, 100},
{RIPES_SETTING_CACHE_MAXCYCLES, 10000},

MODIFY
src/ripessettings.h
src/ripessettings.h
@@ -47,6 +47,7 @@ namespace Ripes {
#define RIPES_SETTING_SHOWSIGNALS ("show_signals")
#define RIPES_SETTING_AUTOCLOCK_INTERVAL ("autoclock_interval")
#define RIPES_SETTING_EDITORREGS ("editor_regs")
+#define RIPES_SETTING_EDITORCONSOLE ("editor_console")
#define RIPES_SETTING_HAS_SAVEFILE ("has_savefile")
#define RIPES_SETTING_SAVEPATH ("savepath")

MODIFY
src/settingsdialog.cpp
src/settingsdialog.cpp
@@ -291,6 +291,11 @@ QWidget* SettingsDialog::createEditorPage() {
appendToLayout({regsLabel, regsCheckbox}, pageLayout,
"Show (or hide) a view of the processor register file(s) in the editor tab.");
+ auto [consoleLabel, consoleCheckbox] =
+ createSettingsWidgets<QCheckBox>(RIPES_SETTING_EDITORCONSOLE, "Show console in editor tab");
+ appendToLayout({consoleLabel, consoleCheckbox}, pageLayout,
+ "Show (or hide) a view of the console in the editor tab.");
+
return pageWidget;
}

Add option for showing console in editor tab #131