public void ApplyParam(LocalShellTerminalParam param) { _param = param; if(param is CygwinTerminalParam) this.Text = GApp.Strings.GetString("Form.CygwinLoginDialog.TextCygwin"); else this.Text = GApp.Strings.GetString("Form.CygwinLoginDialog.TextSFU"); }
internal LocalShellTerminalParam(LocalShellTerminalParam p) : base(p) { _home = p._home; _shell = p._shell; }
protected override void OnLoad(EventArgs e) { base.OnLoad (e); if(_param==null) _param = new CygwinTerminalParam(); //�f�t�H���g�l�Ŗ��߂� else _param = (LocalShellTerminalParam)_param.Clone(); _param.RenderProfile = null; _param.Caption = null; _homeDirectoryBox.Text = _param.Home; _shellBox.Text = _param.Shell; StringCollection c = GApp.ConnectionHistory.LogPaths; foreach(string p in c) _logFileBox.Items.Add(p); if(GApp.Options.DefaultLogType!=LogType.None) { _logTypeBox.SelectedIndex = (int)GApp.Options.DefaultLogType; string t = GUtil.CreateLogFileName("cygwin"); _logFileBox.Items.Add(t); _logFileBox.Text = t; } else _logTypeBox.SelectedIndex = 0; AdjustUI(); }
public Connector(LocalShellTerminalParam param, ISocketWithTimeoutClient client) { _param = param; _client = client; }
public static Connector AsyncPrepareSocket(ISocketWithTimeoutClient client, LocalShellTerminalParam param) { Connector c = new Connector(param, client); GUtil.CreateThread(new ThreadStart(c.AsyncConnect)).Start(); return c; }
public Connector(LocalShellTerminalParam param) { _param = param; }
private static bool IsCygwin(LocalShellTerminalParam tp) { return tp is CygwinTerminalParam; }
protected static void PrepareEnv(LocalShellTerminalParam p) { if(!_cygwinDLL_loaded && IsCygwin(p)) { //����̂݁Acygwin.dll�����[�h�ł���悤�Ɋ��ϐ���lj� SFU�̂Ƃ��͗]�v���� char[] buf = new char[1024]; int n = Win32.GetEnvironmentVariable("PATH", buf, buf.Length); string newval = new string(buf, 0, n) + ";" + CygwinUtil.GuessRootDirectory() + "\\bin"; Win32.SetEnvironmentVariable("PATH", newval); _cygwinDLL_loaded = true; } }
//�ڑ����Socket��������ĕԂ��B���s�����parent��e�ɂ��ăG���[��\�����Anull��Ԃ��B public static ConnectionTag PrepareSocket(IWin32Window parent, LocalShellTerminalParam param) { try { return new Connector(param).Connect(); } catch(Exception ex) { string key = IsCygwin(param)? "Message.CygwinUtil.FailedToConnect" : "Message.SFUUtil.FailedToConnect"; GUtil.Warning(parent, GEnv.Strings.GetString(key)+ex.Message); return null; } }
//cygwin�̓����I�ڑ� public static ConnectionTag CreateNewLocalShellConnection(IWin32Window parent, LocalShellTerminalParam param) { return LocalShellUtil.PrepareSocket(parent, param); }