Skip to content

Commit

Permalink
openmv: Fixed output pane on startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwagyeman committed Nov 22, 2024
1 parent 86d009d commit a972ecd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/plugins/coreplugin/outputpanemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,9 @@ void OutputPaneManager::initialize()
cmd->action());
data.button = button;
connect(button, &OutputPaneToggleButton::contextMenuRequested, m_instance, [] {
m_instance->popupMenu();
// OPENMV-DIFF //
// m_instance->popupMenu();
// OPENMV-DIFF //
});

connect(outPane, &IOutputPane::flashButton, button, [button] { button->flash(); });
Expand Down Expand Up @@ -612,6 +614,12 @@ void OutputPaneManager::initialize()
const int index = m_instance->currentIndex();
m_instance->updateActions(index >= 0 ? g_outputPanes.at(index).pane : nullptr);
});
// OPENMV-DIFF //
QTimer::singleShot(0, m_instance, [] () {
if (m_instance->m_outputPaneVisibleOnStartup)
m_instance->showPage(m_instance->m_outputWidgetPane->currentIndex(), IOutputPane::ModeSwitch);
});
// OPENMV-DIFF //
}

OutputPaneManager::~OutputPaneManager() = default;
Expand Down Expand Up @@ -687,6 +695,10 @@ void OutputPaneManager::readSettings()
= settings->value("OutputPanePlaceHolder/Height", 0).toInt();
const int currentIdx
= settings->value("OutputPanePlaceHolder/CurrentIndex", 0).toInt();
// OPENMV-DIFF //
m_outputPaneVisibleOnStartup
= settings->value("OutputPanePlaceHolder/Visible", false).toBool();
// OPENMV-DIFF //
if (QTC_GUARD(currentIdx >= 0 && currentIdx < g_outputPanes.size()))
setCurrentIndex(currentIdx);
}
Expand Down Expand Up @@ -893,6 +905,9 @@ void OutputPaneManager::saveSettings() const
heightSetting = curr->nonMaximizedSize();
settings->setValue("OutputPanePlaceHolder/Height", heightSetting);
settings->setValue("OutputPanePlaceHolder/CurrentIndex", currentIndex());
// OPENMV-DIFF //
settings->setValue("OutputPanePlaceHolder/Visible", OutputPanePlaceHolder::isCurrentVisible());
// OPENMV-DIFF //
}

void OutputPaneManager::clearPage()
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/coreplugin/outputpanemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public slots:
QStackedWidget *m_opToolBarWidgets = nullptr;
QWidget *m_buttonsWidget = nullptr;
int m_outputPaneHeightSetting = 0;
// OPENMV-DIFF //
bool m_outputPaneVisibleOnStartup = false;
// OPENMV-DIFF //
};

class BadgeLabel
Expand Down

0 comments on commit a972ecd

Please sign in to comment.