Commit graph

94 commits

Author SHA1 Message Date
Jack251970
a99b8399fe Improve code quality 2026-02-21 14:51:20 +08:00
DB P
7e9a626891 style: fix indentation and tab spacing 2026-02-20 17:40:27 +09:00
DB P
cecd90e675 Refactor: Improve power action logic and property setter
- Add braces for better readability in shutdown/reboot logic (Main.cs).
- Prevent redundant OnPropertyChanged calls in _skipPowerActionConfirmation setter (Settings.cs).
2026-02-20 17:34:37 +09:00
DB P
2d7d025682 Add Skip logic in command 2026-02-20 17:18:21 +09:00
Jack251970
d4f472a64e Update AdjustTokenPrivileges PInvoke usage
Refactored the AdjustTokenPrivileges call to use null for the previous state and an out variable for the return length, improving compatibility with the PInvoke signature and aligning with recommended usage.
2026-02-05 20:28:37 +08:00
Jack Ye
5b0a30774e
Fix code comment typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-02 19:45:08 +08:00
Jack251970
d08ee30a7a Refactor plugin actions to simplify logic
Removed logoff operation logic and associated return statement.
Eliminated return statement after recycle bin error handling.
Removed async plugin data reload and success message logic.
Simplified theme selector query handling by removing `return false`.
These changes streamline the code and improve maintainability.
2025-10-02 19:43:31 +08:00
Jack251970
167570559f Move settings save to post-confirmation for actions
Previously, `Context.API.SaveAppAllSettings()` was called unconditionally before user confirmation for shutdown, restart, and advanced restart actions. This change ensures settings are only saved if the user confirms the action by clicking "Yes" in the confirmation dialog.

For all three functionalities:
- Moved the settings save call inside the `if (result == MessageBoxResult.Yes)` block.
- Retained the existing logic for executing the respective system commands, with checks for `EnableShutdownPrivilege()` to determine whether to use `PInvoke.ExitWindowsEx` or the `shutdown` command.

