Example #1
0
        /*
         * public static void ExportToCSV(Project project) {
         *      FileChooserDialog fChooser;
         *      FileFilter filter;
         *      string outputFile;
         *      CSVExport export;
         *
         *      fChooser = new FileChooserDialog(Catalog.GetString("Select Export File"),
         *                                       window,
         *                                       FileChooserAction.Save,
         *                                       "gtk-cancel",ResponseType.Cancel,
         *                                       "gtk-save",ResponseType.Accept);
         *      fChooser.SetCurrentFolder(MainClass.HomeDir());
         *      fChooser.DoOverwriteConfirmation = true;
         *      filter = new FileFilter();
         *      filter.Name = "CSV File";
         *      filter.AddPattern("*.csv");
         *      fChooser.AddFilter(filter);
         *      if(fChooser.Run() == (int)ResponseType.Accept) {
         *              outputFile=fChooser.Filename;
         *              outputFile = System.IO.Path.ChangeExtension(outputFile,"csv");
         *              export = new CSVExport(project, outputFile);
         *              export.WriteToFile();
         *      }
         *      fChooser.Destroy();
         * }*/

        private void CreateThumbnails(Project project)
        {
            MultimediaFactory factory;
            IFramesCapturer   capturer;
            BusyDialog        dialog;

            dialog = new BusyDialog();
            dialog.TransientFor = mainWindow;
            dialog.Message      = Catalog.GetString("Creating video thumbnails. This can take a while.");
            dialog.Show();
            dialog.Pulse();

            /* Create all the thumbnails */
            factory  = new MultimediaFactory();
            capturer = factory.getFramesCapturer();
            capturer.Open(project.Description.File.FilePath);
            foreach (Play play in project.AllPlays())
            {
                try {
                    capturer.SeekTime(play.Start.MSeconds + ((play.Stop - play.Start).MSeconds / 2),
                                      true);
                    play.Miniature = capturer.GetCurrentFrame(Constants.THUMBNAIL_MAX_WIDTH,
                                                              Constants.THUMBNAIL_MAX_HEIGHT);
                    dialog.Pulse();
                } catch (Exception ex) {
                    Log.Exception(ex);
                }
            }
            capturer.Dispose();
            dialog.Destroy();
        }
Example #2
0
        private void DoTranslationUpdate(IList <Translation> translations)
        {
            _agsEditor.SaveGameFiles();
            CompileMessages errors = (CompileMessages)BusyDialog.Show("Please wait while the translation(s) are updated...", new BusyDialog.ProcessingHandler(UpdateTranslationsProcess), translations);

            _guiController.ShowOutputPanel(errors);
            _guiController.ShowMessage("Translation(s) updated.", MessageBoxIcon.Information);
        }
Example #3
0
        private void ReplaceGameTextWithTranslation(Translation translation)
        {
            _agsEditor.SaveGameFiles();

            if (!CheckAllTranslationsAreWritable())
            {
                return;
            }

            translation.LoadData();
            CompileMessages errors = (CompileMessages)BusyDialog.Show("Please wait while the game text is replaced...", new BusyDialog.ProcessingHandler(ReplaceGameTextWithTranslationProcess), translation);

            _guiController.ShowOutputPanel(errors);
            Factory.Events.OnRefreshAllComponentsFromGame();
            _agsEditor.SaveGameFiles();
            _guiController.ShowMessage("Game text replaced with the translation text.", MessageBoxIcon.Information);
        }
Example #4
0
        private void CheckForUpdates()
        {
            try
            {
                string dataDownload = (string)BusyDialog.Show("Please wait while we check for updates...", new BusyDialog.ProcessingHandler(DownloadUpdateStatusThread), null);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(dataDownload);
                string             newVersionName;
                VersionCheckStatus status = CompareVersionWithXML(doc, "CurrentVersion", out newVersionName);

                if (status == VersionCheckStatus.ServerNewer)
                {
                    if (_guiController.ShowQuestion("A newer version of AGS (" + newVersionName + ") is available on the AGS website. Would you like to go there now?") == DialogResult.Yes)
                    {
                        LaunchBrowserAtAGSWebsite();
                    }
                }
                else if (status == VersionCheckStatus.ThisNewer)
                {
                    // This is newer than the website version, so it must be a beta
                    // version. So, see if a newer beta is available.
                    status = CompareVersionWithXML(doc, "BetaVersion", out newVersionName);
                    if (status == VersionCheckStatus.ServerNewer)
                    {
                        if (_guiController.ShowQuestion("A newer beta version of AGS (" + newVersionName + ") is available on the AGS forums. Would you like to go there now?") == DialogResult.Yes)
                        {
                            LaunchBrowserAtAGSForums();
                        }
                    }
                    else
                    {
                        _guiController.ShowMessage("There are no further beta updates at this time.", MessageBoxIcon.Information);
                    }
                }
                else
                {
                    _guiController.ShowMessage("This version of AGS is up to date.", MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                _guiController.ShowMessage("Unable to check for updates. Your internet connection may be down.\nPlease visit the AGS website to see if an updated version is available.\n\nError details: " + ex.Message, MessageBoxIcon.Warning);
            }
        }