상속: SuperPutty.ToolWindow
예제 #1
0
 public void ShowSessionTreeview()
 {
     m_Sessions = new SessionTreeview(this, dockPanel1);
     m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
     this.toolbarViewSessions.Checked = true;
     Classes.Database.SetKeyStatic("ShowSessionTreeview", "true");
 }
예제 #2
0
        private void SessionTreeviewInstanceChanged(SessionTreeview TreeViewInstance)
        {
            if (this.TreeViewInstance == TreeViewInstance)
                return;

            Attach(TreeViewInstance);
        }
예제 #3
0
 private void CopyPuttySessionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you want to copy all sessions from PuTTY? This may overwrite identically named sessions in SuperPutty!", "SuperPutty", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         SessionTreeview.copySessionsFromPuTTY();
         m_Sessions.LoadSessions();
     }
 }
예제 #4
0
        private void SessionTreeviewInstanceChanged(SessionTreeview TreeViewInstance)
        {
            if (this.TreeViewInstance == TreeViewInstance)
            {
                return;
            }

            Attach(TreeViewInstance);
        }
예제 #5
0
 private void Detach()
 {
     if (this.TreeViewInstance != null)
     {
         TreeViewInstance.FormClosed -= SessionTreeView_FormClosed;
         TreeViewInstance.SelectionChanged -= SelectedSessionChanged;
     }
     this.TreeViewInstance = null;
     SelectedSessionChanged(null);
 }
예제 #6
0
 private void Detach()
 {
     if (this.TreeViewInstance != null)
     {
         TreeViewInstance.FormClosed       -= SessionTreeView_FormClosed;
         TreeViewInstance.SelectionChanged -= SelectedSessionChanged;
     }
     this.TreeViewInstance = null;
     SelectedSessionChanged(null);
 }
예제 #7
0
 private void Attach(SessionTreeview SessionTreeView)
 {
     Detach();
     this.TreeViewInstance = SessionTreeView;
     if (SessionTreeView != null)
     {
         this.TreeViewInstance.FormClosed += SessionTreeView_FormClosed;
         SessionTreeView.SelectionChanged += SelectedSessionChanged;
         SelectedSessionChanged(SessionTreeView.SelectedSession);
     }
 }
예제 #8
0
 private void Attach(SessionTreeview SessionTreeView)
 {
     Detach();
     this.TreeViewInstance = SessionTreeView;
     if (SessionTreeView != null)
     {
         this.TreeViewInstance.FormClosed += SessionTreeView_FormClosed;
         SessionTreeView.SelectionChanged += SelectedSessionChanged;
         SelectedSessionChanged(SessionTreeView.SelectedSession);
     }
 }
예제 #9
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveDialog = new SaveFileDialog();

            saveDialog.Filter           = "XML Files|*.xml";
            saveDialog.FileName         = "Sessions.XML";
            saveDialog.InitialDirectory = Application.StartupPath;
            if (saveDialog.ShowDialog() == DialogResult.OK)
            {
                SessionTreeview.ExportSessionsToXml(saveDialog.FileName);
            }
        }
예제 #10
0
        private void importSettingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openDialog = new OpenFileDialog();

            openDialog.Filter           = "XML Files|*.xml";
            openDialog.FileName         = "Sessions.XML";
            openDialog.CheckFileExists  = true;
            openDialog.InitialDirectory = Application.StartupPath;
            if (openDialog.ShowDialog() == DialogResult.OK)
            {
                SessionTreeview.ImportSessionsFromXml(openDialog.FileName);
                m_Sessions.LoadSessions();
            }
        }
예제 #11
0
        public frmSuperPutty(string[] args)
        {
            // Check SQLite Database
            openOrCreateSQLiteDatabase();

            #region Exe Paths
            // Get putty executable path
            if (File.Exists(this.m_db.GetKey("putty_exe")))
            {
                PuttyExe = this.m_db.GetKey("putty_exe");
            }

            // Get pscp executable path
            if (File.Exists(this.m_db.GetKey("pscp_exe")))
            {
                PscpExe = this.m_db.GetKey("pscp_exe");
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                dlgFindPutty dialog = new dlgFindPutty();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    this.m_db.SetKey("putty_exe", dialog.PuttyLocation);
                    this.m_db.SetKey("pscp_exe", dialog.PscpLocation);
                    PuttyExe = this.m_db.GetKey("putty_exe");
                    PscpExe = this.m_db.GetKey("pscp_exe");
                }
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                    "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }
            #endregion

            InitializeComponent();

            #if DEBUG
            // Only show the option for the debug log viewer when we're compiled with DEBUG defined.
            debugLogToolStripMenuItem.Visible = true;
            #endif

            //Activate PasswordChar for passwordfield in connectbar
            PasswordTextBox.TextBox.UseSystemPasswordChar = true;

            //Select protocol SSH
            ProtocolBox.SelectedItem = ProtocolBox.Items[0];

            dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged;

            /*
             * Open the session treeview and dock it on the right
             */
            m_Sessions = new SessionTreeview(dockPanel1);
            m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);

            /*
             * Parsing CL Arguments
             */
            ParseClArguments(args);

            // Check for updates.
            checkForUpdate(true);
        }
