示例#1
0
        public void ShowTranslationMessageHonorPercentage()
        {
            GtkClient client = new GtkClient(translations);

            Preferences.ConfigPath = ".";
            Preferences.Clear();

            translations.Percentage = client.MIN_TRANSLATION;
            Assert.AreEqual(false, client.ShouldShowTranslationWarning());
        }
示例#2
0
        public void ShowTranslationMessageWhenChangingVersion()
        {
            GtkClient client = new GtkClient(translations);

            Preferences.ConfigPath = ".";
            Preferences.Clear();

            translations.Percentage = client.MIN_TRANSLATION - 1;
            Assert.AreEqual(true, client.ShouldShowTranslationWarning());
            Preferences.Set <string> (Preferences.EnglishVersionKey, "n.n.n");
            Assert.AreEqual(true, client.ShouldShowTranslationWarning());
        }
示例#3
0
        void GeneratePdf(GameSession.Types types, int num_games, int gamespage, GameDifficulty difficulty, bool colorblind, string filename)
        {
            Game []     games;
            GameManager gm;
            string      msg;
            MessageType msg_type;

            games         = new Game [num_games];
            gm            = new GameManager();
            gm.ColorBlind = colorblind;
            gm.Difficulty = difficulty;
            GtkClient.GameManagerPreload(gm);
            gm.GameType = types;

            for (int n = 0; n < num_games; n++)
            {
                games [n] = gm.GetPuzzle();
            }

            if (PdfExporter.GeneratePdf(games, gamespage, filename) == true)
            {
                msg      = Catalog.GetString("The PDF file has been exported correctly.");
                msg_type = MessageType.Info;
            }
            else
            {
                msg      = Catalog.GetString("There was a problem generating the PDF file. The file has not been created.");
                msg_type = MessageType.Error;
            }

            // Notify operation result
            MessageDialog md = new MessageDialog(this, DialogFlags.Modal, msg_type, ButtonsType.Ok, msg);

            md.Run();
            md.Destroy();
        }