Skip to content

Commit d578816

Browse files
committed
- BridgeSettings IP now defaults to 127.0.0.1
- Improved path guessing in SourceControl
1 parent 6f4d7d0 commit d578816

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

External/Plugins/BridgeSettings/Settings.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ namespace BridgeSettings
1111
[Serializable]
1212
class Settings : IBridgeSettings
1313
{
14-
const string DEFAULT_SHARED_DRIVE = "Y:\\";
1514
const int DEFAULT_PORT_NUM = 8009;
15+
const string DEFAULT_IP = "127.0.0.1";
16+
const string DEFAULT_SHARED_DRIVE = "Y:\\";
1617
static private string[] DEFAULT_EXTENSIONS = { ".exe", ".com", ".bat", ".cmd" };
1718

1819
private bool active = false;
19-
private string ip;
20+
private string ip = DEFAULT_IP;
2021
private int port = DEFAULT_PORT_NUM;
2122
private bool targetRemoteIDE = true;
2223
private bool useRemoteExplorer = true;
@@ -33,7 +34,7 @@ public bool Active
3334
[DisplayName("Custom Bridge IP"), LocalizedDescription("BridgeSettings.Description.CustomBridgeIP"), DefaultValue("")]
3435
public string CustomIP
3536
{
36-
get { return ip ?? ""; }
37+
get { return ip ?? DEFAULT_IP; }
3738
set { ip = value; }
3839
}
3940

@@ -65,7 +66,9 @@ public string SharedDrive
6566
set
6667
{
6768
if (Regex.IsMatch(value ?? "", "[H-Z]:\\\\", RegexOptions.IgnoreCase))
69+
{
6870
sharedDrive = Char.ToUpper(value[0]) + ":\\";
71+
}
6972
}
7073
}
7174

External/Plugins/SourceControl/PluginMain.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,59 @@ public void LoadSettings()
327327
Object obj = ObjectSerializer.Deserialize(this.settingFilename, settingObject);
328328
settingObject = (Settings)obj;
329329
}
330+
331+
#region Detect Git
332+
333+
// Try to find git path from program files
334+
if (settingObject.GITPath == "git.exe")
335+
{
336+
String programFiles = Environment.GetEnvironmentVariable("ProgramFiles");
337+
String gitPath = Path.Combine(programFiles, @"Git\bin\git.exe");
338+
if (File.Exists(gitPath)) settingObject.GITPath = gitPath;
339+
340+
}
341+
// Try to find TortoiseProc path from program files
342+
if (settingObject.TortoiseGITProcPath == "TortoiseGitProc.exe")
343+
{
344+
String programFiles = Environment.GetEnvironmentVariable("ProgramFiles");
345+
String torProcPath = Path.Combine(programFiles, @"TortoiseGit\bin\TortoiseGitProc.exe");
346+
if (File.Exists(torProcPath)) settingObject.TortoiseGITProcPath = torProcPath;
347+
}
348+
349+
#endregion
350+
351+
#region Detect SVN
352+
330353
// Try to find svn path from: Tools/sliksvn/
331354
if (settingObject.SVNPath == "svn.exe")
332355
{
333356
String svnCmdPath = @"Tools\sliksvn\bin\svn.exe";
334357
if (PathHelper.ResolvePath(svnCmdPath) != null) settingObject.SVNPath = svnCmdPath;
335358
}
359+
// Try to find sliksvn path from program files
360+
if (settingObject.SVNPath == "svn.exe")
361+
{
362+
String programFiles = Environment.GetEnvironmentVariable("ProgramFiles");
363+
String slSvnPath = Path.Combine(programFiles, @"SlikSVN\bin\svn.exe");
364+
if (File.Exists(slSvnPath)) settingObject.SVNPath = slSvnPath;
365+
}
366+
// Try to find svn from TortoiseSVN
367+
if (settingObject.SVNPath == "svn.exe")
368+
{
369+
String programFiles = Environment.GetEnvironmentVariable("ProgramFiles");
370+
String torSvnPath = Path.Combine(programFiles, @"TortoiseSVN\bin\svn.exe");
371+
if (File.Exists(torSvnPath)) settingObject.SVNPath = torSvnPath;
372+
}
336373
// Try to find TortoiseProc path from program files
337374
if (settingObject.TortoiseSVNProcPath == "TortoiseProc.exe")
338375
{
339376
String programFiles = Environment.GetEnvironmentVariable("ProgramFiles");
340377
String torProcPath = Path.Combine(programFiles, @"TortoiseSVN\bin\TortoiseProc.exe");
341378
if (File.Exists(torProcPath)) settingObject.TortoiseSVNProcPath = torProcPath;
342379
}
380+
381+
#endregion
382+
343383
CheckPathExists(settingObject.SVNPath, "TortoiseSVN (svn)");
344384
CheckPathExists(settingObject.TortoiseSVNProcPath, "TortoiseSVN (Proc)");
345385
CheckPathExists(settingObject.GITPath, "TortoiseGit (git)");

0 commit comments

Comments
 (0)