Exemplo n.º 1
0
        public override bool Commit(ContainerOptions options)
        {
            string itemname = "";
            try {
                options.UseSocks = _useSocks.Checked;
                if(options.UseSocks && _socksServerBox.Text.Length==0)
                    throw new Exception(GApp.Strings.GetString("Message.OptionDialog.EmptySocksServer"));
                options.SocksServer = _socksServerBox.Text;
                itemname = GApp.Strings.GetString("Caption.OptionDialog.SOCKSPortNumber");
                options.SocksPort = Int32.Parse(_socksPortBox.Text);
                options.SocksAccount = _socksAccountBox.Text;
                options.SocksPassword = _socksPasswordBox.Text;
                itemname = GApp.Strings.GetString("Caption.OptionDialog.NetworkAddress");
                foreach(string c in _socksNANetworksBox.Text.Split(';')) {
                    if(!NetUtil.IsNetworkAddress(c)) throw new FormatException();
                }
                options.SocksNANetworks = _socksNANetworksBox.Text;

                return true;
            }
            catch(FormatException) {
                GUtil.Warning(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname));
                return false;
            }
            catch(Exception ex) {
                GUtil.Warning(this, ex.Message);
                return false;
            }
        }
Exemplo n.º 2
0
        public override bool Commit(ContainerOptions options)
        {
            //�Í��A���S���Y��������options�𒼐ڂ������Ă���̂ł����ł͉�����Ȃ��Ă悢
            try {
                PublicKeyAlgorithm[] pa = new PublicKeyAlgorithm[2];
                if(_hostKeyBox.SelectedIndex==0) {
                    pa[0] = PublicKeyAlgorithm.DSA;
                    pa[1] = PublicKeyAlgorithm.RSA;
                }
                else {
                    pa[0] = PublicKeyAlgorithm.RSA;
                    pa[1] = PublicKeyAlgorithm.DSA;
                }
                options.HostKeyAlgorithmOrder = LocalSSHUtil.FormatPublicKeyAlgorithmList(pa);

                try {
                    options.SSHWindowSize = Int32.Parse(_windowSizeBox.Text);
                }
                catch(FormatException) {
                    GUtil.Warning(this, GApp.Strings.GetString("Message.OptionDialog.InvalidWindowSize"));
                    return false;
                }

                options.RetainsPassphrase = _retainsPassphrase.Checked;
                options.SSHCheckMAC = _sshCheckMAC.Checked;
                options.CipherAlgorithmOrder = _cipherAlgorithmOrder;

                return true;
            }
            catch(Exception ex) {
                GUtil.Warning(this, ex.Message);
                return false;
            }
        }
Exemplo n.º 3
0
 public override void InitUI(ContainerOptions options)
 {
     _useSocks.Checked = options.UseSocks;
     _socksServerBox.Text = options.SocksServer;
     _socksPortBox.Text = options.SocksPort.ToString();
     _socksAccountBox.Text = options.SocksAccount;
     _socksPasswordBox.Text = options.SocksPassword;
     _socksNANetworksBox.Text = options.SocksNANetworks;
 }
Exemplo n.º 4
0
        public OptionDialog()
        {
            //
            // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B
            //
            InitializeComponent();

            if(!this.DesignMode) {
                FillText();
                InitItems();
                _options = (ContainerOptions)GApp.Options.Clone();
                _pages = new CategoryPanel[(int)PageID.COUNT];
            }
        }