This change prevents unnecessary settings saves when the user cancels the action.
2025-10-02 19:42:24 +08:00
Jack251970
e376da4482 Save settings before shutdown/restart to prevent data loss
Added a call to `Context.API.SaveAppAllSettings()` before executing system shutdown, restart, or advanced restart operations. This ensures that any unsaved settings are persisted, reducing the risk of data loss during these actions.
2025-10-02 19:29:46 +08:00
Jack Ye
5b6ea73513
Code cleanup & Use Flow.Launcher.Localization to improve code quality (#4009)
* Use Flow.Launcher.Localization to improve code quality

* Code cleanup

* Improve code quality

* Improve code quality

* Use internal static Context & Improve code quality

* Use Flow.Launcher.Localization to improve code quality

* Code cleanup

* Use Flow.Launcher.Localization to improve code quality

* Improve code quality

* Improve code quality

* Use Flow.Launcher.Localization to improve code quality

* Fix logic issue

* Fix the variable name typo

* Fix redundant boolean cast and ensure consistent default value handling

* Use Flow.Launcher.Localization to improve code quality

* Revert namespace styles

* Fix indent format

* Revert namespace style

* Fix indent format

* Fix namespace style

* Fix indent format

* Fix indent format
2025-09-27 19:18:33 +03:00
Jack251970
b6ecfdcf63 Remove project reference in Sys plugin to Flow.Launcher.Infrastructure 2025-07-20 09:58:30 +08:00
Jack251970
365dd5ee17 Use translation for constant strings 2025-07-20 09:42:32 +08:00
Jack251970
9f63291fda Improve setting dialog command 2025-07-20 09:35:29 +08:00
Jack251970
539a852363 Improve logic 2025-07-15 21:59:40 +08:00
Jack251970
aece803905 Simplify logic 2025-07-15 21:50:41 +08:00
WayneFerdon
a34b8f2630 [Plugin.Sys Enhancement] Support returning all usable commands while query is empty; ChangeQuery by ThemeSelector Action with ActionKeyword at the front as well 2025-07-15 21:22:19 +08:00
Jack251970
c382732f97 Improve windows exiting 2025-04-15 12:49:09 +08:00
Jack251970
9c07989edf Improve code quality 2025-04-09 12:14:07 +08:00
Jack Ye
be966b7a9e
Merge pull request #3272 from Jack251970/plugin_settings_cache_path
Improve Plugin Metadata & Path Management
2025-03-30 08:27:05 +08:00
DB p
c2d1b30240 Add and adjust glyph icon for sys plugin 2025-03-29 06:05:23 +09:00
Jack251970
b0b1a2661a Fix build issue & Cleanup codes 2025-03-16 20:26:06 +08:00
Jack Ye
c690e591ff
Merge branch 'dev' into plugin_settings_cache_path 2025-03-16 19:42:58 +08:00
Jack251970
ab3cd8a329 Use largest score from title & subtitle & keyword 2025-03-14 15:32:23 +08:00
Jack251970
0f279df8d3 Add title & subtitle search 2025-03-13 23:57:52 +08:00
Jack251970
e196d7cfa9 Improve keyword search 2025-03-13 23:43:01 +08:00
Jack251970
2a5b22b938 Add command keyword change dialog & Support culture change 2025-03-13 23:29:00 +08:00
Jack251970
e0f02a0d7b Initialize localized grid & Edit button 2025-03-13 22:34:50 +08:00
Jack251970
bc0cde289c Add translations for system plugin command column 2025-03-13 18:20:25 +08:00
Jack Ye
bad304b38f Query themes every time 2025-03-12 21:50:39 +08:00
Jack Ye
468c0b23c0 Change ico & glyph 2025-03-12 18:54:43 +08:00
Jack Ye
a2372d843a
Merge branch 'dev' into flow-theme-selector-plugin 2025-03-12 18:24:01 +08:00
Jack251970
601211173c Add log directory & version log directory & themes directory in data location 2025-02-24 13:17:02 +08:00
Jack Ye
1a54eed7ed
Merge pull request #3250 from Jack251970/sys_shutdown_restart_hibernate
Improve Shutdown & Restart & Hibernate in Sys Plugin
2025-02-19 16:33:12 +08:00
Jack251970
9284c559f6 Use api function to hide window 2025-02-18 11:41:26 +08:00
Jack251970
3bd4ca4105 Replace hiberate with PInvoke 2025-02-18 11:17:45 +08:00
Jack251970
a065179d53 Use PInvoke for const 2025-02-18 11:12:33 +08:00
Jack251970
648e3f2689 Improve code quality 2025-02-18 11:07:18 +08:00
Jack251970
1809314842 Enable shutdown privilege before calling PInvoke for shutdown and start 2025-02-18 00:08:15 +08:00
Jack251970
e93699b37d Add shutdown reason 2025-02-17 23:37:20 +08:00
Jack251970
ffa303825e Replace process commands with PInvoke 2025-02-17 23:22:06 +08:00
Jack251970
827b6edb38 Improve code quality 2025-02-17 23:12:46 +08:00
Jeremy Wu
fe8bb6b683
Merge branch 'dev' into flow-theme-selector-plugin 2025-01-18 21:26:10 +11:00
Jack251970
1073821b65 Improve recyble bin clear issue noticification 2024-12-20 18:55:57 +08:00
Jeremy Wu
9fb0233b6d
Merge branch 'dev' into dev3 2024-12-19 22:08:12 +11:00
Jeremy Wu
86fc68b44b
Merge pull request #3114 from cibere/sys-plugin-add-copy-text
add CopyText and AutoCompleteText to some results in the sys plugin
2024-12-12 21:20:22 +11:00
cibere
fe4fcf6cc0 remove AutoCompleteText from the Open Recycle Bin result in sys plugin 2024-12-11 10:53:25 -08:00
Jack251970
a395936a6c Replace FormApplication & DllImport with CSWin32 2024-12-10 11:56:32 +08:00
cibere
29c9fd69ad add AutoCompleteText key to some results in the sys plugin 2024-12-07 14:45:32 -08:00
cibere
6410853e34 add CopyText to recyclebin, log folder, flow tips, and userdata folder results in sys plugin 2024-12-07 14:38:28 -08:00
Jack251970
534a1117aa Use public api to call ShowMsgBox functions & remove useless Core project import 2024-11-27 12:21:34 +08:00