예제 #12
0
        public frmSuperPutty(string[] args)
        {
            // Check SQLite Database
            openOrCreateSQLiteDatabase();

            #region Exe Paths
            // Get putty executable path
            if (File.Exists(this.m_db.GetKey("putty_exe")))
            {
                PuttyExe = this.m_db.GetKey("putty_exe");
            }

            // Get pscp executable path
            if (File.Exists(this.m_db.GetKey("pscp_exe")))
            {
                PscpExe = this.m_db.GetKey("pscp_exe");
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                dlgFindPutty dialog = new dlgFindPutty();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    this.m_db.SetKey("putty_exe", dialog.PuttyLocation);
                    this.m_db.SetKey("pscp_exe", dialog.PscpLocation);
                    PuttyExe = this.m_db.GetKey("putty_exe");
                    PscpExe  = this.m_db.GetKey("pscp_exe");
                }
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                                "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }
            #endregion

            InitializeComponent();

#if DEBUG
            // Only show the option for the debug log viewer when we're compiled with DEBUG defined.
            debugLogToolStripMenuItem.Visible = true;
#endif

            //Activate PasswordChar for passwordfield in connectbar
            PasswordTextBox.TextBox.UseSystemPasswordChar = true;

            //Select protocol SSH
            ProtocolBox.SelectedItem = ProtocolBox.Items[0];

            dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged;

            /*
             * Open the session treeview and dock it on the right
             */
            m_Sessions = new SessionTreeview(this, dockPanel1);
            if (Classes.Database.GetBooleanKey("ShowSessionTreeview", true))
            {
                showSessionTreeview();
            }

            /*
             * Parsing CL Arguments
             */
            ParseClArguments(args);

            // First time automatic update check
            firstTimeAutomaticUpdateCheck();

            // Set automatic update check menu item
            setAutomaticUpdateCheckMenuItem();

            // Set addtional timing menu item
            setAdditionalTimingMenuItem();

            // Check for updates.
            checkForUpdate(true);

            // Set window state and size
            setWindowStateAndSize();
        }
예제 #13
0
 private void showSessionTreeview()
 {
     m_Sessions = new SessionTreeview(this, dockPanel1);
     m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
 }
