private void OnOK(object sender, EventArgs args) { this.DialogResult = DialogResult.None; if(_homeDirectoryBox.Text.Length==0) GUtil.Warning(this, GApp.Strings.GetString("Message.CygwinLoginDialog.EmptyHomeDirectory")); else if(_shellBox.Text.Length==0) GUtil.Warning(this, GApp.Strings.GetString("Message.CygwinLoginDialog.EmptyShell")); _param.LogType = (LogType)EnumDescAttributeT.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None); if(_param.LogType!=LogType.None) { _param.LogPath = _logFileBox.Text; LogFileCheckResult r = GCUtil.CheckLogFileName(_param.LogPath, this); if(r==LogFileCheckResult.Cancel || r==LogFileCheckResult.Error) return; _param.LogAppend = (r==LogFileCheckResult.Append); } _param.Home = _homeDirectoryBox.Text; _param.Shell = _shellBox.Text; _okButton.Enabled = false; _cancelButton.Enabled = false; this.Cursor = Cursors.WaitCursor; _savedHWND = this.Handle; if(_param is CygwinTerminalParam) this.Text = GApp.Strings.GetString("Caption.CygwinLoginDialog.ConnectingCygwin"); else this.Text = GApp.Strings.GetString("Caption.CygwinLoginDialog.ConnectingSFU"); _connector = CygwinUtil.AsyncPrepareSocket(this, _param); if(_connector==null) ClearConnectingState(); }
private void ClearConnectingState() { _okButton.Enabled = true; _cancelButton.Enabled = true; this.Cursor = Cursors.Default; this.Text = GApp.Strings.GetString("Form.CygwinLoginDialog.Text"); _connector = null; }