Exemplo n.º 5
0
        public override bool Commit(ContainerOptions options)
        {
            bool successful = false;
            string itemname = null;
            try {
                options.CloseOnDisconnect = _closeOnDisconnect.Checked;
                options.BeepOnBellChar = _beepOnBellChar.Checked;
                options.AdjustsTabTitleToWindowTitle = _adjustsTabTitleToWindowTitle.Checked;
                options.AllowsScrollInAppMode = _allowsScrollInAppMode.Checked;
                itemname = GApp.Strings.GetString("Caption.OptionDialog.BufferLineCount");
                options.TerminalBufferSize = Int32.Parse(_bufferSize.Text);
                itemname = GApp.Strings.GetString("Caption.OptionDialog.MRUCount");
                options.WarningOption = (WarningOption)_badCharBox.SelectedIndex;
                options.DisconnectNotification = (DisconnectNotification)_disconnectNotification.SelectedIndex;
                if(_keepAliveCheck.Checked) {
                    itemname = GApp.Strings.GetString("Caption.OptionDialog.KeepAliveInterval");
                    options.KeepAliveInterval = Int32.Parse(_keepAliveIntervalBox.Text) * 60000;
                    if(options.KeepAliveInterval<=0) throw new FormatException();
                }
                else
                    options.KeepAliveInterval = 0;

                if(_autoLogCheckBox.Checked) {
                    if(_defaultLogDirectory.Text.Length==0) {
                        GUtil.Warning(this, GApp.Strings.GetString("Message.OptionDialog.EmptyLogDirectory"));
                        return false;
                    }
                    options.DefaultLogType = (LogType)EnumDescAttribute.For(typeof(LogType)).FromDescription(_defaultLogTypeBox.Text, LogType.None);
                    if(!System.IO.Directory.Exists(_defaultLogDirectory.Text)) {
                        if(GUtil.AskUserYesNo(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.AskCreateDirectory"), _defaultLogDirectory.Text))==DialogResult.Yes)
                            System.IO.Directory.CreateDirectory(_defaultLogDirectory.Text);
                        else
                            return false;
                    }
                    options.DefaultLogDirectory = _defaultLogDirectory.Text;
                }
                else
                    options.DefaultLogType = LogType.None;

                successful = true;
            }
            catch(FormatException) {
                GUtil.Warning(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname));
            }
            catch(InvalidOptionException ex) {
                GUtil.Warning(this, ex.Message);
            }
            return successful;
        }
Exemplo n.º 6
0
        public override bool Commit(ContainerOptions options)
        {
            bool successful = false;
            string itemname = null;
            try {
                //Win9x�ł́A���E��Alt�̋�ʂ��ł��Ȃ��̂ŕʁX�̐ݒ�ɂ��邱�Ƃ�֎~����
                if(System.Environment.OSVersion.Platform==PlatformID.Win32Windows &&
                    _leftAltKeyAction.SelectedIndex!=_rightAltKeyAction.SelectedIndex) {
                    GUtil.Warning(this, GApp.Strings.GetString("Message.OptionDialog.AltKeyOnWin9x"));
                    return false;
                }

                options.LeftAltKey = (AltKeyAction)_leftAltKeyAction.SelectedIndex;
                options.RightAltKey = (AltKeyAction)_rightAltKeyAction.SelectedIndex;
                options.Send0x7FByDel = _send0x7FByDel.Checked;
                options.AutoCopyByLeftButton = _autoCopyByLeftButton.Checked;
                options.RightButtonAction = (RightButtonAction)_rightButtonAction.SelectedIndex;

                itemname = GApp.Strings.GetString("Caption.OptionDialog.MousewheelAmount");
                options.WheelAmount = Int32.Parse(_wheelAmount.Text);
                options.LocalBufferScrollModifier = LocalBufferScrollModifierKey(_localBufferScrollModifierBox.SelectedIndex);

                foreach(char ch in _additionalWordElementBox.Text) {
                    if(ch>=0x100) {
                        GUtil.Warning(this, GApp.Strings.GetString("Message.OptionDialog.InvalidAdditionalWordElement"));
                        return false;
                    }
                }
                options.AdditionalWordElement = _additionalWordElementBox.Text;

                successful = true;
            }
            catch(FormatException) {
                GUtil.Warning(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname));
            }
            catch(InvalidOptionException ex) {
                GUtil.Warning(this, ex.Message);
            }
            return successful;
        }
