示例#1
0
        private void mnuSettings_Click(object sender, EventArgs e)
        {
            if (this.terminalControl1.TerminalPane.ConnectionTag == null)
            {
                return;
            }

            Poderosa.Forms.EditRenderProfile dlg = new Poderosa.Forms.EditRenderProfile(this.terminalControl1.TerminalPane.ConnectionTag.RenderProfile);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            this.terminalControl1.TerminalPane.ConnectionTag.RenderProfile = dlg.Result;
            this.terminalControl1.TerminalPane.ApplyRenderProfile(dlg.Result);
            try
            {
                ConfigNode configNode = new ConfigNode("nighterssh-settings");
                this.terminalControl1.TerminalPane.ConnectionTag.RenderProfile.Export(configNode);
                TextWriter textWriter = new StreamWriter("nighterssh.settings");
                configNode.WriteTo(textWriter);
                textWriter.Flush();
                textWriter.Close();
            }
            catch { }
        }
示例#2
0
        private void OnSelectBackgroundImage(object sender, EventArgs args)
        {
            string t = EditRenderProfile.SelectPictureFileByDialog(FindForm());

            if (t != null)
            {
                _backgroundImageBox.Text = t;
            }
        }
 public CommandResult EditRenderProfile()
 {
     ConnectionTag tag = GEnv.Connections.FindTag(_connection);
     EditRenderProfile dlg = new EditRenderProfile(tag.RenderProfile);
     if(GCUtil.ShowModalDialog(GApp.Frame, dlg)==DialogResult.OK) {
         tag.RenderProfile = dlg.Result;
         GApp.ConnectionHistory.ReplaceIdenticalParam(tag.Connection.Param);
         if(tag.AttachedPane!=null) tag.AttachedPane.ApplyRenderProfile(dlg.Result);
         GApp.Frame.AdjustMRUMenu();
         return CommandResult.Success;
     }
     else
         return CommandResult.Cancelled;
 }
示例#4
0
        private static CommandResult CmdEditRenderProfile(ICommandTarget target) {
            ITerminalSession s = AsTerminalSession(target);
            if (s == null)
                return CommandResult.Ignored;

            EditRenderProfile dlg = new EditRenderProfile(s.TerminalSettings.RenderProfile);
            if (dlg.ShowDialog(s.OwnerWindow.AsForm()) == DialogResult.OK) {
                s.TerminalSettings.BeginUpdate();
                s.TerminalSettings.RenderProfile = dlg.Result;
                s.TerminalSettings.EndUpdate();
                return CommandResult.Succeeded;
            }
            else
                return CommandResult.Cancelled;
        }
        /// <summary>
        /// 表示プロファイルの編集画面を呼び出します。
        /// </summary>
        /// <param name="profile"></param>
        /// <returns></returns>
        public static RenderProfile CallEditRenderProfile(RenderProfile profile)
        {
            EditRenderProfile profileDialog = new EditRenderProfile(profile);

            if (profileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //
                // [OK]ボタンが押された場合は編集された表示プロファイルを返します。
                //
                return profileDialog.Result;
            }
            else
            {
                //
                // キャンセルされた場合はnullを返します。
                //
                return null;
            }
        }