-
Notifications
You must be signed in to change notification settings - Fork 10.4k
ui: singleton uistate #22789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
ui: singleton uistate #22789
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ba48a63
singleton uistate
deanlee ed80fb9
merge master
deanlee b5c7736
merge master
deanlee ea3eab1
merge master
deanlee d390a3c
Merge branch 'master' into ui_singleton_state
deanlee 14077f2
merge master
deanlee f73bb6d
merge master
deanlee e7ecea4
merge master
deanlee 79968d1
Merge branch 'master' into ui_singleton_state
deanlee afaaa8c
Merge branch 'master' into ui_singleton_state
deanlee a23cb7a
merge master
deanlee 9cf661a
Merge branch 'master' into ui_singleton_state
deanlee 5405846
connect uistate in sidebar
deanlee 551c083
move to device
deanlee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,14 +12,10 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { | |
| main_layout->addWidget(homeWindow); | ||
| QObject::connect(homeWindow, &HomeWindow::openSettings, this, &MainWindow::openSettings); | ||
| QObject::connect(homeWindow, &HomeWindow::closeSettings, this, &MainWindow::closeSettings); | ||
| QObject::connect(&qs, &QUIState::uiUpdate, homeWindow, &HomeWindow::update); | ||
| QObject::connect(&qs, &QUIState::offroadTransition, homeWindow, &HomeWindow::offroadTransition); | ||
| QObject::connect(&qs, &QUIState::offroadTransition, homeWindow, &HomeWindow::offroadTransitionSignal); | ||
|
|
||
| settingsWindow = new SettingsWindow(this); | ||
| main_layout->addWidget(settingsWindow); | ||
| QObject::connect(settingsWindow, &SettingsWindow::closeSettings, this, &MainWindow::closeSettings); | ||
| QObject::connect(&qs, &QUIState::offroadTransition, settingsWindow, &SettingsWindow::offroadTransition); | ||
| QObject::connect(settingsWindow, &SettingsWindow::reviewTrainingGuide, [=]() { | ||
| onboardingWindow->showTrainingGuide(); | ||
| main_layout->setCurrentWidget(onboardingWindow); | ||
|
|
@@ -37,8 +33,8 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { | |
| main_layout->setCurrentWidget(onboardingWindow); | ||
| } | ||
|
|
||
| QObject::connect(&qs, &QUIState::uiUpdate, &device, &Device::update); | ||
| QObject::connect(&qs, &QUIState::offroadTransition, [=](bool offroad) { | ||
| QObject::connect(uiState(), &UIState::uiUpdate, &device, &Device::update); | ||
|
||
| QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) { | ||
| if (!offroad) { | ||
| closeSettings(); | ||
| } | ||
|
|
@@ -79,7 +75,7 @@ void MainWindow::openSettings() { | |
| void MainWindow::closeSettings() { | ||
| main_layout->setCurrentWidget(homeWindow); | ||
|
|
||
| if (QUIState::ui_state.scene.started) { | ||
| if (uiState()->scene.started) { | ||
| homeWindow->showSidebar(false); | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.