예제 #14
0
        public frmSuperPutty(string[] args)
        {
            this.children = new ConcurrentDictionary<IntPtr, bool>();
            m_panelMapping = new ConcurrentDictionary<IntPtr, ctlPuttyPanel>();
            m_hotkeys = new GlobalHotkeys();
            m_keyboard = new KeyboardListener(this, m_hotkeys);
            m_titleTracker = new WindowTitleTracker(this);
            //m_outputDetector = new MinttyOutputDetector(this, m_outputMapping);
            registerHotkeys();

            // Check SQLite Database
            openOrCreateSQLiteDatabase();
            this.AddChild(this.Handle);

            #region Exe Paths
            // Get putty executable path
            if (File.Exists(this.m_db.GetKey("putty_exe")))
            {
                PuttyExe = this.m_db.GetKey("putty_exe");
            }

            // Get pscp executable path
            if (File.Exists(this.m_db.GetKey("pscp_exe")))
            {
                PscpExe = this.m_db.GetKey("pscp_exe");
            }

            // Get mintty executable path
            if (File.Exists(this.m_db.GetKey("mintty_exe")))
            {
                MinttyExe = this.m_db.GetKey("mintty_exe");
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                editLocations();
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                    "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }
			#endregion

            InitializeComponent();

#if DEBUG
            menuStrip1.BackColor = Color.Pink;
            // Only show the option for the debug log viewer when we're compiled with DEBUG defined.
            debugLogToolStripMenuItem.Visible = true;
#endif

			//Activate PasswordChar for passwordfield in connectbar
            PasswordTextBox.TextBox.UseSystemPasswordChar = true;
			
			//Select protocol SSH
            ProtocolBox.SelectedItem = ProtocolBox.Items[0];
			
            dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged;
            dockPanel1.LostFocus += dockPanel1_ActiveDocumentChanged;

            /* 
             * Open the session treeview and dock it on the right
             */
            m_Sessions = new SessionTreeview(this, dockPanel1);
            if(Classes.Database.GetBooleanKey("ShowSessionTreeview", true))
            {
            	ShowSessionTreeview();
            }

            if (!Classes.Database.GetBooleanKey("ShowQuickConnectBar", true))
            {
                this.ConnectToolStrip.Hide();
                this.quickConnectToolStripMenuItem.Checked = false;
            }

            if (!Classes.Database.GetBooleanKey("ShowTopMenu", true))
            {
                this.menuStrip1.Hide();
            }

            /*
             * Parsing CL Arguments
             */
            ParseClArguments(args);
            
            // First time automatic update check
            firstTimeAutomaticUpdateCheck();
            
            // Set automatic update check menu item
            setAutomaticUpdateCheckMenuItem();
            
            // Set addtional timing menu item
            setAdditionalTimingMenuItem();
            
            // Check for updates.
            checkForUpdate(true);
            
            // Set window state and size
            setWindowStateAndSize();


            focusHacks();
        }
예제 #15
0
 private SessionDetail()
 {
     InitializeComponent();
     TreeViewInstance = null;
     sessionDetailPropertyGrid.PropertySort = PropertySort.NoSort;
 }
예제 #16
0
 private SessionDetail()
 {
     InitializeComponent();
     TreeViewInstance = null;
     sessionDetailPropertyGrid.PropertySort = PropertySort.NoSort;
 }
예제 #17
0
        public frmSuperPutty()
        {
            // Get Registry Entry for Putty Exe
            RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Jim Radford\SuperPuTTY\Settings");
            if (key != null)
            {
                string puttyExe = key.GetValue("PuTTYExe", "").ToString();
                if (File.Exists(puttyExe))
                {
                    PuttyExe = puttyExe;
                }

                string pscpExe = key.GetValue("PscpExe", "").ToString();
                if (File.Exists(pscpExe))
                {
                    PscpExe = pscpExe;
                }
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                dlgFindPutty dialog = new dlgFindPutty();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    PuttyExe = dialog.PuttyLocation;
                    PscpExe = dialog.PscpLocation;
                }
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                    "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }

            InitializeComponent();

            #if DEBUG
            // Only show the option for the debug log viewer when we're compiled with DEBUG defined.
            debugLogToolStripMenuItem.Visible = true;
            #endif

            dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged;

            /*
             * Open the session treeview and dock it on the right
             */
            m_Sessions = new SessionTreeview(dockPanel1);
            m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
        }
예제 #18
0
 private void showSessionTreeview()
 {
     m_Sessions = new SessionTreeview(this, dockPanel1);
     m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
 }
예제 #19
0
        public frmSuperPutty(string[] args)
        {
            this.children  = new ConcurrentDictionary <IntPtr, bool>();
            m_panelMapping = new ConcurrentDictionary <IntPtr, ctlPuttyPanel>();
            m_hotkeys      = new GlobalHotkeys();
            m_keyboard     = new KeyboardListener(this, m_hotkeys);
            m_titleTracker = new WindowTitleTracker(this);
            //m_outputDetector = new MinttyOutputDetector(this, m_outputMapping);
            registerHotkeys();

            // Check SQLite Database
            openOrCreateSQLiteDatabase();
            this.AddChild(this.Handle);

            #region Exe Paths
            // Get putty executable path
            if (File.Exists(this.m_db.GetKey("putty_exe")))
            {
                PuttyExe = this.m_db.GetKey("putty_exe");
            }

            // Get pscp executable path
            if (File.Exists(this.m_db.GetKey("pscp_exe")))
            {
                PscpExe = this.m_db.GetKey("pscp_exe");
            }

            // Get mintty executable path
            if (File.Exists(this.m_db.GetKey("mintty_exe")))
            {
                MinttyExe = this.m_db.GetKey("mintty_exe");
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                editLocations();
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                                "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }
            #endregion

            InitializeComponent();

#if DEBUG
            menuStrip1.BackColor = Color.Pink;
            // Only show the option for the debug log viewer when we're compiled with DEBUG defined.
            debugLogToolStripMenuItem.Visible = true;
#endif

            //Activate PasswordChar for passwordfield in connectbar
            PasswordTextBox.TextBox.UseSystemPasswordChar = true;

            //Select protocol SSH
            ProtocolBox.SelectedItem = ProtocolBox.Items[0];

            dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged;
            dockPanel1.LostFocus             += dockPanel1_ActiveDocumentChanged;

            /*
             * Open the session treeview and dock it on the right
             */
            m_Sessions = new SessionTreeview(this, dockPanel1);
            if (Classes.Database.GetBooleanKey("ShowSessionTreeview", true))
            {
                ShowSessionTreeview();
            }

            if (!Classes.Database.GetBooleanKey("ShowQuickConnectBar", true))
            {
                this.ConnectToolStrip.Hide();
                this.quickConnectToolStripMenuItem.Checked = false;
            }

            if (!Classes.Database.GetBooleanKey("ShowTopMenu", true))
            {
                this.menuStrip1.Hide();
            }

            /*
             * Parsing CL Arguments
             */
            ParseClArguments(args);

            // First time automatic update check
            firstTimeAutomaticUpdateCheck();

            // Set automatic update check menu item
            setAutomaticUpdateCheckMenuItem();

            // Set addtional timing menu item
            setAdditionalTimingMenuItem();

            // Check for updates.
            checkForUpdate(true);

            // Set window state and size
            setWindowStateAndSize();


            focusHacks();
        }
예제 #20
0
 public void ShowSessionTreeview()
 {
     m_Sessions = new SessionTreeview(this, dockPanel1);
     m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
     this.toolbarViewSessions.Checked = true;
     Classes.Database.SetKeyStatic("ShowSessionTreeview", "true");
 }