Skip to content

Commit c7567a3

Browse files
committed
Fix: Prevent extra windows when creating backups
- Removed automatic opening of backup file in text editor - Improved error handling for folder opening - Enhanced success message with full backup path
1 parent 0598cd6 commit c7567a3

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

QuickNotes/Community.PowerToys.Run.Plugin.QuickNotes/Main.cs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -974,29 +974,28 @@ private List<Result> BackupNotes()
974974
File.Copy(_notesPath, backupFileName, true);
975975

976976
// Open the folder in Explorer
977-
var folderProcess = new Process
977+
try
978978
{
979-
StartInfo = new ProcessStartInfo
979+
var folderProcess = new Process
980980
{
981-
FileName = notesDir,
982-
UseShellExecute = true,
983-
Verb = "open"
984-
}
985-
};
986-
folderProcess.Start();
987-
988-
// Also open the backup file itself in default text editor
989-
var fileProcess = new Process
981+
StartInfo = new ProcessStartInfo
982+
{
983+
FileName = notesDir,
984+
UseShellExecute = true,
985+
Verb = "open"
986+
}
987+
};
988+
folderProcess.Start();
989+
}
990+
catch (Exception ex)
990991
{
991-
StartInfo = new ProcessStartInfo
992-
{
993-
FileName = backupFileName,
994-
UseShellExecute = true
995-
}
996-
};
997-
fileProcess.Start();
992+
// If we can't open the folder, just continue with the backup
993+
Log.Exception("Failed to open backup folder", ex, GetType());
994+
}
998995

999-
return SingleInfoResult("Backup created", $"Backup saved to {Path.GetFileName(backupFileName)} in QuickNotes folder.", true);
996+
return SingleInfoResult("Backup created",
997+
$"Backup saved to: {backupFileName}\n\n" +
998+
"The backup folder has been opened for you.", true);
1000999
}
10011000
catch (Exception ex)
10021001
{

QuickNotes/Community.PowerToys.Run.Plugin.QuickNotes/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"IsGlobal": false,
55
"Name": "QuickNotes",
66
"Author": "ruslanlap",
7-
"Version": "0.1.0",
7+
"Version": "0.1.1",
88
"Language": "csharp",
99
"Website": "https://github.com/ruslanlap/PowerToysRun-QuickNotes",
1010
"ExecuteFileName": "Community.PowerToys.Run.Plugin.QuickNotes.dll",

0 commit comments

Comments
 (0)