- added option to open Wox Settings from the tray menu

- added a checkbox option specifying whether to leave the command line open after having run a command like >ping google.com
This commit is contained in:
kerams
2014-04-10 23:44:57 +02:00
parent b8f513fffe
commit e0eb8c83e2
5 changed files with 41 additions and 3 deletions

View File

@@ -68,6 +68,9 @@ namespace Wox.Infrastructure.Storage.UserSettings
[JsonProperty]
public OpacityMode OpacityMode { get; set; }
[JsonProperty]
public bool LeaveCmdOpen { get; set; }
public List<WebSearch> LoadDefaultWebSearches()
{
List<WebSearch> webSearches = new List<WebSearch>();
@@ -137,7 +140,8 @@ namespace Wox.Infrastructure.Storage.UserSettings
QueryBoxFont = FontFamily.GenericSansSerif.Name;
ResultItemFont = FontFamily.GenericSansSerif.Name;
Opacity = 1;
OpacityMode = OpacityMode.Normal;
OpacityMode = OpacityMode.Normal;
LeaveCmdOpen = false;
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
using Wox.Infrastructure.Storage.UserSettings;
namespace Wox.Infrastructure
{
@@ -102,7 +103,21 @@ namespace Wox.Infrastructure
startDir = dir;
}
global::System.Diagnostics.ProcessStartInfo startInfo = new global::System.Diagnostics.ProcessStartInfo();
if (UserSettingStorage.Instance.LeaveCmdOpen)
{
string cmdExe;
string dummy;
EvaluateSystemAndUserCommandLine("cmd.exe", startDir, out cmdExe, out dummy, dwSeclFlags);
// check whether user typed >cmd, because we don't want to create 2 nested shells
if (cmdExe != cmd)
{
args = string.Format("/k {0} {1}", cmd, args);
cmd = cmdExe;
}
}
global::System.Diagnostics.ProcessStartInfo startInfo = new global::System.Diagnostics.ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.Arguments = args;
startInfo.FileName = cmd;