Skip to content

Commit

Permalink
Update application startup tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Jan 9, 2024
1 parent b5a1ebc commit a02d694
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,24 @@ class MainApplication : public juce::JUCEApplication {
);
};

void addCoreCallback() {
InitTaskList::getInstance()->add(
[splash = Splash::SafePointer<Splash>(this->splash.get())] {
if (splash) { splash->showMessage("Register Core Callbacks..."); }
}
);
InitTaskList::getInstance()->add(
[] {
CoreCallbacks::getInstance()->addError(
[](const juce::String& title, const juce::String& mes) {
juce::AlertWindow::showMessageBox(
juce::MessageBoxIconType::WarningIcon, title, mes);
}
);
}
);
};

void autoLayout() {
InitTaskList::getInstance()->add(
[splash = Splash::SafePointer<Splash>(this->splash.get())] {
Expand Down Expand Up @@ -374,24 +392,6 @@ class MainApplication : public juce::JUCEApplication {
);
};

void addCoreCallback() {
InitTaskList::getInstance()->add(
[splash = Splash::SafePointer<Splash>(this->splash.get())] {
if (splash) { splash->showMessage("Register Core Callbacks..."); }
}
);
InitTaskList::getInstance()->add(
[] {
CoreCallbacks::getInstance()->addError(
[](const juce::String& title, const juce::String& mes) {
juce::AlertWindow::showMessageBox(
juce::MessageBoxIconType::WarningIcon, title, mes);
}
);
}
);
};

void hideSplash() {
InitTaskList::getInstance()->add(
[splash = Splash::SafePointer<Splash>(this->splash.get())] {
Expand Down Expand Up @@ -496,6 +496,9 @@ class MainApplication : public juce::JUCEApplication {
/** Init Core Hooks */
this->initCoreHooks();

/** Add Core Callback */
this->addCoreCallback();

/** Auto Layout */
this->autoLayout();

Expand All @@ -505,9 +508,6 @@ class MainApplication : public juce::JUCEApplication {
/** Clear Dump File */
this->clearCrashDump();

/** Add Core Callback */
this->addCoreCallback();

/** Hide Splash */
this->hideSplash();

Expand Down

0 comments on commit a02d694

Please sign in to comment.