Example #1
0
        private void BrowseWorkspaceBtn_Click(object sender, EventArgs e)
        {
            this.TopMost = false;

            P4ScmProvider _scm = new P4ScmProvider(null);

            _scm.Connection.Port = ServerPort;
            _scm.Connection.User = UserName;

            _scm.Connection.Connect(true, null, true);
            if (_scm.Connected && _scm.Connection.isLoggedIn())
            {
                WorkspacesBrowserDlg dlg = new WorkspacesBrowserDlg(_scm, "connection", null, null);
                dlg.TopMost = true;

                if (DialogResult.Cancel != dlg.ShowDialog())
                {
                    if ((dlg.SelectedWorkspace != null) && (dlg.SelectedWorkspace.Name != null))
                    {
                        WorkspaceTB.Text = dlg.SelectedWorkspace.Name.ToString();
                    }
                }
                _scm.Dispose();
            }
            this.TopMost = true;
        }
Example #2
0
        private void workspaceBrowseBtn_Click(object sender, EventArgs e)
        {
            WorkspacesBrowserDlg dlg = new WorkspacesBrowserDlg(_scm, "get_revision", null, null);

            if (DialogResult.Cancel != dlg.ShowDialog())
            {
                if (dlg.SelectedWorkspace != null)
                {
                    workspaceTB.Text = dlg.SelectedWorkspace.Name.ToString();
                }
            }
        }
Example #3
0
        private void path1BrowseBtn_Click(object sender, EventArgs e)
        {
            if (specifier1stCB.SelectedIndex == 1)             // changelist
            {
                string path = path1TB.Text;
                SubmittedChangelistsBrowserDlg dlg = new SubmittedChangelistsBrowserDlg(_scm, "diff_" + path);

                if (DialogResult.Cancel != dlg.ShowDialog())
                {
                    _changelistToAdd = dlg.SelectedChangelist;
                    if (_changelistToAdd != null)
                    {
                        Text = _changelistToAdd.Id.ToString();
                    }
                }
            }

            if (specifier1stCB.SelectedIndex == 3)             // label
            {
                LabelsBrowserDlg dlg = new LabelsBrowserDlg();
                if (DialogResult.OK == dlg.ShowDialog(this))
                {
                    P4.Label label = dlg.Label;
                    if (label != null)
                    {
                        path1ValueTB.Text = label.Id;
                    }
                }
            }

            if (specifier1stCB.SelectedIndex == 4)             // workspace
            {
                WorkspacesBrowserDlg dlg = new WorkspacesBrowserDlg(_scm, "diff_against", null, null);

                if (DialogResult.Cancel != dlg.ShowDialog())
                {
                    _workspaceToAdd = dlg.SelectedWorkspace;

                    if (_workspaceToAdd != null)
                    {
                        path1ValueTB.Text = _workspaceToAdd.Name.ToString();
                    }
                }
            }
        }
Example #4
0
        private void browseBtn_Click(object sender, EventArgs e)
        {
            if (specifierCB.SelectedIndex == 1)             // changelist
            {
                SubmittedChangelistsBrowserDlg dlg = new SubmittedChangelistsBrowserDlg(_scm, "get_revision");

                if (DialogResult.Cancel != dlg.ShowDialog())
                {
                    if (dlg.SelectedChangelist != null)
                    {
                        _changelistToAdd = dlg.SelectedChangelist;
                        ValueTB.Text     = _changelistToAdd.Id.ToString();
                    }
                }
            }

            if (specifierCB.SelectedIndex == 3)             // label
            {
                LabelsBrowserDlg dlg = new LabelsBrowserDlg();
                if (DialogResult.OK == dlg.ShowDialog(this))
                {
                    P4.Label label = dlg.Label;
                    if (label != null)
                    {
                        ValueTB.Text = label.Id;
                    }
                }
            }

            if (specifierCB.SelectedIndex == 4)             // workspace
            {
                WorkspacesBrowserDlg dlg = new WorkspacesBrowserDlg(_scm, "get_revision", null, null);

                if (DialogResult.Cancel != dlg.ShowDialog())
                {
                    if (dlg.SelectedWorkspace != null)
                    {
                        ValueTB.Text = dlg.SelectedWorkspace.Name.ToString();
                    }
                }
            }
        }