Changeset - ca4042a2cbb4
[Not reviewed]
Jason Maltzen (jmaltzen) - 9 years ago 2016-01-23 20:18:34
jason.maltzen@unsanctioned.net
Update recipe information display if the currently-selected recipe changes.
1 file changed with 31 insertions and 12 deletions:
0 comments (0 inline, 0 general)
RecipeGeneratorWindow.cs
Show inline comments
...
 
@@ -415,3 +415,3 @@ namespace DesertPaintLab
 
                {
 
                    //Console.WriteLine("Add new recipe for {0}", args.Color);
 
                    //Console.WriteLine("Add new recipe for {0}", recipeColor);
 
                    //    bool isMissingReactions = args.Recipe.CheckMissingReactions(ref missingReactions);
...
 
@@ -421,2 +421,6 @@ namespace DesertPaintLab
 
                }
 
                //else
 
                //{
 
                //    Console.WriteLine("Updated recipe for {0}", recipeColor);
 
                //}
 
                profile.SetRecipe(recipe);
...
 
@@ -430,2 +434,12 @@ namespace DesertPaintLab
 
                }
 
                Gtk.TreeModel model;
 
                Gtk.TreeSelection selection = recipeList.Selection;
 
                if ((selection != null) && selection.GetSelected(out model, out iter))
 
                {
 
                    string colorName = (string)colorStore.GetValue(iter, 0);
 
                    if (colorName.Equals(recipeColor))
 
                    {
 
                        ShowColor(recipe);
 
                    }
 
                }
 
            }
...
 
@@ -474,2 +488,17 @@ namespace DesertPaintLab
 

	
 
        private void ShowColor(PaintRecipe recipe)
 
        {
 
            Gtk.ListStore store = (Gtk.ListStore)recipeIngredientsView.Model;
 
            store.Clear();
 
            if (recipe.CheckMissingReactions(ref missingReactions))
 
            {
 
                statusLabel.Text = "WARNING: This recipe includes reactions that have not yet been recorded.";
 
            }
 
            foreach (PaintRecipe.RecipeIngredient ingredient in recipe.Ingredients)
 
            {
 
                store.AppendValues(ingredient.quantity.ToString(), ingredient.name);
 
            }
 
            paintSwatch.Color = recipe.ReactedColor;
 
        }
 

	
 
        protected void OnColorSelected(object o, EventArgs args)
...
 
@@ -485,14 +514,4 @@ namespace DesertPaintLab
 
                {
 
                    Gtk.ListStore store = (Gtk.ListStore)recipeIngredientsView.Model;
 
                    store.Clear();
 
                    if (recipe.CheckMissingReactions(ref missingReactions))
 
                    {
 
                        statusLabel.Text = "WARNING: This recipe includes reactions that have not yet been recorded.";
 
                    ShowColor(recipe);
 
                    }
 
                    foreach (PaintRecipe.RecipeIngredient ingredient in recipe.Ingredients)
 
                    {
 
                        store.AppendValues(ingredient.quantity.ToString(), ingredient.name);
 
                    }
 
                }
 
                paintSwatch.Color = recipe.ReactedColor;
 
            }
0 comments (0 inline, 0 general)