Commit graph

32 commits

Author SHA1 Message Date
Ian O'Neill 31a5d49246
Fix race-condition in PowerRename progress UI (#12771) 2021-08-18 12:20:51 +01:00
Chris Davis bf6dcf40ef
Ensure the lifetime of CPowerRenameProcessUI on the worker thread (#11106)
* Ensure the lifetime of CPowerRenameProcessUI on the worker thread to prevent AV during shutdown

* Ensure worker thread progress dialog pointer is valid.  Also add a call to StopProgressDialog from the worker thread as the progress dialog can be particular about thread affinity for that method call.

Co-authored-by: Chris Davis (EDGE) <chrdavis@microsoft.com>
2021-05-05 11:46:13 +02:00
Enrico Giordani 0c3ce81c94
[KBM Editor] Support WM_DPICHANGED event (#11015)
* [KBM Editor] Support WM_DPICHANGED event

* [spell checker] add term

* [KBM editor] properly cast new DPI value
2021-04-30 16:04:53 +02:00
Clare DuVal 0a6de4561f
[PowerRename] Add option for Capitalization (#10213)
* Add camelcase instances + helper translation

* Add camel case testing

* Update Helpers.cpp

* Update PowerRenameUI.cpp

* Update src/modules/powerrename/ui/PowerRenameUI.cpp

Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>

* Change camel case to capitalized, move ui

* Update PowerRenameManagerTests.cpp

* Update PowerRenameUI.base.rc

* Update PowerRenameUI.base.rc

Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-04-09 14:24:06 +02:00
Chris Davis d128939227
Show progress dialog during startup (#9255)
* Show progress dialog during startup for selection enumeration that can take a long time.

* Updated with better code organization and a timer to ensure the progress dialog does not appear in most cases.

* Update based on PR feedback

* Change progress dialog delay from 1500ms to 2500ms

* Move progress dialog invocation off the main UI thread

Co-authored-by: Chris Davis (EDGE) <chrdavis@microsoft.com>
2021-04-02 12:07:12 +02:00
Andrey Nekrasov 212ea2de30
common: refactor common library pt2 (#8588)
- remove common lib
- split settings, remove common-md
- move ipc interop/kb_layout to interop
- rename core -> settings, settings -> old_settings
- os-detect header-only; interop -> PowerToysInterop
- split notifications, move single-use headers where they're used
- winstore lib
- rename com utils
- rename Updating and Telemetry projects
- rename core -> settings-ui and remove examples folder
- rename settings-ui folder + consisent common/version include
2020-12-15 15:16:09 +03:00
Mehmet Murat Akburak da22e21a0e
[PowerRename] Fix tests inconsistency, improve test performance (#8129)
* Move retrieveing file attibutes to PowerRenameRegex
Move file attributes unit tests to PowerRenameRegexTests
Add file time field to MockPowerRenameItem

* Add file attributes unittests to PowerRenameManagerTests

* Change variable name

* Rearrange function arguments

* Check if file attributes are used only once

* Change variable name LocalTime -> fileTime, date -> time

* Set fileTime as a member of PowerRenameRegEx rather than passing as an argument

* Change function name isFileAttributesUsed() -> isFileTimeUsed()
Check before resetting fileTime

* Fix small bugs

* Fix typos

* Refactor for readability, move free calls to reachable places

* Fix search for area empty bug
searchTerm being empty is not an invalid argument rather it must return OK without any operation
Tests must check if Replace()  returns S_OK becuase later it checks its result

* Check return values of method calls in PowerRenameManager
Remove received argments checks from some methods because argument being null or empty string doesnt mean it is invalid or method fails

* Fix formatting. Remove overlooked comment. Fix error message.

* Change HRESULT declarations according to coding style

* Fix unhandled case. Refactor.
2020-12-14 10:28:12 +01:00
Mehmet Murat Akburak 7ff8b97006
[PowerRename] Split "status message" / "items count label" into two lines (#7696)
* Split status message

* Use spaces instead of tabs
2020-10-31 11:25:16 +03:00
Mehmet Murat Akburak d3b80b26e3
[PowerRename] Add Filtering Feature (#6017)
* Implement basic functionality

* Change approach.
move filter controls to manager
edit redrawing to always work with new GetVisibleItemCount() and GetVisibleItemByIndex() calls

* Fix performance issues. Some refactoring.

* Handle toggleAll correctly

* Handle dangling elements when filter is on

Make an item visible if it has at least one visible subitem

* Support filtering for selected and shouldRename

* Refactor for readability, remove useless member from PowerRenameUI

* Change variable names in PowerRenameUI for clarity

Use wrapper function RedrawItems() and SetItemCount() for consistency

* Handle result value properly in getVisibleItemByIndex()

* Add FlagsApplicable filter

* Add visual indication of filters

* Improve performance

Check if no filter is selected
Call SetItemCount() only when necessary

* Refactor for readability

* Get lock in setVisible()

* Change function names to camel case

* Change function names to start with uppercase

* Change filter behaviour when search area is empty

Show all elements when search area is empty and ShouldRename filter is selected
Avoid warnings

* Resolve conflicts
2020-08-25 08:22:05 +03:00
Arjun Balgovind 3ede1a0b53
[Localization] Migrate resources to resx for PowerRename (#6112)
* Added localization code to pipeline and created one LocProject json for Settings

* Fixed typo

* Reordered nuget source

* Moved nuget install to restore step

* Added FZ.rc file to LocProj

* Added FZ resx file and modified rc file

* Fixed file names

* Changed to check folder for LocProject files

* Updated folder

* Changed directory

* Changed to src directory

* Changed language set and name format, removed rc file localization

* Added all projects with resx/resw files

* Added newline to end of file

* Removed nuget source as it is not used

* Updated comments

* Updated keyboard manager to use resx file

* Tweaked resources.resx and added it to project files

* Added comments and added in string table to resx script

* Remove change from bad merge

* Fix syntax error in convert stringtable

* Changed file type to None

* Migrated color picker's resources

* Migrated resources for Microsoft.Launcher

* Migrated resources for fancy zones

* Revert fancyzones changes

* Migrated resources for ImageResizer and modified script to add language specific code

* Added try catch and checks for modification to avoid unnecessary file creation

* Changed tab insertion to 4 spaces to avoid mixed file types in rc file

* Migrated resources for power preview project

* Added LocProject.json file for 5 projects

* added resgen exception check

* Moved non-localizable strings out of resx for powerpreview

* Move out hardcoded strings from dialog box and set them at runtime from string table

* Migrated resources for powerrename

* Added locproj

* Added missing ImageBase extern declaration

* Added build script in UWP UI project since PowerRenameExt is not referenced

* Resolved merge conflicts
2020-08-24 17:51:48 -07:00
Mehmet Murat Akburak 30f442d774
[PowerRename] upper/lower/titlecase transform feature (#4183)
* Add basic transform functionality

* Add basic transform functionality

* Change toupper/tolower/isspace to towupper/towlower/towisspace. For loops omitted if possible.

* Avoid wcslen() in for statement

* Avoid wcslen() in for statement

* Add basic transform functionality

* Change toupper/tolower/isspace to towupper/towlower/towisspace. For loops omitted if possible.

* Avoid wcslen() in for statement

* Avoid wcslen() in for statement

* Add basic transform functionality

* Change toupper/tolower/isspace to towupper/towlower/towisspace. For loops omitted if possible.

* Avoid wcslen() in for statement

* Adjust Powerrename Interface

* Add trimming rename string

* Remove leading and trailing spaces from rename string

* Add support for transforming only item name or extension. Temporarily remove trimming to refactor. Change CAPITALIZED to TITLECASE

* Fix bug when search for area is empty

* Add trimming back with refactor(leading spaces, trailing spaces, trailing dots)

* Now supports transforming when search area is empty

* Add smarter titlecase

Transformation breaks when new filename contains an unusable character (\/?:*?"<>|)
These characters need to be removed from new name anyway.

* minor bugfix

* Add unittests, contains failing tests

* Remove unnecessary/failing tests

* remove generated file

* some code formatting and fix memory leak issues

* Use proper allocation, change int to size_t

* Refactor. Move transforming to Helpers.cpp

* Refactor. Move trimming to Helpers.cpp

* Change StrDup to SHStrDup. Some refactoring.

* Fix memery leak, add proper result controls, use newNameToUse in functon calls becaause it is where the final form of the string is tracked

* Change declarations of strings, add proper result controls

* Slightly widen the labels to cover the whole text

* Add extended characters support

* Rename a variable

* Correctly identify the last word for titlecase

* Add empty line to last line of resource.h
2020-07-02 11:52:01 +03:00
Clint Rutkas 67c8d80190
Safeguarding end user links in settings (#4226)
* first adjustment to wiki move

* Image Resizer and deleting imgs for FZ

* updating stuff to aka links

* updating app to leverage aka links

* moving files to wiki

* KBM adjustment

* updating

* getting PT Run moved over

* Shortcut guide and fixing launcher's readme text

* Update README.md

* img for shortcut guide moved to wiki

* updated setting img to be aka link as well
2020-06-11 10:16:39 -07:00
Josh Soref b1554ebf37
Spelling: ... src/modules (#3712) 2020-05-26 16:56:25 +02:00
Rafael Rivera d16ebba9e0
Move from sdk-provided cppwinrt-1.x to cppwinrt-2.x nuget package (#2246) 2020-04-29 22:02:18 +02:00
vldmr11080 aa6cb7d650
Migrate power rename MRU lists from registry to JSON (#2090)
* Handle most recently used search/replace strings within settings.

* Check for last modified time of json file and reload it if needed.

* Handle changes in MRU search / replace lists size.

* Improve handling of changes in MRU list size.

* Don't check for last modified time in every getter method. Load only when starting application.

* Add const identifier to getter methods.

* Address PR comments: Add const to reg and json file paths and set them in constructor initializer. Check pushIdx validity. Move implementation to cpp of PowerRenameUI constructor.

* Add error checking when getting values from registry.
2020-04-15 23:14:17 +02:00
vldmr11080 c355a2b61e
Use JSON data file for storing PowerRename settings instead of registry (#1909)
* Use JSON data file for storing PowerRename settings instead of registry

* Address PR comments and made several improvements

* Remove WindowsApp.lib dependencies in test app and unit tests

* Revert changes in vcxproj for unit test

* Solve linker warnings generated while linking WindowsApp.lib

* Don't migrate enabled flag. Always read / write from registry.
2020-04-08 19:12:46 +02:00
PrzemyslawTusinski f9a756d1ff
FancyZones editor display zone numbers & PowerRename fix (#1726)
* Fix for issue #1218

Design Change: Default Enter Action

* Fix for issue #1085

* change zone's number color and font
remove the light blue background

* Fix for disappearing zone number in editor

* Grid layout reversed order fix

Co-authored-by: sqrlmn <sqrlmn@users.noreply.github.com>
Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
2020-03-27 13:07:19 +01:00
stefansjfw 6a0061dde3
Fix PowerRename UI doesn't handling DPI changes (#1424)
* Fix PowerRename UI doesn't handling DPI changes

* Address PR comments

* Address PR comments
2020-03-05 10:21:25 +01:00
yuyoyuppe 9607888fc5 PowerRename: bring the rename dialog to foreground 2020-02-17 18:38:14 +03:00
Seraphima 59d218d623
Add telemetry event for PowerRename settings (#1279)
* moved MAX_INPUT_STRING_LEN constant
* added settings changed event log
2020-02-13 12:44:03 +03:00
Chris Davis 3ffd007cc0
Ensure previous search and replace texts are evaluated and updated in the UI at startup (#1043)
Ensure stored settings get evaluated after initial enumeration

There was a bug where the list view was not getting updated with the results of the search and replace on launch when we are using a stored search or replace text from a previous session.
2020-01-04 00:39:02 -08:00
yuyoyuppe 62c65659cc format changed files 2019-12-24 17:06:10 +03:00
yuyoyuppe 249addebff powerrename: implement shellext support for UWP 2019-12-24 17:06:10 +03:00
Chris Davis 8e8be502fd
Handle DPI change gracefully (#786)
* Ensure icon in context menu is not leaked

* Hande theme/dpi size change gracefully
2019-11-26 19:45:18 -08:00
Chris Davis e328c5d505 * Fix crashing bug in event vector cleanup
* Fix warnings in settings.cpp
* Add settings to ui of powertoys
2019-11-11 20:58:39 -08:00
Chris Davis 1e89054897 * Ensure rename dialog is centered
* Ensure children are renamed before parent items
* Add settings handler
* Replace old text referencing smart rename with power rename
2019-11-11 11:00:42 -08:00
Chris Davis 997ea3a2f5 A couple minor bug fixes 2019-11-09 00:30:00 -08:00
Chris Davis 389590e45d Ensure columns are resized when the dialog is resized. Also switch to a modeless experience instead of modal for the dialog. We no longer disable the parent window. 2019-11-03 22:22:35 -08:00
Chris Davis cc7a706f52 Fix painting issue with buttons after resize 2019-11-01 08:52:54 -07:00
Chris Davis d4256dad30 Allow resizing of PowerRename dialog 2019-10-31 23:57:42 -07:00
Chris Davis c1957272ea
Bug Fixes for PowerRename (#614)
* Bug Fixes

Fixes include:
* Pass parent HWND to UI so dialog is no longer appearing in top corner all the time
* Fix duplicate entries for PowerRename in context menu for shortcuts
* Fix crashing bug due to telemetry not getting unregistered on unload
* Ensure we show the file extension in the UI even if extensions are hidden in Windows Explorer

* Update PowerRenameExt.cpp

Fix missed line to set parent HWND
2019-10-31 06:57:38 -07:00
Chris Davis e1d5dd263a
Initial add of PowerRename from SmartRename repo (#499)
* Initial add of PowerRename from SmartRename repo
2019-10-17 20:57:19 -07:00