-
Notifications
You must be signed in to change notification settings - Fork 1
Misc fixes #15
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
Misc fixes #15
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3dff78f
chore: clean up codebase a bit
craftablescience cb46120
fix: store settings in a file next to the executable rather than syst…
craftablescience d9ebd06
fix: "load default" will load the default config file rather than alw…
craftablescience cc1022d
chore: bump version
craftablescience c38aec4
feat: migrate settings handling to separate files, allow single-click…
craftablescience b52d047
fix: opening folder entries on Linux
craftablescience e16c16d
fix: more helpers, less duplication, more checks
craftablescience 3c3d5e8
fix: no config loaded on first boot
craftablescience 476b43c
ext: bump miniz
craftablescience 5b5b089
ci: add dependabot
craftablescience 81c49fe
fix: checked original authoring tools, double-click to open is default
craftablescience 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| ci: | ||
| patterns: ["*"] | ||
| commit-message: | ||
| prefix: "ci" |
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
Submodule miniz
updated
5 files
| +2 −2 | .github/workflows/ci-fuzz.yml | |
| +1 −1 | .github/workflows/release.yml | |
| +8 −6 | CMakeLists.txt | |
| +21 −0 | ChangeLog.md | |
| +4 −4 | miniz.h |
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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #include "LaunchButton.h" | ||
|
|
||
| #include "Options.h" | ||
|
|
||
| LaunchButton::LaunchButton(QWidget* parent) | ||
| : QToolButton(parent) { | ||
| QObject::connect(this, &LaunchButton::clicked, this, [this] { | ||
| if (Options::get<bool>(BOOL_SINGLE_CLICK_TO_RUN, BOOL_SINGLE_CLICK_TO_RUN_DEFAULT)) { | ||
| emit this->launch(); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| void LaunchButton::mouseDoubleClickEvent(QMouseEvent* event) { | ||
| if (!Options::get<bool>(BOOL_SINGLE_CLICK_TO_RUN, BOOL_SINGLE_CLICK_TO_RUN_DEFAULT)) { | ||
| emit this->launch(); | ||
| } | ||
| QToolButton::mouseDoubleClickEvent(event); | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include "Options.h" | ||
|
|
||
| #include "Config.h" | ||
|
|
||
| QSettings& Options::get() { | ||
| static QSettings s{QString{"%1.ini"}.arg(PROJECT_TARGET_NAME.data()), QSettings::Format::IniFormat}; | ||
| return s; | ||
| } | ||
|
|
||
| bool Options::contains(std::string_view key) { | ||
| return get().contains(key); | ||
| } | ||
|
|
||
| void Options::remove(std::string_view key) { | ||
| get().remove(key); | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #pragma once | ||
|
|
||
| #include <QSettings> | ||
|
|
||
| constexpr std::string_view STR_RECENT_CONFIGS = "str_recent_configs"; | ||
| constexpr std::string_view STR_GAME_OVERRIDE = "str_game_override"; | ||
|
|
||
| constexpr std::string_view BOOL_SINGLE_CLICK_TO_RUN = "opt_single_click_to_run"; | ||
| constexpr bool BOOL_SINGLE_CLICK_TO_RUN_DEFAULT = false; | ||
|
|
||
| namespace Options { | ||
|
|
||
| [[nodiscard]] QSettings& get(); | ||
|
|
||
| [[nodiscard]] bool contains(std::string_view key); | ||
|
|
||
| template<typename T> | ||
| [[nodiscard]] T get(std::string_view key, T value = {}) { | ||
| return qvariant_cast<T>(get().value(key, value)); | ||
| } | ||
|
|
||
| void set(std::string_view key, auto value) { | ||
| get().setValue(key, value); | ||
| } | ||
|
|
||
| void remove(std::string_view key); | ||
|
|
||
| } // namespace Options |
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
Oops, something went wrong.
Oops, something went wrong.
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.