-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature: Added support for SeerPro's "Track selected file" setting #15339
Conversation
626e1c6
to
b62192e
Compare
Fyi @ccseer |
0c1deac
to
de9894b
Compare
cool. thx.
…On Thu, May 9, 2024, 10:33 PM Yair ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs
<#15339 (comment)>
:
> + if (_isTrackSelectionSettingEnabledCache is null)
+ _isTrackSelectionSettingEnabledCache = DetectTrackSelectionSetting().Result;
+
+ return _isTrackSelectionSettingEnabledCache.Value;
+ }
+ }
+
+ private Task<bool> DetectTrackSelectionSetting()
+ {
+ bool trackSelectedFile = true;
+
+ // List of possible paths for the Seer Pro settings file
+ string[] paths =
+ {
+ Environment.ExpandEnvironmentVariables("%USERPROFILE%\\Documents\\Seer\\uwp.ini"),
+ Environment.ExpandEnvironmentVariables("%USERPROFILE%\\appdata\\Local\\Packages\\CNABA5E861-AC2A-4523-B3C1.Seer-AWindowsQuickLookTo_p7t0z30wh4868\\LocalCache\\Local\\Corey\\Seer\\uwp.ini"),
That's included on the next line
—
Reply to this email directly, view it on GitHub
<#15339 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADZZIHRPRHUYUQFFVW2MGYLZBOCNBAVCNFSM6AAAAABHNUI2Y2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANBYGEYDKNRYGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I tested the store version and it works correct, @ccseer can you confirm this works for the win32 version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise, looks good but some parts.
src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs
Outdated
Show resolved
Hide resolved
src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs
Outdated
Show resolved
Hide resolved
Update SeerProProvider.cs Update src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs Co-Authored-By: 0x5bfa <[email protected]>
5fdfb3d
to
9ec9987
Compare
do i need to build from the source to test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I concern, what do you think?
Putting aside it, LGTM, code wise.
I didn't implement anything for the registry, I'll modify this PR to account for that possibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I just got some code from Copilot, hope it helps.
using System;
using Microsoft.Win32;
class Program
{
static void Main()
{
// Open the subkey
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Corey\Seer"))
{
if (key != null)
{
// Attempt to read the value
object value = key.GetValue("tracking_file");
if (value != null)
{
// Convert the value to a boolean
bool trackingFile = Convert.ToBoolean(value);
Console.WriteLine($"tracking_file value: {trackingFile}");
}
else
{
Console.WriteLine("The 'tracking_file' value does not exist.");
}
}
else
{
Console.WriteLine("The specified registry key does not exist.");
}
}
}
}
using System;
using System.Threading.Tasks;
using Microsoft.Win32;
public class RegistryReader
{
public Task<bool> ReadTrackingFileValueAsync()
{
var keyName = @"HKEY_CURRENT_USER\Software\Corey\Seer";
var value = Registry.GetValue(keyName, "tracking_file", null);
if (value is not null)
{
// Assuming the value is stored as an integer (0 for false, non-zero for true)
bool trackSelectedFile = Convert.ToBoolean(value);
return Task.FromResult(trackSelectedFile);
}
else
{
// Return false or handle the case where the value does not exist
return Task.FromResult(false);
}
}
} |
When I tried to test it, it crashed with the following exception:
|
@hishitetsu can you try with the latest commit? |
src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: hishitetsu <[email protected]>
Everything looks good from my end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, code wise.
It still tracks the file regardless of the settings in my environment. |
the default value is true.
if Seer is running, and the Key is not found, you can take it as true.
…On Mon, May 13, 2024, 12:24 AM hishitetsu ***@***.***> wrote:
It still tracks the file regardless of the settings in my environment.
—
Reply to this email directly, view it on GitHub
<#15339 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADZZIHXDWNBG4BBYB7SNQN3ZB6JT3AVCNFSM6AAAAABHNUI2Y2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGMYDMMJQHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Did you restart Files in between changing the setting? |
I tested with the Win32 version and confirm it's working as expected. The one thing to note is that a restart of Files is required after changing the setting in Seer. |
Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as
Ready to build
. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.