Refactored insight startup code to accommodate on-demand activation.

Also created new event for activation request
This commit is contained in:
Nav
2023-05-24 23:12:36 +01:00
parent 088a8e30ae
commit f980d960b7
8 changed files with 118 additions and 26 deletions

View File

@@ -66,6 +66,11 @@ namespace Bloom
this->shutdown();
}
void Insight::showMainWindow() {
this->mainWindow->show();
this->mainWindow->activateWindow();
}
void Insight::startup() {
Logger::info("Starting Insight");
this->setThreadState(ThreadState::STARTING);
@@ -102,7 +107,7 @@ namespace Bloom
std::bind(&Insight::onProgrammingModeDisabledEvent, this, std::placeholders::_1)
);
QApplication::setQuitOnLastWindowClosed(true);
QApplication::setQuitOnLastWindowClosed(false);
QApplication::setStyle(new BloomProxyStyle());
auto globalStylesheet = QFile(

View File

@@ -61,6 +61,11 @@ namespace Bloom
*/
void run();
/**
* Opens main window and obtains focus.
*/
void showMainWindow();
/**
* Shuts down Insight. Called when the user closes the Insight window or a ShutdownApplication event is fired.
*/

View File

@@ -318,6 +318,10 @@ namespace Bloom
}
void InsightWindow::showEvent(QShowEvent* event) {
if (!this->activated) {
this->activate();
}
this->adjustPanels();
this->adjustMinimumSize();
}