public virtual void Clear()
 {
     store.Clear();
     propertyRows.Clear();
     sensitives.Clear();
     invisibles.Clear();
 }
Beispiel #2
0
        private void on_btnBeginSearch_clicked(object sender, EventArgs args)
        {
            btnBeginSearch.Sensitive = false;
            btnStopSearch.Sensitive  = true;

            /*uint MinSize;
             * try{MinSize=Convert.ToUInt32(textBoxMinSize.Text)*1048576;}	catch{MinSize=0;}
             * uint MaxSize;
             * try{MaxSize=Convert.ToUInt32(textBoxMaxSize.Text)*1048576;}	catch{MaxSize=0;}
             * uint Avaibility;
             * try{Avaibility=Convert.ToUInt32(textBoxAvaibility.Text);} catch{Avaibility=0;}
             * string searchType="";
             * switch (comboBoxSearchType.SelectedIndex)
             * {
             *      case 0: searchType="";
             *                      break;
             *      case 1: searchType="Video";
             *                      break;
             *      case 2: searchType="Pro";
             *                      break;
             *      case 3: searchType="Audio";
             *                      break;
             *      case 4: searchType="Image";
             *                      break;
             * }*/

            krnGateway.Search(m_SearchCount, txtSearch.Text, true, "", 0,
                              0, 0, "");
            m_SearchCount++;
            stSearch.Clear();
        }
        void Fill()
        {
            if (destroyed)
            {
                return;
            }

            stackStore.Clear();
            valueView.ClearValues();

            labelType.Markup  = GettextCatalog.GetString("A <b>{0}</b> was thrown.", exception.Type);
            labelMessage.Text = string.IsNullOrEmpty(exception.Message) ?
                                string.Empty :
                                exception.Message;

            ShowStackTrace(exception, false);

            if (!exception.IsEvaluating && exception.Instance != null)
            {
                valueView.AddValue(exception.Instance);
                valueView.ExpandRow(new TreePath("0"), false);
            }

            if (exception.StackIsEvaluating)
            {
                stackStore.AppendValues(GettextCatalog.GetString("Loading..."), "", 0, 0);
            }
        }
Beispiel #4
0
 public void FillInspectors(string filter)
 {
     categories.Clear();
     treeStore.Clear();
     foreach (var node in RefactoringService.GetInspectors(mimeType))
     {
         if (!string.IsNullOrEmpty(filter) && node.Title.IndexOf(filter, StringComparison.OrdinalIgnoreCase) < 0)
         {
             continue;
         }
         Gtk.TreeIter iter;
         if (!categories.TryGetValue(node.Category, out iter))
         {
             iter = treeStore.AppendValues("<b>" + node.Category + "</b>");
             categories [node.Category] = iter;
         }
         var title = node.Title;
         if (!string.IsNullOrEmpty(filter))
         {
             var idx = title.IndexOf(filter, StringComparison.OrdinalIgnoreCase);
             title = title.Substring(0, idx) + "<span bgcolor=\"yellow\">" + title.Substring(idx, filter.Length) + "</span>" + title.Substring(idx + filter.Length);
         }
         treeStore.AppendValues(iter, title, node.GetSeverity(), node);
     }
     treeviewInspections.ExpandAll();
 }
Beispiel #5
0
        public void SetFormat(CodeFormatDescription description, T settings)
        {
            this.description             = description;
            this.settings                = settings;
            options.ShowLineNumberMargin = false;
            options.ShowFoldMargin       = false;
            options.ShowIconMargin       = false;
            options.ShowInvalidLines     = false;
            options.ShowSpaces           = options.ShowTabs = options.ShowEolMarkers = false;
            options.ColorScheme          = PropertyService.Get("ColorScheme", "Default");
            options.Zoom                  = 0.8;
            texteditor1.Options           = options;
            texteditor1.Document.ReadOnly = true;
            texteditor1.Document.MimeType = description.MimeType;
            store.Clear();

            if (description != null)
            {
                foreach (CodeFormatCategory category in description.SubCategories)
                {
                    AppendCategory(store, TreeIter.Zero, category);
                }
            }
            TreeviewCategories.ShowAll();
        }
        public void UpdateDisplay()
        {
            treeViewState.Save();

            store.Clear();

            if (DebuggingService.DebuggerSession == null || DebuggingService.DebuggerSession.IsRunning)
            {
                return;
            }

            try {
                ProcessInfo[] currentProcesses = DebuggingService.DebuggerSession.GetProcesses();

                if (currentProcesses.Length == 1)
                {
                    AppendThreads(TreeIter.Zero, currentProcesses [0]);
                }
                else
                {
                    foreach (ProcessInfo p in currentProcesses)
                    {
                        TreeIter it = store.AppendValues(null, p.Id.ToString(), p.Name, p, (int)Pango.Weight.Normal, "");
                        AppendThreads(it, p);
                    }
                }
            } catch (Exception ex) {
                MessageService.ShowException(ex);
            }

            tree.ExpandAll();

            treeViewState.Load();
        }
 public void LoadRepositories()
 {
     store.Clear();
     foreach (Repository r in VersionControlService.GetRepositories())
     {
         LoadRepositories(r, Gtk.TreeIter.Zero);
     }
 }
Beispiel #8
0
 /// <summary>
 /// Textfeld leeren
 /// </summary>
 protected void OnClear(object sender, System.EventArgs e)
 {
     treeStore.Clear();
     calcResultOutputLine1_1.LabelProp = "";
     calcResultOutputLine1_2.LabelProp = "";
     calcResultOutputLine2.LabelProp   = "";
     calcResultOutputLine3.LabelProp   = "";
     calcResultOutputLine4.LabelProp   = "";
 }
Beispiel #9
0
 protected void CreateEmptyTreeStruct()
 {
     ts.Clear();
     TIprj           = ts.AppendValues(this.GPrj.name);
     TIunits         = ts.AppendValues(TIprj, this.GPrj.Units.name);
     TIcompumethods  = ts.AppendValues(TIprj, this.GPrj.CompuMethods.name);
     TImessages      = ts.AppendValues(TIprj, this.GPrj.Messages.name);
     TIprocesses     = ts.AppendValues(TIprj, this.GPrj.Processes.name);
     TItasks         = ts.AppendValues(TIprj, this.GPrj.Tasks.name);
     TIstatemachines = ts.AppendValues(TIprj, this.GPrj.StateMachines.name);
 }
Beispiel #10
0
        public void UpdateDisplay()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            treeState.Save();

            store.Clear();
            if (breakpoints != null)
            {
                lock (breakpoints) {
                    foreach (Breakpoint bp in breakpoints.GetBreakpoints())
                    {
                        string hitCount = bp.HitCountMode != HitCountMode.None ? bp.CurrentHitCount.ToString() : "";
                        string traceExp = bp.HitAction == HitAction.PrintExpression ? bp.TraceExpression : "";
                        string traceVal = bp.HitAction == HitAction.PrintExpression ? bp.LastTraceValue : "";
                        string name;

                        if (bp is FunctionBreakpoint)
                        {
                            FunctionBreakpoint fb = (FunctionBreakpoint)bp;

                            if (fb.ParamTypes != null)
                            {
                                name = fb.FunctionName + "(" + string.Join(", ", fb.ParamTypes) + ")";
                            }
                            else
                            {
                                name = fb.FunctionName;
                            }
                        }
                        else
                        {
                            name = string.Format("{0}:{1},{2}", ((Breakpoint)bp).FileName, bp.Line, bp.Column);
                        }

                        if (bp.Enabled)
                        {
                            store.AppendValues("md-breakpoint", true, name, bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                        }
                        else
                        {
                            store.AppendValues("md-breakpoint-disabled", false, name, bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                        }
                    }
                }
            }

            treeState.Load();
        }
Beispiel #11
0
 private void PopulateAutoConnectList()
 {
     autoConnectTreeStore.Clear();
     foreach (object[] row in networksListStore)
     {
         NetworkInfo networkInfo = (NetworkInfo)row[0];
         TreeIter    networkIter = autoConnectTreeStore.AppendValues(networkInfo);
         foreach (TrustedNodeInfo nodeInfo in networkInfo.TrustedNodes.Values)
         {
             autoConnectTreeStore.AppendValues(networkIter, nodeInfo);
         }
     }
 }
Beispiel #12
0
        public void FillInspectors(string filter)
        {
            categories.Clear();
            treeStore.Clear();
            foreach (var k in severities.Keys)
            {
                var node = k as CodeIssueProvider;
                if (node == null)
                {
                    continue;
                }
                if (!string.IsNullOrEmpty(filter) && node.Title.IndexOf(filter, StringComparison.OrdinalIgnoreCase) < 0)
                {
                    continue;
                }
                Gtk.TreeIter iter;
                if (!categories.TryGetValue(node.Category, out iter))
                {
                    iter = treeStore.AppendValues("<b>" + node.Category + "</b>");
                    categories [node.Category] = iter;
                }
                var title = node.Title;
                if (!string.IsNullOrEmpty(filter))
                {
                    var idx = title.IndexOf(filter, StringComparison.OrdinalIgnoreCase);
                    if (idx >= 0)
                    {
                        title = title.Substring(0, idx) + "<span bgcolor=\"yellow\">" + title.Substring(idx, filter.Length) + "</span>" + title.Substring(idx + filter.Length);
                    }
                }
                var nodeIter = treeStore.AppendValues(iter, title, node);

                if (node.HasSubIssues)
                {
                    foreach (var subIssue in node.SubIssues)
                    {
                        title = subIssue.Title;
                        if (!string.IsNullOrEmpty(filter))
                        {
                            var idx = title.IndexOf(filter, StringComparison.OrdinalIgnoreCase);
                            if (idx >= 0)
                            {
                                title = title.Substring(0, idx) + "<span bgcolor=\"yellow\">" + title.Substring(idx, filter.Length) + "</span>" + title.Substring(idx + filter.Length);
                            }
                        }
                        treeStore.AppendValues(nodeIter, title, subIssue);
                    }
                }
            }
            treeviewInspections.ExpandAll();
        }
Beispiel #13
0
        protected void OnBtnAccelAply1Clicked(object sender, System.EventArgs e)
        {
            string active = cbKeyBinding.ActiveText;
            string file   = System.IO.Path.Combine(MainClass.Paths.SettingDir, "keybinding");

            switch (active)
            {
            case WIN: {
                KeyBindings.CreateKeyBindingsWin(file);
                break;
            }

            case MACOSX: {
                KeyBindings.CreateKeyBindingsMac(file);
                break;
            }

            case JAVA: {
                KeyBindings.CreateKeyBindingsJava(file);
                break;
            }

            case VisualC: {
                KeyBindings.CreateKeyBindingsVisualC(file);
                break;
            }

            default:
                break;
            }
            keyBindFile = MainClass.KeyBinding;

            curentBind = MainClass.Tools.Clone <KeyBindingSection>(keyBindFile.KeyBindingSection);
            keybStore.Clear();
            foreach (KeyBindingSection kbs in  curentBind)
            {
                TreeIter tiParent = keybStore.AppendValues(kbs.Name, "", "", (int)Pango.Weight.Bold, null);
                foreach (KeyBinding kb in kbs.KeyBinding)
                {
                    keybStore.AppendValues(tiParent, kb.Name, kb.Description, kb.Key, (int)Pango.Weight.Normal, kb);
                }
            }

            tvKeyBind.ExpandAll();
            tvKeyBind.ColumnsAutosize();
            //MainClass.Settings.SaveSettings();
        }
        public void UpdateDisplay()
        {
            treeState.Save();

            store.Clear();
            if (bps != null)
            {
                foreach (Breakpoint bp in bps.GetBreakpoints())
                {
                    string traceExp = bp.HitAction == HitAction.PrintExpression ? bp.TraceExpression : "";
                    string traceVal = bp.HitAction == HitAction.PrintExpression ? bp.LastTraceValue : "";
                    string hitCount = bp.HitCount > 0 ? bp.HitCount.ToString() : "";
                    string name;

                    if (bp is FunctionBreakpoint)
                    {
                        FunctionBreakpoint fb = (FunctionBreakpoint)bp;

                        if (fb.ParamTypes != null)
                        {
                            name = fb.FunctionName + "(" + string.Join(", ", fb.ParamTypes) + ")";
                        }
                        else
                        {
                            name = fb.FunctionName;
                        }
                    }
                    else
                    {
                        name = ((Breakpoint)bp).FileName + ":" + bp.Line.ToString();
                    }

                    if (bp.Enabled)
                    {
                        store.AppendValues("md-breakpoint", true, name, bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                    }
                    else
                    {
                        store.AppendValues("md-breakpoint-disabled", false, name, bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                    }
                }
            }
            treeState.Load();
        }
        public void FillTreeStore(string filter)
        {
            treeStore.Clear();
            foreach (var node in providerStates.Keys)
            {
                if (!string.IsNullOrEmpty(filter) && node.Title.IndexOf(filter, StringComparison.OrdinalIgnoreCase) < 0)
                {
                    continue;
                }

                var title = node.Title;
                if (!string.IsNullOrEmpty(filter))
                {
                    var idx = title.IndexOf(filter, StringComparison.OrdinalIgnoreCase);
                    title = title.Substring(0, idx) + "<span bgcolor=\"yellow\">" + title.Substring(idx, filter.Length) + "</span>" + title.Substring(idx + filter.Length);
                }

                treeStore.AppendValues(title, providerStates [node], node);
            }
        }
Beispiel #16
0
        void Fill()
        {
            if (destroyed)
            {
                return;
            }

            stackStore.Clear();
            valueView.ClearValues();

            labelType.Markup  = GettextCatalog.GetString("<b>{0}</b> has been thrown", exception.Type);
            labelMessage.Text = string.IsNullOrEmpty(exception.Message)?
                                string.Empty:
                                Mono.Debugging.Evaluation.ExpressionEvaluator.UnEscapeString(exception.Message);

            ShowStackTrace(exception, false);

            valueView.AddValue(exception.Instance);
            valueView.ExpandRow(new TreePath("0"), false);
        }
        void refillOutlineStore()
        {
            DispatchService.AssertGuiThread();
            Gdk.Threads.Enter();
            refreshingOutline = false;
            if (outlineTreeStore == null || !outlineTreeView.IsRealized)
            {
                return;
            }
            outlineTreeStore.Clear();

            if (CU != null)
            {
                DateTime start = DateTime.Now;
                RefillOutlineStore(CU, outlineTreeStore);
                outlineTreeView.ExpandAll();
                outlineTreeView.ExpandAll();
                LoggingService.LogDebug("Built outline in {0}ms", (DateTime.Now - start).Milliseconds);
            }

            Gdk.Threads.Leave();
        }
        public void FillTreeStore(string filter)
        {
            treeStore.Clear();
            string disabledNodes = PropertyService.Get("ContextActions." + mimeType, "");

            foreach (var node in RefactoringService.ContextAddinNodes.Where(n => n.MimeType == mimeType))
            {
                if (!string.IsNullOrEmpty(filter) && node.Title.IndexOf(filter, StringComparison.OrdinalIgnoreCase) < 0)
                {
                    continue;
                }

                bool isEnabled = disabledNodes.IndexOf(node.IdString) < 0;
                var  title     = node.Title;
                if (!string.IsNullOrEmpty(filter))
                {
                    var idx = title.IndexOf(filter, StringComparison.OrdinalIgnoreCase);
                    title = title.Substring(0, idx) + "<span bgcolor=\"yellow\">" + title.Substring(idx, filter.Length) + "</span>" + title.Substring(idx + filter.Length);
                }

                treeStore.AppendValues(title, isEnabled, node);
            }
        }
Beispiel #19
0
        public void UpdateDisplay()
        {
            treeState.Save();

            store.Clear();
            if (bps != null)
            {
                foreach (Breakpoint bp in bps.GetBreakpoints())
                {
                    string traceExp = bp.HitAction == HitAction.PrintExpression ? bp.TraceExpression : "";
                    string traceVal = bp.HitAction == HitAction.PrintExpression ? bp.LastTraceValue : "";
                    string hitCount = bp.HitCount > 0 ? bp.HitCount.ToString() : "";
                    if (bp.Enabled)
                    {
                        store.AppendValues("md-breakpoint", true, bp.FileName + ":" + bp.Line.ToString(), bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                    }
                    else
                    {
                        store.AppendValues("md-breakpoint-disabled", false, bp.FileName + ":" + bp.Line.ToString(), bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                    }
                }
            }
            treeState.Load();
        }
Beispiel #20
0
 public void Clear()
 {
     version++;
     Tree.Clear();
 }
Beispiel #21
0
    private void RefreshFileInfo()
    {
        if (gameInfoList == null)
        {
            return;
        }
        try
        {
            gameInfoLines = new List <string>();
            gameInfoList.Clear();
            if (System.IO.Path.GetExtension(filechooserwidget2.Filename).ToLower() == ".nes")
            {
                Gtk.TreeIter iter;
                INes         header = new INes();
                header.Load(filechooserwidget2.Filename, false);
                if (header.IsValid)
                {
                    #region Database

                    // Add database info if found !
                    //Get database info
                    bool found = false;
                    NesCartDatabaseGameInfo      info = NesCartDatabase.Find(header.SHA1, out found);
                    NesCartDatabaseCartridgeInfo cart = new NesCartDatabaseCartridgeInfo();
                    if (info.Cartridges != null)
                    {
                        foreach (NesCartDatabaseCartridgeInfo cartinf in info.Cartridges)
                        {
                            if (cartinf.SHA1.ToLower() == header.SHA1.ToLower())
                            {
                                cart = cartinf;
                                break;
                            }
                        }
                    }
                    if (found)
                    {
                        iter = gameInfoList.AppendValues("Info From Database");
                        gameInfoLines.Add("[Info From Database]");
                        FieldInfo[] Fields = typeof(NesCartDatabaseGameInfo).GetFields(BindingFlags.Public
                                                                                       | BindingFlags.Instance);
                        for (int i = 0; i < Fields.Length; i++)
                        {
                            if (Fields[i].FieldType == typeof(System.String))
                            {
                                try
                                {
                                    gameInfoList.AppendValues(iter, Fields[i].Name.Replace("_", " "), Fields[i].GetValue
                                                                  (info).ToString());
                                    gameInfoLines.Add(Fields[i].Name.Replace("_", " ") + " : " + Fields[i].GetValue
                                                          (info).ToString());
                                }
                                catch
                                {
                                }
                            }
                        }

                        //chips
                        if (cart.chip_type != null)
                        {
                            for (int i = 0; i < cart.chip_type.Count; i++)
                            {
                                gameInfoList.AppendValues(iter, "Chip " + (i + 1), cart.chip_type[i]);
                                gameInfoLines.Add("Chip " + (i + 1) + " : " + cart.chip_type[i]);
                            }
                        }

                        //Cartridge
                        Fields = typeof(NesCartDatabaseCartridgeInfo).GetFields(BindingFlags.Public
                                                                                | BindingFlags.Instance);
                        for (int i = 0; i < Fields.Length; i++)
                        {
                            if (Fields[i].FieldType == typeof(System.String))
                            {
                                try
                                {
                                    gameInfoList.AppendValues(iter, Fields[i].Name.Replace("_", " "), Fields[i].GetValue
                                                                  (cart).ToString());
                                    gameInfoLines.Add(Fields[i].Name.Replace("_", " ") + " : " + Fields[i].GetValue
                                                          (cart).ToString());
                                }
                                catch
                                {
                                }
                            }
                        }

                        //DataBase
                        Fields = typeof(NesCartDatabase).GetFields(BindingFlags.Public
                                                                   | BindingFlags.Static);
                        for (int i = 0; i < Fields.Length; i++)
                        {
                            if (Fields[i].FieldType == typeof(System.String))
                            {
                                try
                                {
                                    gameInfoList.AppendValues(iter, Fields[i].Name.Replace("_", " "), Fields[i].GetValue
                                                                  (info).ToString());
                                    gameInfoLines.Add(Fields[i].Name.Replace("_", " ") + " : " + Fields[i].GetValue
                                                          (info).ToString());
                                }
                                catch
                                {
                                }
                            }
                        }
                    }
                    #endregion

                    iter = gameInfoList.AppendValues("File Info");
                    gameInfoLines.Add("[File Info]");
                    string crc = "";
                    gameInfoList.AppendValues(iter, "CRC32", crc = CalculateCRC(filechooserwidget2.Filename, 16).ToString());
                    gameInfoLines.Add("CRC32 : " + crc);
                    gameInfoLines.Add("");
                    iter = gameInfoList.AppendValues("INES Header");
                    gameInfoLines.Add("[INES Header]");
                    gameInfoList.AppendValues(iter, "SHA1", header.SHA1);
                    gameInfoLines.Add("SHA1 : " + header.SHA1);
                    gameInfoList.AppendValues(iter, "Mapper #", header.MapperNumber.ToString());
                    gameInfoLines.Add("Mapper # : " + header.MapperNumber.ToString());
                    gameInfoList.AppendValues(iter, "Mirroring", header.Mirroring.ToString());
                    gameInfoLines.Add("Mirroring : " + header.Mirroring.ToString());
                    gameInfoList.AppendValues(iter, "Has Battery", header.HasBattery.ToString());
                    gameInfoLines.Add("Has Battery : " + header.HasBattery.ToString());
                    gameInfoList.AppendValues(iter, "Has Trainer", header.HasTrainer.ToString());
                    gameInfoLines.Add("Has Trainer : " + header.HasTrainer.ToString());
                    gameInfoList.AppendValues(iter, "Is Playchoice10", header.IsPlaychoice10.ToString());
                    gameInfoLines.Add("Is Playchoice10 : " + header.IsPlaychoice10.ToString());
                    gameInfoList.AppendValues(iter, "Is VS Unisystem", header.IsVSUnisystem.ToString());
                    gameInfoLines.Add("Is VS Unisystem : " + header.IsVSUnisystem.ToString());
                    gameInfoList.AppendValues(iter, "PRG Count", header.PRGCount.ToString());
                    gameInfoLines.Add("PRG Count : " + header.PRGCount.ToString());
                    gameInfoList.AppendValues(iter, "PRG Size", GetSize(header.PRGCount * 0x4000));
                    gameInfoLines.Add("PRG Size : " + GetSize(header.PRGCount * 0x4000));
                    gameInfoList.AppendValues(iter, "CHR Count", header.CHRCount.ToString());
                    gameInfoLines.Add("CHR Count : " + header.CHRCount.ToString());
                    gameInfoList.AppendValues(iter, "CHR Size", GetSize(header.CHRCount * 0x2000));
                    gameInfoLines.Add("CHR Size : " + GetSize(header.CHRCount * 0x2000));
                    gameInfoLines.Add("");
                }
                else
                {
                    iter = gameInfoList.AppendValues("File Info");
                    gameInfoLines.Add("[File Info]");
                    string crc = "";
                    gameInfoList.AppendValues(iter, "CRC32", crc = CalculateCRC(filechooserwidget2.Filename, 0).ToString());
                    gameInfoLines.Add("CRC32 : " + crc);
                    gameInfoLines.Add("");
                }
            }
            else
            {
                Gtk.TreeIter iter = gameInfoList.AppendValues("File Info");
                gameInfoLines.Add("[File Info]");
                string crc = "";
                gameInfoList.AppendValues(iter, "CRC32", crc = CalculateCRC(filechooserwidget2.Filename, 0).ToString());
                gameInfoLines.Add("CRC32 : " + crc);
                gameInfoLines.Add("");
            }
            treeview2.ExpandAll();
        }
        catch
        {
        }
    }
Beispiel #22
0
        public AddinView()
        {
            var hbox = new HBox () { Spacing = 6 };

            var filter_label = new Label (Catalog.GetString ("Show:"));
            var filter_combo = new ComboBoxText ();
            filter_combo.AppendText (Catalog.GetString ("All"));
            filter_combo.AppendText (Catalog.GetString ("Enabled"));
            filter_combo.AppendText (Catalog.GetString ("Not Enabled"));
            filter_combo.Active = 0;

            var search_label = new Label (Catalog.GetString ("Search:"));
            var search_entry = new Banshee.Widgets.SearchEntry () {
                WidthRequest = 160,
                Visible = true,
                Ready = true
            };

            hbox.PackStart (filter_label, false, false, 0);
            hbox.PackStart (filter_combo, false, false, 0);
            hbox.PackEnd   (search_entry, false, false, 0);
            hbox.PackEnd   (search_label, false, false, 0);

            var model = new TreeStore (typeof(bool), typeof(bool), typeof (string), typeof (Addin));

            var addins = AddinManager.Registry.GetAddins ().Where (a => { return
                a.Name != a.Id && a.Description != null &&
                !String.IsNullOrEmpty (a.Description.Category) && !a.Description.Category.StartsWith ("required:") &&
                (!a.Description.Category.Contains ("Debug") || ApplicationContext.Debugging);
            });

            var categorized_addins = addins.GroupBy<Addin, string> (a => a.Description.Category)
                                           .Select (c => new {
                                                Addins = c.OrderBy (a => Catalog.GetString (a.Name)).ToList (),
                                                Name = c.Key,
                                                NameLocalized = Catalog.GetString (c.Key) })
                                           .OrderBy (c => c.NameLocalized)
                                           .ToList ();

            tree_view = new TreeView () {
                FixedHeightMode = false,
                HeadersVisible = false,
                SearchColumn = 1,
                RulesHint = true,
                Model = model
            };

            var update_model = new System.Action (() => {
                string search = search_entry.Query;
                bool? enabled = filter_combo.Active > 0 ? (bool?) (filter_combo.Active == 1 ? true : false) : null;
                model.Clear ();
                foreach (var cat in categorized_addins) {
                    var cat_iter = model.AppendValues (false, false, String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (cat.NameLocalized)), null);
                    bool any = false;
                    foreach (var a in cat.Addins.Matching (search)) {
                        if (enabled == null || (a.Enabled == enabled.Value)) {
                            model.AppendValues (cat_iter, true,
                                a.Enabled,
                                String.Format (
                                    "<b>{0}</b>\n<small>{1}</small>",
                                    GLib.Markup.EscapeText (Catalog.GetString (a.Name)),
                                    GLib.Markup.EscapeText (Catalog.GetString (a.Description.Description))),
                                a
                            );
                            any = true;
                        }
                    }

                    if (!any) {
                        model.Remove (ref cat_iter);
                    }
                }
                tree_view.ExpandAll ();
            });

            var txt_cell = new CellRendererText () { WrapMode = Pango.WrapMode.Word };
            tree_view.AppendColumn ("Name", txt_cell , "markup", Columns.Name);

            var check_cell = new CellRendererToggle () { Activatable = true };
            tree_view.AppendColumn ("Enable", check_cell, "visible", Columns.IsAddin, "active", Columns.IsEnabled);
            check_cell.Toggled += (o, a) => {
                TreeIter iter;
                if (model.GetIter (out iter, new TreePath (a.Path))) {
                    var addin = model.GetValue (iter, 3) as Addin;
                    bool enabled = (bool) model.GetValue (iter, 1);
                    addin.Enabled = !enabled;
                    model.SetValue (iter, 1, addin.Enabled);
                    model.Foreach (delegate (ITreeModel current_model, TreePath path, TreeIter current_iter) {
                        var an = current_model.GetValue (current_iter, 3) as Addin;
                        if (an != null) {
                            current_model.SetValue (current_iter, 1, an.Enabled);
                        }
                        return false;
                    });
                }
            };

            update_model ();
            search_entry.Changed += (o, a) => update_model ();
            filter_combo.Changed += (o, a) => update_model ();

            var tree_scroll = new Hyena.Widgets.ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Never
            };
            tree_scroll.AddWithFrame (tree_view);

            Spacing = 6;
            PackStart (hbox, false, false, 0);
            PackStart (tree_scroll, true, true, 0);
            ShowAll ();
            search_entry.GrabFocus ();

            txt_cell.WrapWidth = 300;
        }
    public void StartCompare(WaitCallback done)
    {
        AdditionalInfoWindow.Visible = false;

        progressbar1.Visible          = true;
        progressbar1.Adjustment.Lower = 0;
        progressbar1.Adjustment.Upper = 100;

        // clear our existing content
        if (context != null)
        {
            context.StopCompare();
        }

        // Go to the actual tree page.
        notebook1.Page = 0;

        // now generate new content asynchronously
        context = new CompareContext(reference_loader, target_loader);

        context.ProgressChanged += delegate(object sender, CompareProgressChangedEventArgs e) {
            Application.Invoke(delegate {
                Status   = e.Message;
                Progress = e.Progress;
            });
        };

        context.Error += delegate(object sender, CompareErrorEventArgs e) {
            Application.Invoke(delegate {
                Console.WriteLine("ERROR: {0}", e.Message);
                MessageDialog md = new MessageDialog(this, 0, MessageType.Error, ButtonsType.Ok, false,
                                                     e.Message);
                md.Response += delegate(object s, ResponseArgs ra) {
                    md.Hide();
                };
                md.Show();
                Status               = String.Format("Comparison failed at {0}", DateTime.Now);
                Progress             = 0.0;
                progressbar1.Visible = false;
            });
        };

        context.Finished += delegate(object sender, EventArgs e) {
            Application.Invoke(delegate {
                DateTime finish_time = DateTime.Now;

                if (context.Comparison != null)
                {
                    Status = String.Format("Comparison completed at {0}", finish_time);

                    context.Comparison.PropagateCounts();
                    PopulateTreeFromComparison(context.Comparison);
                    Progress = 0.0;

                    CompareHistory[] history = Config.Recent[0].History;

                    if (history == null || history.Length == 0 ||
                        (history[history.Length - 1].Extras != context.Comparison.Extra ||
                         history[history.Length - 1].Errors != context.Comparison.Warning ||
                         history[history.Length - 1].Missing != context.Comparison.Missing ||
                         history[history.Length - 1].Niexs != context.Comparison.Niex ||
                         history[history.Length - 1].Todos != context.Comparison.Todo))
                    {
                        CompareHistory history_entry = new CompareHistory();
                        history_entry.CompareTime    = finish_time;
                        history_entry.Extras         = context.Comparison.Extra;
                        history_entry.Errors         = context.Comparison.Warning;
                        history_entry.Missing        = context.Comparison.Missing;
                        history_entry.Niexs          = context.Comparison.Niex;
                        history_entry.Todos          = context.Comparison.Todo;
                        Config.Recent[0].AddHistoryEntry(history_entry);
                        Config.Save();
                    }
                }
                else
                {
                    Status = "Comparison not completed - no data returned.";
                }

                done(this);
                progressbar1.Visible = false;
            });
        };
        treeStore.Clear();
        context.Compare();
    }
Beispiel #24
0
 public void Clear()
 {
     addinData.Clear();
     selected.Clear();
     treeStore.Clear();
 }
Beispiel #25
0
 public void ClearContent()
 {
     model.Clear();
 }
Beispiel #26
0
 public void Clear()
 {
     entryFilter.Text = "";
     store.Clear();
 }
Beispiel #27
0
        public void SyncStateChanged(SyncState state)
        {
            // This event handler will be called by the synchronization thread
            // so we have to use the delegate here to manipulate the GUI.
            Gtk.Application.Invoke(delegate {
                // FIXME: Change these strings to be user-friendly
                switch (state)
                {
                case SyncState.AcquiringLock:
                    ProgressText = Catalog.GetString("Acquiring sync lock...");
                    break;

                case SyncState.CommittingChanges:
                    ProgressText = Catalog.GetString("Committing changes...");
                    break;

                case SyncState.Connecting:
                    Title       = Catalog.GetString("Synchronizing Notes");
                    HeaderText  = Catalog.GetString("Synchronizing your notes...");
                    MessageText = Catalog.GetString("This may take a while, kick back and enjoy!");
                    model.Clear();
                    ProgressText         = Catalog.GetString("Connecting to the server...");
                    progressBar.Fraction = 0;
                    progressBar.Show();
                    progressLabel.Show();
                    break;

                case SyncState.DeleteServerNotes:
                    ProgressText = Catalog.GetString("Deleting notes off of the server...");
                    progressBar.Pulse();
                    break;

                case SyncState.Downloading:
                    ProgressText = Catalog.GetString("Downloading new/updated notes...");
                    progressBar.Pulse();
                    break;

                case SyncState.Idle:
                    GLib.Source.Remove(progressBarTimeoutId);
                    progressBarTimeoutId = 0;
                    progressBar.Fraction = 0;
                    progressBar.Hide();
                    progressLabel.Hide();
                    closeButton.Sensitive = true;
                    break;

                case SyncState.Locked:
                    Title        = Catalog.GetString("Server Locked");
                    HeaderText   = Catalog.GetString("Server is locked");
                    MessageText  = Catalog.GetString("One of your other computers is currently synchronizing.  Please wait 2 minutes and try again.");
                    ProgressText = string.Empty;
                    break;

                case SyncState.PrepareDownload:
                    ProgressText = Catalog.GetString("Preparing to download updates from server...");
                    break;

                case SyncState.PrepareUpload:
                    ProgressText = Catalog.GetString("Preparing to upload updates to server...");
                    break;

                case SyncState.Uploading:
                    ProgressText = Catalog.GetString("Uploading notes to server...");
                    break;

                case SyncState.Failed:
                    Title        = Catalog.GetString("Synchronization Failed");
                    HeaderText   = Catalog.GetString("Failed to synchronize");
                    MessageText  = Catalog.GetString("Could not synchronize notes.  Check the details below and try again.");
                    ProgressText = string.Empty;
                    break;

                case SyncState.Succeeded:
                    int count              = 0;
                    count                 += model.IterNChildren();
                    Title                  = Catalog.GetString("Synchronization Complete");
                    HeaderText             = Catalog.GetString("Synchronization is complete");
                    string numNotesUpdated =
                        string.Format(Catalog.GetPluralString("{0} note updated.",
                                                              "{0} notes updated.",
                                                              count),
                                      count);
                    MessageText = numNotesUpdated + "  " +
                                  Catalog.GetString("Your notes are now up to date.");
                    ProgressText = string.Empty;
                    break;

                case SyncState.UserCancelled:
                    Title        = Catalog.GetString("Synchronization Canceled");
                    HeaderText   = Catalog.GetString("Synchronization was canceled");
                    MessageText  = Catalog.GetString("You canceled the synchronization.  You may close the window now.");
                    ProgressText = string.Empty;
                    break;

                case SyncState.NoConfiguredSyncService:
                    Title        = Catalog.GetString("Synchronization Not Configured");
                    HeaderText   = Catalog.GetString("Synchronization is not configured");
                    MessageText  = Catalog.GetString("Please configure synchronization in the preferences dialog.");
                    ProgressText = string.Empty;
                    break;

                case SyncState.SyncServerCreationFailed:
                    Title        = Catalog.GetString("Synchronization Service Error");
                    HeaderText   = Catalog.GetString("Service error");
                    MessageText  = Catalog.GetString("Error connecting to the synchronization service.  Please try again.");
                    ProgressText = string.Empty;
                    break;
                }
            });
        }