예제 #1
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 PuttyWrap!", "PuttyWrap", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         SessionTreeview.copySessionsFromPuTTY();
         m_Sessions.LoadSessions();
     }
 }
예제 #2
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);
            }
        }
예제 #3
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();
            }
        }
예제 #4
0
 private void showSessionTreeview()
 {
     m_Sessions = new SessionTreeview(this, dockPanel1);
     m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
 }
예제 #5
0
        public frmPuttyWrap(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();
        }
예제 #6
0
 private void showSessionTreeview()
 {
     m_Sessions = new SessionTreeview(this, dockPanel1);
     m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
 }
예제 #7
0
        public frmPuttyWrap(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();
        }