Refactored insight startup code to accommodate on-demand activation.
Also created new event for activation request
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -318,6 +318,10 @@ namespace Bloom
|
||||
}
|
||||
|
||||
void InsightWindow::showEvent(QShowEvent* event) {
|
||||
if (!this->activated) {
|
||||
this->activate();
|
||||
}
|
||||
|
||||
this->adjustPanels();
|
||||
this->adjustMinimumSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user