private static void OnThemeDialogClosed(object sender, FormClosedEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         themeDialog = null;
         LaunchSequence.NextStep(true);
     }
 }
示例#2
0
        public AppContext(string[] args)
        {
            JsonConfig.LoadConfig();
            Localization.Initialize();

            ThemeManager.importPaths = args.Where(System.IO.File.Exists).ToList();
            HandleMultiInstance();

            InitializeTrayIcon();
            LocationManager.Initialize();
            ThemeManager.Initialize();
            wpEngine.RunScheduler();
            LaunchSequence.NextStep();
            UpdateChecker.Initialize();
        }
        private static void DownloadMissingImages(List <ThemeConfig> missingThemes)
        {
            if (missingThemes.Count == 0)
            {
                filesVerified = true;
                LaunchSequence.NextStep();
                return;
            }

            ProgressDialog downloadDialog = new ProgressDialog();

            downloadDialog.FormClosed += OnDownloadDialogClosed;
            downloadDialog.Show();

            MainMenu.themeItem.Enabled = false;
            downloadDialog.InitDownload(missingThemes.FindAll(
                                            theme => theme.imagesZipUri != null));
        }
示例#4
0
        public AppContext(string[] args)
        {
            // TODO Check tab order on all dialogs
            DebugLogger.WriteLogFile();
            JsonConfig.LoadConfig();
            Localization.Initialize();

            ThemeManager.importPaths = args.Where(System.IO.File.Exists).ToList();
            HandleMultiInstance();

            InitializeTrayIcon();
            LocationManager.Initialize();
            ThemeManager.Initialize();
            ScriptManager.Initialize();

            wpEngine.RunScheduler();
            LaunchSequence.NextStep();
            UpdateChecker.Initialize();
        }
        private static void OnDownloadDialogClosed(object sender, EventArgs e)
        {
            MainMenu.themeItem.Enabled = true;
            List <ThemeConfig> missingThemes = FindMissingThemes();

            if (missingThemes.Count == 0)
            {
                filesVerified = true;
                LaunchSequence.NextStep();
            }
            else
            {
                DialogResult result = MessageBox.Show(_("Failed to download images. Click Retry " +
                                                        "to try again, Ignore to continue with some themes disabled, or Abort to " +
                                                        "exit the program."), _("Error"), MessageBoxButtons.AbortRetryIgnore,
                                                      MessageBoxIcon.Warning);

                if (result == DialogResult.Abort)
                {
                    Environment.Exit(0);
                }
                else if (result == DialogResult.Retry)
                {
                    DownloadMissingImages(missingThemes);
                }
                else
                {
                    foreach (ThemeConfig theme in missingThemes)
                    {
                        themeSettings.Remove(theme);
                    }

                    if (missingThemes.Contains(currentTheme))
                    {
                        currentTheme = null;
                    }

                    filesVerified = true;
                    LaunchSequence.NextStep();
                }
            }
        }
示例#6
0
        private static void DownloadMissingImages()
        {
            List <ThemeConfig> missingThemes = new List <ThemeConfig>();

            foreach (ThemeConfig theme in themeSettings)
            {
                string themePath = Path.Combine("themes", theme.themeId);

                if (!Directory.Exists(themePath) ||
                    (Directory.GetFiles(themePath, theme.imageFilename).Length == 0))
                {
                    missingThemes.Add(theme);
                }
            }

            if (missingThemes.Count == 0)
            {
                filesVerified = true;
                LaunchSequence.NextStep();
                return;
            }

            foreach (ThemeConfig theme in
                     missingThemes.Where(theme => string.IsNullOrEmpty(theme.imagesZipUri)))
            {
                missingThemes.Remove(theme);
                ThemeLoader.HandleError(theme.themeId,
                                        string.Format(_("Failed to find images for the '{0}' theme"), theme.themeId));
            }

            downloadDialog             = new ProgressDialog();
            downloadDialog.FormClosed += OnDownloadDialogClosed;
            downloadDialog.Show();

            MainMenu.themeItem.Enabled = false;
            downloadDialog.InitDownload(missingThemes);
        }
示例#7
0
 private static void OnLocationDialogClosed(object sender, EventArgs e)
 {
     locationDialog = null;
     LaunchSequence.NextStep();
 }
示例#8
0
 private static void OnThemeDialogClosed(object sender, EventArgs e)
 {
     themeDialog = null;
     LaunchSequence.NextStep(true);
 }
示例#9
0
 private static void OnDownloadDialogClosed(object sender, EventArgs e)
 {
     MainMenu.themeItem.Enabled = true;
     filesVerified = true;
     LaunchSequence.NextStep();
 }