Exemplo n.º 1
0
        internal static void CreateAndShowDialog(Version current, GitHub.OnlineVersion available, Form parent)
        {
            using (NewVersionForm f = new NewVersionForm())
            {
                f.mDownloadUrl           = available.DownloadUrl;
                f.mPageUrl               = available.HtmlUrl;
                f.LblCurrentVersion.Text = current.ToString(3);
                f.LblLatestVersion.Text  = available.Version.ToString(3);
                if (available.IsPreRelease)
                {
                    f.LblLatestVersion.Text = f.LblLatestVersion.Text + " pre-release";
                }

                DialogResult rv = f.ShowDialog(parent);

                if (rv == DialogResult.OK)
                {
                    System.Windows.Forms.Application.Exit();                     //exit (spawned process will apply update)
                }
                else if (rv == DialogResult.Abort)
                {
                    System.Windows.Forms.MessageBox.Show(Strings.BoxAutoUpdateFailed, Strings.BoxAutoUpdateResult, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 2
0
        internal static void CreateAndShowDialog(Version current, Version latest, string name, string url, Form parent)
        {
            using (NewVersionForm f = new NewVersionForm(url))
            {
                f.LblCurrentVersion.Text = current.ToString(3);
                f.LblLatestVersion.Text  = latest.ToString(3);

                DialogResult rv = f.ShowDialog(parent);

                if (rv == DialogResult.OK)
                {
                    System.Windows.Forms.Application.Exit();                     //exit (spawned process will apply update)
                }
                else if (rv == DialogResult.Abort)
                {
                    System.Windows.Forms.MessageBox.Show(Strings.BoxAutoUpdateFailed, Strings.BoxAutoUpdateResult, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 3
0
        internal static void CreateAndShowDialog(Version current, Version latest, string name, string url, Form parent)
        {
            using (NewVersionForm f = new NewVersionForm(url))
            {
                f.LblCurrentVersion.Text = current.ToString(3);
                f.LblLatestVersion.Text  = latest.ToString(3);

                DialogResult rv = f.ShowDialog(parent);

                if (rv == DialogResult.OK && System.Windows.Forms.MessageBox.Show("Update success! Please restart LaserGRBL to apply update.\r\nRestart now?", "Update result", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK)
                {
                    System.Windows.Forms.Application.Restart();
                }
                else if (rv == DialogResult.Abort)
                {
                    System.Windows.Forms.MessageBox.Show("Update fail!\r\nPlease download the new version from lasergrbl site.", "Update result", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                }
            }
        }