Example #1
0
        private void FillTeamsTemplate()
        {
            int i     = 0;
            int index = 0;

            foreach (string template in tpt.TemplatesNames)
            {
                localcombobox.AppendText(template);
                visitorcombobox.AppendText(template);

                //Setting the selected value to the default template
                if (template == "default")
                {
                    index = i;
                }
                i++;
            }
            localcombobox.Active   = index;
            visitorcombobox.Active = index;
            if (LocalTeamTemplate == null)
            {
                LocalTeamTemplate   = tpt.Load(LocalTeamTemplateFile);
                VisitorTeamTemplate = tpt.Load(VisitorTeamTemplateFile);
            }
        }
Example #2
0
        void HandleEdited(object o, EditedArgs args)
        {
            TreeIter iter;

            teams.GetIter(out iter, new TreePath(args.Path));

            string name = (string)teams.GetValue(iter, 2);

            if (name != args.NewText)
            {
                if (templatesNames.Contains(args.NewText))
                {
                    Config.GUIToolkit.ErrorMessage(
                        Catalog.GetString("A team with the same name already exists"), this);
                    args.RetVal = false;
                }
                else
                {
                    try {
                        Team team = provider.Load(name);
                        team.Name = args.NewText;
                        provider.Save(team);
                        provider.Delete(name);
                        templatesNames.Remove(name);
                        templatesNames.Add(team.Name);
                        teams.SetValue(iter, 1, args.NewText);
                        teams.SetValue(iter, 2, args.NewText);
                    } catch (Exception ex) {
                        Config.GUIToolkit.ErrorMessage(ex.Message);
                    }
                }
            }
        }
Example #3
0
 public void Load(string name)
 {
     if (name != null)
     {
         template = teamsTemplates.Load(name);
         if (template.Shield != null)
         {
             shieldimage.Pixbuf = template.Shield.Value;
         }
         namelabel.Text = template.TeamName;
         //teamtaggerwidget.Team = template;
     }
 }