Exemplo n.º 7
0
        public override bool Commit(ContainerOptions options)
        {
            string itemname = null;
            bool successful = false;
            try {
                options.ActionOnLaunch = ToActionOnLaunchCID(_actionOnLaunchBox.SelectedIndex);
                itemname = GApp.Strings.GetString("Caption.OptionDialog.MRUCount");
                options.MRUSize = Int32.Parse(_MRUSize.Text);
                itemname = GApp.Strings.GetString("Caption.OptionDialog.SerialPortCount");
                options.SerialCount = Int32.Parse(_serialCount.Text);

                options.ShowTabBar = _showTabBar.Checked;
                options.ShowToolBar = _showToolBar.Checked;
                options.SplitterPreservesRatio = _splitterRatioBox.Checked;
                options.TabBarStyle = (TabBarStyle)_tabStyleBox.SelectedIndex;
                options.ShowStatusBar = _showStatusBar.Checked;
                options.AskCloseOnExit = _askCloseOnExit.Checked;
                options.QuitAppWithLastPane = _quitAppWithLastPane.Checked;
                if(GApp.Options.OptionPreservePlace!=(OptionPreservePlace)_optionPreservePlace.SelectedIndex && !GApp.IsRegistryWritable) {
                    GUtil.Warning(this, GApp.Strings.GetString("Message.OptionDialog.RegistryWriteAuthWarning"));
                    return false;
                }
                options.OptionPreservePlace = (OptionPreservePlace)_optionPreservePlace.SelectedIndex;
                options.Language = (Language)_languageBox.SelectedIndex;
                if(options.Language==Language.Japanese && GApp.Options.EnvLanguage==Language.English) {
                    if(GUtil.AskUserYesNo(this, GApp.Strings.GetString("Message.OptionDialog.AskJapaneseFont"))==DialogResult.No)
                        return false;
                }

                successful = true;
            }
            catch(FormatException) {
                GUtil.Warning(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname));
            }
            catch(InvalidOptionException ex) {
                GUtil.Warning(this, ex.Message);
            }

            return successful;
        }
Exemplo n.º 8
0
        public override bool Commit(ContainerOptions options)
        {
            string itemname = null;
            bool successful = false;
            try {
                if(_backgroundImageBox.Text.Length>0) {
                    try {
                        Image.FromFile(_backgroundImageBox.Text);
                    }
                    catch(Exception) {
                        GUtil.Warning(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.InvalidPictureFile"), _backgroundImageBox.Text));
                        return false;
                    }
                }
                options.BackgroundImageFileName = _backgroundImageBox.Text;
                options.ImageStyle = (ImageStyle)_imageStyleBox.SelectedIndex;

                options.BGColor = _bgColorBox.SelectedColor;
                options.TextColor = _textColorBox.SelectedColor;
                options.Font = _fontSample.Font;

                options.CaretColor = _caretSpecifyColor.Checked? _caretColorBox.SelectedColor : Color.Empty;
                options.CaretType = IndexToCaretType(_caretStyleBox.SelectedIndex) | (_caretBlink.Checked? CaretType.Blink : CaretType.None);
                options.ESColorSet = _ESColorSet;
                options.DefaultFileDir = _defaultFileDir;
                options.UseClearType = _useClearType;
                options.Font = _font;
                options.JapaneseFont = _japaneseFont;
                successful = true;
            }
            catch(FormatException) {
                GUtil.Warning(this, String.Format(GApp.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname));
            }
            catch(InvalidOptionException ex) {
                GUtil.Warning(this, ex.Message);
            }

            return successful;
        }
Exemplo n.º 9
0
 public void CopyTo(ContainerOptions o)
 {
     base.CopyTo(o);
     o._defaultKeyDir          = _defaultKeyDir;
     o._defaultFileDir         = _defaultFileDir;
     o._framePosition          = _framePosition;
     o._frameState             = _frameState;
     o._optionPreservePlace    = _optionPreservePlace;
     o._frameStyle             = _frameStyle;
     o._splitterPreservesRatio = _splitterPreservesRatio;
     o._showToolBar            = _showToolBar;
     o._showTabBar             = _showTabBar;
     o._showStatusBar          = _showStatusBar;
     o._tabBarStyle            = _tabBarStyle;
     o._actionOnLaunch         = _actionOnLaunch;
     o._MRUSize           = _MRUSize;
     o._serialCount       = _serialCount;
     o._language          = _language;
     o._envLanguage       = _envLanguage;
     o._guevaraMode       = _guevaraMode;
     o._commands          = (Commands)_commands.Clone();
     o._showWelcomeDialog = _showWelcomeDialog;
 }
Exemplo n.º 10
0
 public void CopyTo(ContainerOptions o)
 {
     base.CopyTo(o);
     o._defaultKeyDir = _defaultKeyDir;
     o._defaultFileDir = _defaultFileDir;
     o._framePosition = _framePosition;
     o._frameState = _frameState;
     o._optionPreservePlace = _optionPreservePlace;
     o._frameStyle = _frameStyle;
     o._splitterPreservesRatio = _splitterPreservesRatio;
     o._showToolBar = _showToolBar;
     o._showTabBar = _showTabBar;
     o._showStatusBar = _showStatusBar;
     o._tabBarStyle = _tabBarStyle;
     o._actionOnLaunch = _actionOnLaunch;
     o._MRUSize = _MRUSize;
     o._serialCount = _serialCount;
     o._language = _language;
     o._envLanguage = _envLanguage;
     o._guevaraMode = _guevaraMode;
     o._commands = (Commands)_commands.Clone();
     o._showWelcomeDialog = _showWelcomeDialog;
 }
Exemplo n.º 11
0
        public override void InitUI(ContainerOptions options)
        {
            AdjustFontDescription(options.Font, options.JapaneseFont);
            _fontSample.Font = options.Font;
            _fontSample.BackColor = options.BGColor;
            _fontSample.ForeColor = options.TextColor;
            _fontSample.ClearType = options.UseClearType;
            _fontSample.Invalidate(true);
            _backgroundImageBox.Text = options.BackgroundImageFileName;
            _imageStyleBox.SelectedIndex = (int)options.ImageStyle;
            _bgColorBox.SelectedColor = options.BGColor;
            _textColorBox.SelectedColor =  options.TextColor;
            _caretStyleBox.SelectedIndex = CaretTypeToIndex(options.CaretType);
            _caretSpecifyColor.Checked = !options.CaretColor.IsEmpty;
            _caretBlink.Checked = (options.CaretType & CaretType.Blink)==CaretType.Blink;
            _caretColorBox.SelectedColor =  options.CaretColor;

            _ESColorSet = options.ESColorSet;
            _defaultFileDir = options.DefaultFileDir;
            _useClearType = options.UseClearType;
            _font = options.Font;
            _japaneseFont = options.JapaneseFont;
        }
Exemplo n.º 12
0
 public override void InitUI(ContainerOptions options)
 {
     _commands = (Commands)options.Commands.Clone();
     InitKeyConfigUI();
 }
Exemplo n.º 13
0
 public abstract void InitUI(ContainerOptions options);
Exemplo n.º 14
0
        private static void LoadEnvironment(InitialAction act)
        {
            ThemeUtil.Init();

            OptionPreservePlace place = GetOptionPreservePlace();
            _options = new ContainerOptions();
            _history = new ConnectionHistory();
            _macroManager = new MacroManager();
            _container = new PoderosaContainer();
            _globalCommandTarget = new ContainerGlobalCommandTarget();
            _interThreadUIService = new ContainerInterThreadUIService();
            _sshKnownHosts = new SSHKnownHosts();

            //���̎��_�ł�OS�̌���ݒ�ɍ��������\�[�X����[�h����B�N�����O�ŕK�v�ɉ����ă����[�h
            ReloadStringResource();

            GEnv.Init(_container);
            GEnv.Options = _options;
            GEnv.GlobalCommandTarget = _globalCommandTarget;
            GEnv.InterThreadUIService = _interThreadUIService;
            GEnv.SSHKnownHosts = _sshKnownHosts;
            string dir = GetOptionDirectory(place);
            LoadConfigFiles(dir, act);
            _options.OptionPreservePlace = place;

            // Check the language settings, re-read it if needed.
            if (GUtil.CurrentLanguage != _options.Language) {
                switch (_options.Language) {
                    case Language.Japanese:
                        System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("ja");
                    break;
                    case Language.Chinese:
                        System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh");
                    break;
                    default:
                        System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
                    break;
                }
                ReloadStringResource();
            }
        }
Exemplo n.º 15
0
        public void ApplyOptions(ContainerOptions prev, ContainerOptions opt)
        {
            _contextMenu = null;
            _menuMovePaneUp.Enabled = _menuMovePaneDown.Enabled = (opt.FrameStyle==GFrameStyle.DivHorizontal || opt.FrameStyle==GFrameStyle.DivHorizontal3);
            _menuMovePaneLeft.Enabled = _menuMovePaneRight.Enabled = (opt.FrameStyle==GFrameStyle.DivVertical || opt.FrameStyle==GFrameStyle.DivVertical3);
            _menuFrameStyleSingle.Checked = opt.FrameStyle==GFrameStyle.Single;
            _menuFrameStyleDivHorizontal.Checked = opt.FrameStyle==GFrameStyle.DivHorizontal;
            _menuFrameStyleDivVertical.Checked = opt.FrameStyle==GFrameStyle.DivVertical;
            _menuFrameStyleDivHorizontal3.Checked = opt.FrameStyle==GFrameStyle.DivHorizontal3;
            _menuFrameStyleDivVertical3.Checked = opt.FrameStyle==GFrameStyle.DivVertical3;
            _menuExpandPane.Enabled = opt.FrameStyle!=GFrameStyle.Single;
            _menuShrinkPane.Enabled = opt.FrameStyle!=GFrameStyle.Single;

            if(prev!=null && prev.FrameStyle!=opt.FrameStyle) //�N������(prev==null)���Ƃ܂����C�A�E�g������Ă��Ȃ��̂�InitUI�͎��s�ł��Ȃ�
                _multiPaneControl.InitUI(prev, opt);

            bool toolbar = prev!=null && prev.ShowToolBar;
            bool tabbar = prev!=null && prev.ShowTabBar;
            bool statusbar = prev!=null && prev.ShowStatusBar;

            this.SuspendLayout();
            _multiPaneControl.ApplyOptions(opt);
            _tabBar.ApplyOptions(opt);

            if(!tabbar && opt.ShowTabBar) {
                this.Controls.Add(_tabBar);
                this.Controls.SetChildIndex(_tabBar, 1); //index 0��_multiPaneControl�Œ�
            }
            else if(tabbar && !opt.ShowTabBar) {
                this.Controls.Remove(_tabBar);
            }

            if(!toolbar && opt.ShowToolBar) {
                if(_toolBar==null) CreateToolBar();
                this.Controls.Add(_toolBar);
                this.Controls.SetChildIndex(_toolBar, opt.ShowTabBar? 2 : 1);
            }
            else if(toolbar && !opt.ShowToolBar) {
                if(_toolBar!=null) this.Controls.Remove(_toolBar);
            }
            if(opt.ShowToolBar)
                _toolBar.ApplyOptions(opt);

            if(!statusbar && opt.ShowStatusBar) {
                this.Controls.Add(_statusBar);
                this.Controls.SetChildIndex(_statusBar, this.Controls.Count-1);
            }
            else if(statusbar && !opt.ShowStatusBar) {
                this.Controls.Remove(_statusBar);
            }
            this.ResumeLayout(true);
        }
Exemplo n.º 16
0
 public void ApplyOptions(ContainerOptions opt)
 {
     GFrameStyle f = opt.FrameStyle;
     _singleStyle.Checked         = f==GFrameStyle.Single;
     _divHorizontalStyle.Checked  = f==GFrameStyle.DivHorizontal;
     _divVerticalStyle.Checked    = f==GFrameStyle.DivVertical;
     _divHorizontal3Style.Checked = f==GFrameStyle.DivHorizontal3;
     _divVertical3Style.Checked   = f==GFrameStyle.DivVertical3;
     Invalidate(true);
 }
Exemplo n.º 17
0
 public override void InitUI(ContainerOptions options)
 {
     _bufferSize.Text = options.TerminalBufferSize.ToString();
     _closeOnDisconnect.Checked = options.CloseOnDisconnect;
     _disconnectNotification.SelectedIndex = (int)options.DisconnectNotification;
     _beepOnBellChar.Checked = options.BeepOnBellChar;
     _badCharBox.SelectedIndex = (int)options.WarningOption;
     _adjustsTabTitleToWindowTitle.Checked = options.AdjustsTabTitleToWindowTitle;
     _allowsScrollInAppMode.Checked = options.AllowsScrollInAppMode;
     _keepAliveCheck.Checked = options.KeepAliveInterval!=0;
     _keepAliveIntervalBox.Text = _keepAliveCheck.Checked? (options.KeepAliveInterval/60000).ToString() : "5";
     _autoLogCheckBox.Checked = options.DefaultLogType!=LogType.None;
     _defaultLogTypeBox.SelectedIndex = (int)options.DefaultLogType-1;
     _defaultLogDirectory.Text = options.DefaultLogDirectory;
 }
Exemplo n.º 18
0
 public override void InitUI(ContainerOptions options)
 {
     _leftAltKeyAction.SelectedIndex = (int)options.LeftAltKey;
     _rightAltKeyAction.SelectedIndex = (int)options.RightAltKey;
     _send0x7FByDel.Checked = options.Send0x7FByDel;
     _autoCopyByLeftButton.Checked = options.AutoCopyByLeftButton;
     _rightButtonAction.SelectedIndex = (int)options.RightButtonAction;
     _wheelAmount.Text = options.WheelAmount.ToString();
     _additionalWordElementBox.Text = options.AdditionalWordElement;
     _localBufferScrollModifierBox.SelectedIndex = LocalBufferScrollModifierIndex(options.LocalBufferScrollModifier);
 }
Exemplo n.º 19
0
 public override object Clone()
 {
     ContainerOptions o = new ContainerOptions();
     CopyTo(o);
     return o;
 }
Exemplo n.º 20
0
        public void InitUI(ContainerOptions prev, ContainerOptions opt)
        {
            ConnectionTag[] cons = new ConnectionTag[_panes.Length];
            for(int i=0; i<_panes.Length; i++) {
                cons[i] = (_panes[i]==null || !_panes[i].FakeVisible)? null : _panes[i].ConnectionTag;
                if(_panes[i]!=null) _panes[i].Detach();
                _panes[i] = null;
            }

            Controls.Clear();

            GFrameStyle style = opt.FrameStyle;
            int pane_count = StyleToPaneCount(style);
            int prev_pane_count = prev==null? 1 : StyleToPaneCount(prev.FrameStyle);
            bool is_vertical = style==GFrameStyle.DivVertical || style==GFrameStyle.DivVertical3;

            //Control�̏�����
            this.SuspendLayout();
            for(int i = pane_count-1; i>=0; i--) {
                TerminalPane p = new TerminalPane();
                _panes[i] = p;
                p.Visible = true;
                p.Dock = i==pane_count-1? DockStyle.Fill : is_vertical? DockStyle.Left : DockStyle.Top;
                if(i<pane_count-1) {
                    int a = (int)((is_vertical? this.Width : this.Height) * (i==0? 0 : _splitterRatio[pane_count-2][i-1]));
                    int b = (int)((is_vertical? this.Width : this.Height) * (_splitterRatio[pane_count-2][i] - (i==0? 0 : _splitterRatio[pane_count-2][i-1])));
                    if(is_vertical) {
                        p.Left = a;
                        p.Width = b;
                    }
                    else {
                        p.Top = a;
                        p.Height = b;
                    }
                }
                this.Controls.Add(p);

                if(i>0) {
                    Splitter s = new Splitter();
                    _splitters[i-1] = s;
                    s.SplitterMoving += new SplitterEventHandler(this.OnSplitterMoving);
                    s.SplitterMoved  += new SplitterEventHandler(this.OnSplitterMoved);
                    s.Dock = is_vertical? DockStyle.Left : DockStyle.Top;
                    s.BorderStyle = BorderStyle.Fixed3D;
                    s.MinSize = 8;
                    s.SplitPosition = (int)((is_vertical? this.Width : this.Height) * _splitterRatio[pane_count-2][i-1]);
                    this.Controls.Add(s);
                }
            }
            this.ResumeLayout(true);

            //�K�v�Ȃ�̂�Attach
            foreach(ConnectionTag ct in GEnv.Connections.OrderedConnections) {
                int pos = ct.PositionIndex;
                if(prev_pane_count<pane_count && ct.PreservedPositionIndex>=prev_pane_count) { //�������y�C���ւ̋������蓖��
                    pos = ct.PreservedPositionIndex;
                    if(pos >= pane_count) pos = pane_count-1;
                    ct.PositionIndex = pos;
                    if(_panes[pos].ConnectionTag==null) {
                        _panes[pos].Attach(ct);
                        _panes[pos].FakeVisible = true;
                        GEnv.Frame.RefreshConnection(ct);
                    }
                }
                else if(pos < pane_count) { //���a�ȏꍇ
                    if(_panes[pos].ConnectionTag==null) {
                        _panes[pos].Attach(ct);
                        _panes[pos].FakeVisible = true;
                        GEnv.Frame.RefreshConnection(ct);
                    }
                }
                else { //�B���ꍇ
                    ct.PositionIndex = pane_count-1;
                    if(ct!=null && _panes[pane_count-1].ConnectionTag==null) {
                        _panes[pane_count-1].Attach(ct);
                        _panes[pane_count-1].FakeVisible = true;
                        GEnv.Frame.RefreshConnection(ct);
                    }
                }
            }
        }
Exemplo n.º 21
0
        public static void LoadEnvironment(InitialAction act)
        {
            ThemeUtil.Init();

            OptionPreservePlace place = GetOptionPreservePlace();
            _options = new ContainerOptions();
            _history = new ConnectionHistory();
            _macroManager = new MacroManager();
            _container = new PoderosaContainer();
            _globalCommandTarget = new ContainerGlobalCommandTarget();
            _interThreadUIService = new ContainerInterThreadUIService();
            _sshKnownHosts = new SSHKnownHosts();

            _options.Init();

            //���̎��_�ł�OS�̌���ݒ�ɍ��������\�[�X����[�h����B�N�����O�ŕK�v�ɉ����ă����[�h
            ReloadStringResource();

            GEnv.Init(_container);
            GEnv.Options = _options;
            GEnv.GlobalCommandTarget = _globalCommandTarget;
            GEnv.InterThreadUIService = _interThreadUIService;
            GEnv.SSHKnownHosts = _sshKnownHosts;
            string dir = GetOptionDirectory(place);
            LoadConfigFiles(dir, act);
            _options.OptionPreservePlace = place;

            //�����܂ł����猾��ݒ��`�F�b�N���A�K�v�Ȃ�ǂݒ���
            if(GUtil.CurrentLanguage!=_options.Language) {
                System.Threading.Thread.CurrentThread.CurrentUICulture = _options.Language==Language.Japanese? new CultureInfo("ja") : CultureInfo.InvariantCulture;
                ReloadStringResource();
            }
        }
Exemplo n.º 22
0
 public abstract bool Commit(ContainerOptions options);
Exemplo n.º 23
0
 public override void InitUI(ContainerOptions options)
 {
     _cipherOrderList.Items.Clear();
     string[] co = options.CipherAlgorithmOrder;
     foreach(string c in co)
         _cipherOrderList.Items.Add(c);
     _hostKeyBox.SelectedIndex = LocalSSHUtil.ParsePublicKeyAlgorithm(options.HostKeyAlgorithmOrder[0])==PublicKeyAlgorithm.DSA? 0 : 1; //�����DSA/RSA�̂ǂ��炩�����Ȃ�
     _windowSizeBox.Text = options.SSHWindowSize.ToString();
     _retainsPassphrase.Checked = options.RetainsPassphrase;
     _sshCheckMAC.Checked = options.SSHCheckMAC;
     _cipherAlgorithmOrder = options.CipherAlgorithmOrder;
 }
Exemplo n.º 24
0
 public void ApplyOptions(ContainerOptions opt)
 {
     if(opt.TabBarStyle==TabBarStyle.ScrollButton)
         ArrangeButtonsForScrollStyle(false, 0);
     else
         ArrangeButtonsForMultiRowStyle();
 }
Exemplo n.º 25
0
 public override bool Commit(ContainerOptions options)
 {
     options.Commands = _commands;
     return true;
 }
Exemplo n.º 26
0
        public static void UpdateOptions(ContainerOptions opt)
        {
            GEnv.Options = opt;
            _frame.ApplyOptions(_options, opt);
            _history.LimitCount(opt.MRUSize);
            _frame.AdjustMRUMenu();

            if(_options.Language!=opt.Language) { //����̃����[�h���K�v�ȂƂ�
                System.Threading.Thread.CurrentThread.CurrentUICulture = opt.Language==Language.Japanese? new CultureInfo("ja") : CultureInfo.InvariantCulture;
                GApp.ReloadStringResource();
                Granados.SSHC.Strings.Reload();
                GApp.MacroManager.ReloadLanguage();
                _frame.ReloadLanguage(opt.Language);
            }

            //�f�t�H���g�̂܂܂ł������ꍇ�ɂ͍X�V�������
            RenderProfile newprof = new RenderProfile(opt);
            foreach(ConnectionTag ct in GEnv.Connections) {
                if(ct.RenderProfile==null && ct.AttachedPane!=null) ct.AttachedPane.ApplyRenderProfile(newprof);
            }
            GEnv.DefaultRenderProfile = newprof;
            _options = opt;
        }
Exemplo n.º 27
0
 public override void InitUI(ContainerOptions options)
 {
     _MRUSize.Text = options.MRUSize.ToString();
     _serialCount.Text = options.SerialCount.ToString();
     _actionOnLaunchBox.Items.Add(GApp.Strings.GetString("Caption.OptionDialog.ActionOnLaunch.Nothing"));
     _actionOnLaunchBox.Items.Add(GApp.Strings.GetString("Caption.OptionDialog.ActionOnLaunch.NewConnection"));
     for(int i=0; i<GApp.MacroManager.ModuleCount; i++)
         _actionOnLaunchBox.Items.Add(GApp.Strings.GetString("Caption.OptionDialog.ActionOnLaunch.Macro")+GApp.MacroManager.GetModule(i).Title);
     _actionOnLaunchBox.SelectedIndex = ToActionOnLaunchIndex(options.ActionOnLaunch);
     _showToolBar.Checked = options.ShowToolBar;
     _showTabBar.Checked = options.ShowTabBar;
     _showStatusBar.Checked = options.ShowStatusBar;
     _splitterRatioBox.Checked = options.SplitterPreservesRatio;
     _tabStyleBox.SelectedIndex = (int)options.TabBarStyle;
     _askCloseOnExit.Checked = options.AskCloseOnExit;
     _quitAppWithLastPane.Checked = options.QuitAppWithLastPane;
     _optionPreservePlace.SelectedIndex = (int)options.OptionPreservePlace;
     _languageBox.SelectedIndex = (int)options.Language;
 }