예제 #1
0
        public FormNewVersion(string publishedVersion)
        {
            InitializeComponent();
            this.publishedMyZillaVersion = publishedVersion;

            this._appSettings = MyZillaSettingsDataSet.CreateInstance(Utils.UserAppDataPath);

            this.settings = _appSettings.GetGlobalSettings();

            chkDoNotRemindLater.Checked = !settings.CheckForUpdate;
        }
예제 #2
0
        private void LoadGlobalSettings()
        {
            settings = _appSettings.GetGlobalSettings();

            chkShowLoadingForm.Checked = settings.ShowLoadingForm;

            chkEditConfirm.Checked = settings.ConfirmSuccessfullyEditBug;

            chkShowBugsCount.Checked = settings.ShowBugsCount;

            txtPath.Text = settings.ReportFilesPath;
        }
예제 #3
0
        void bkgAddBug_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            bool continueBugEdit = false;

            try
            {
                // check the status of the async operation.

                if (e.Error != null)
                {
                    //display error message from bugzilla
                    string errorMessage = e.Error.Message;

                    DialogResult dr = MessageBox.Show(Utils.FormContainer, errorMessage, Messages.Error, MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);

                    continueBugEdit = (dr == DialogResult.Retry);

#if DEBUG
                    (Utils.FormContainer as MainForm).wb.DocumentText = MyZilla.BL.Interfaces.Utils.htmlContents;
#endif
                }
                else
                {
                    // status OK
                    if (!e.Cancelled && e.Error == null)
                    {
                        string strResult = e.Result.ToString();

#if DEBUG
                        (Utils.FormContainer as MainForm).wb.DocumentText = MyZilla.BL.Interfaces.Utils.htmlContents;
#endif

                        // set the last selected item for some properties

                        Utils.lastSelectedHardware = cmbHardware.Text;

                        Utils.lastSelectedOS = cmbOS.Text;

                        Utils.lastSelectedProduct = cmbProduct.Text;

                        Utils.lastSelectedVersion = cmbVersion.Text;

                        Utils.lastSelectedMilestone = cmbMilestone.Text;

                        // confirmation message
                        MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance();

                        TDSettings.GlobalSettingsRow globalSettings = _appSettings.GetGlobalSettings();

                        if (globalSettings.ConfirmSuccessfullyEditBug)
                        {
                            DialogResult dr = MessageBox.Show(this, strResult, Messages.Info, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }

                if (!continueBugEdit)
                {
                    btnCancel_Click(this, null);
                }

                btnInsertBug.Enabled = true;
            }

            catch (Exception ex)
            {
                // The thread could continue to execute after the form was closed.
                // In this case, an exception is generated. It is no need to be logged or be shown those type of exceptions.
                if (!_formClosed)
                {
                    MyLogger.Write(ex, "bkgAddBug_RunWorkerCompleted", LoggingCategory.Exception);

                    MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #4
0
        private void bkgBugUpdate_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            try
            {
                // check the status of the async operation.

                if (e.Error != null)
                {
                    string errorMessage = Messages.ErrUpdBug + Environment.NewLine + e.Error.Message;

                    MessageBox.Show(Utils.FormContainer, errorMessage, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }

                // status OK
                if (!e.Cancelled && e.Error == null)
                {
                    ArrayList al = e.Result as ArrayList;

                    string errorMessage = al[0].ToString();

                    string strResult = al[1].ToString();

                    btnSave.Enabled = true;

                    if (string.IsNullOrEmpty(errorMessage))
                    {
                        // confirmation message
                        TDSettings.GlobalSettingsRow globalSettings = _appSettings.GetGlobalSettings();

                        if (globalSettings.ConfirmSuccessfullyEditBug)
                        {
                            MessageBox.Show(this, strResult, Messages.Info, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }

                        _updateSuccessfully = true;

                        btnCancel_Click(null, null);
                    }
                    else
                    {
                        MessageBox.Show(this, strResult, Messages.Info, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        GetBugDetailsAndSetControls(bugId, false);
                    }
                }


#if DEBUG
                (Utils.FormContainer as MainForm).wb.DocumentText = MyZilla.BL.Interfaces.Utils.htmlContents;
#endif
            }
            catch (Exception ex)
            {
                // The thread could continue to execute after the form was closed.
                // In this case, an exception is generated. It is no need to be logged or be shown those type of exceptions.
                if (!_formClosed)
                {
                    MyLogger.Write(ex, "bkgBugUpdate_RunWorkerCompleted", LoggingCategory.Exception);

                    MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }