void AppendCategory (TreeIter it, CounterCategory cat)
		{
			TreeIter catIt;
			if (it.Equals (TreeIter.Zero))
				catIt = store.AppendValues (false, cat.Name, cat, null, false);
			else
				catIt = store.AppendValues (it, false, cat.Name, cat, null, false);
			
			foreach (Counter c in cat.Counters)
				store.AppendValues (catIt, false, c.Name, null, c, true);
		}
Ejemplo n.º 2
0
 protected void OnButtonCancelClicked(object sender, EventArgs e)
 {
     lock (listStore)
     {
         Gtk.TreeIter iter = FindJob(treeview1.Selection);
         if (!iter.Equals(TreeIter.Zero))
         {
             JobInfo job = listStore.GetValue(iter, COLUMN_JOB_INFORMATION) as JobInfo;
             job.Cancel();
         }
     }
 }
Ejemplo n.º 3
0
 void PopulatePeopleCategories(TreeStore treeStore ,Tag parent,TreeIter parentIter,int level)
 {
     foreach (Tag tag in (parent as Category).Children) {
         if (tag is Category) {
             //Log.Debug("Append  : "+tag.Name + " to "+parent.Name);
             TreeIter iter =
                 (parentIter.Equals(TreeIter.Zero) ?
                 treeStore.AppendValues(tag.Name,/*parent,*/tag):
                     treeStore.AppendValues(parentIter,tag.Name,/*parent,*/tag)) ;
             PopulatePeopleCategories (treeStore,tag,iter,level+1);
         }
     }
 }
Ejemplo n.º 4
0
 public bool IterNthChild(out Gtk.TreeIter iter, Gtk.TreeIter parent, int n)
 {
     if (parent.Equals(Gtk.TreeIter.Zero))
     {
         iter = IterFromNode(n);
         return(true);
     }
     else
     {
         iter = Gtk.TreeIter.Zero;
         return(false);
     }
 }
Ejemplo n.º 5
0
 void HandleCursorChanged(object sender, EventArgs e)
 {
     lock (listStore)
     {
         Gtk.TreeIter iter = FindJob(treeview1.Selection);
         if (!iter.Equals(TreeIter.Zero))
         {
             JobInfo job = (JobInfo)listStore.GetValue(iter, COLUMN_JOB_INFORMATION);
             buttonCancel.Sensitive = job.CancelationSupported;
         }
         else
         {
             buttonCancel.Sensitive = false;
         }
     }
 }
Ejemplo n.º 6
0
        public void GetSelectedFile(out string filename, out int fileTyp, out Gtk.TreeIter ti)
        {
            ti = GetSelectedIter();
            //if(ti.Equals(TreeIter.Zero)) return;
            //if (ti == TreeIter.Zero)

            //if (ti. != null) {
            if (!ti.Equals(TreeIter.Zero))
            {
                filename = store.GetValue(ti, PATH_ROW).ToString();
                fileTyp  = (Int32)store.GetValue(ti, TYPE_ROW);
            }
            else
            {
                filename = "";
                fileTyp  = -1;
            }
        }
        static void BuildTreeChildren(Gtk.TreeStore store, Gtk.TreeIter parent, XContainer p)
        {
            foreach (XNode n in p.Nodes)
            {
                Gtk.TreeIter childIter;
                if (!parent.Equals(Gtk.TreeIter.Zero))
                {
                    childIter = store.AppendValues(parent, n);
                }
                else
                {
                    childIter = store.AppendValues(n);
                }

                XContainer c = n as XContainer;
                if (c != null && c.FirstChild != null)
                {
                    BuildTreeChildren(store, childIter, c);
                }
            }
        }
Ejemplo n.º 8
0
        public void GetSelectedFileDirectory(out string filename, out int fileTyp, out Gtk.TreeIter ti)
        {
            GetSelectedFile(out filename, out fileTyp, out ti);
            if (fileTyp == (int)TypeFile.Directory)
            {
                return;
            }

            ti = GetSelectedParentTreeIter(false);

            //if (ti. != null) {
            if (!ti.Equals(TreeIter.Zero))
            {
                filename = store.GetValue(ti, PATH_ROW).ToString();
                fileTyp  = (Int32)store.GetValue(ti, TYPE_ROW);
            }
            else
            {
                filename = "";
                fileTyp  = -1;
            }
        }
Ejemplo n.º 9
0
        private void LoadImage(UserInfo userInfo, string path, Gdk.Pixbuf pixbuf)
        {
            // Lookup File Iter
            FolderViewer folderViewer = notebookViewer.LookupPage(userInfo);

            if (folderViewer == null)
            {
                return;
            }

            // Get File Tree Iter
            Gtk.TreeIter iter = folderViewer.Store.GetIter(path);
            if (iter.Equals(Gtk.TreeIter.Zero))
            {
                return;
            }

            // Build & Set Thumb Image
            Gtk.Application.Invoke(delegate {
                folderViewer.Store.SetPixbuf(iter, pixbuf);
                folderViewer.ShowAll();
            });
        }
Ejemplo n.º 10
0
        void AddToTree(Gtk.TreeStore treeStore, Gtk.TreeIter iter, PArray arr)
        {
            iterTable[arr] = iter;

            for (int i = 0; i < arr.Count; i++)
            {
                var item = arr[i];

                var txt     = string.Format(GettextCatalog.GetString("Item {0}"), i);
                var subIter = iter.Equals(TreeIter.Zero) ? treeStore.AppendValues(txt, item) : treeStore.AppendValues(iter, txt, item);

                if (item is PArray)
                {
                    AddToTree(treeStore, subIter, (PArray)item);
                }
                if (item is PDictionary)
                {
                    AddToTree(treeStore, subIter, (PDictionary)item);
                }
                if (expandedObjects.Contains(item))
                {
                    treeview1.ExpandRow(treeStore.GetPath(subIter), true);
                }
            }

            if (arr.Count == 0)
            {
                SetNoEntries(iter);
            }

            if (!rebuildArrays.Contains(arr))
            {
                rebuildArrays.Add(arr);
                arr.Changed += HandleArrRebuild;
            }
        }
Ejemplo n.º 11
0
		protected TreeIter AddSection (TreeIter parentIter, OptionsDialogSection section, object dataObject)
		{
			TreeIter it;
			if (parentIter.Equals (TreeIter.Zero)) {
				it = store.AppendValues (section);
			} else {
				it = store.AppendValues (parentIter,section);
			}
			
			if (!section.CustomNode)
				AddChildSections (it, section, dataObject);
			
			// Remove the section if it doesn't have children nor panels
			SectionPage page = CreatePage (it, section, dataObject);
			TreeIter cit;
			if (removeEmptySections && page.Panels.Count == 0 && !store.IterChildren (out cit, it)) {
				store.Remove (ref it);
				return TreeIter.Zero;
			}
			return it;
		}
Ejemplo n.º 12
0
		void AppendThreads (TreeIter it, ProcessInfo p)
		{
			ThreadInfo[] threads = p.GetThreads ();
			Array.Sort (threads, delegate (ThreadInfo t1, ThreadInfo t2) {
				return t1.Id.CompareTo (t2.Id);
			});
			foreach (ThreadInfo t in threads) {
				ThreadInfo activeThread = DebuggingService.DebuggerSession.ActiveThread;
				Pango.Weight wi = t == activeThread ? Pango.Weight.Bold : Pango.Weight.Normal;
				string icon = t == activeThread ? Gtk.Stock.GoForward : null;
				if (it.Equals (TreeIter.Zero))
					store.AppendValues (icon, t.Id.ToString (), t.Name, t, (int) wi, t.Location);
				else
					store.AppendValues (it, icon, t.Id.ToString (), t.Name, t, (int) wi, t.Location);
			}
		}
Ejemplo n.º 13
0
		TreeIter AddNode (TreeIter parent, FieldReference node)
		{
			if (parent.Equals (TreeIter.Zero))
				return store.AppendValues (node, "md-field", node.FiledName, true, "", "", node.RefCount.ToString ("n0"), "", "");
			else
				return store.AppendValues (parent, node, "md-field", node.FiledName, true, "", "", node.RefCount.ToString ("n0"), "", "");
		}
Ejemplo n.º 14
0
		TreeIter AddNode (TreeIter parent, ReferenceNode node)
		{
			if (entryFilter.Text.Length > 0 && node.TypeName.IndexOf (entryFilter.Text) == -1)
				return TreeIter.Zero;
			
			TreeIter iter;
			if (parent.Equals (TreeIter.Zero)) {
				iter = store.AppendValues (node, "md-class", node.TypeName, !node.HasReferences, node.TotalMemory.ToString("n0"), node.AverageSize.ToString("n0"), node.RefCount.ToString ("n0"), "", "", "");
			} else {
				string refs = (InverseReferences ? node.RefsToParent.ToString ("n0") : "");
				string rootRefs = (InverseReferences ? node.RefsToRoot.ToString ("n0") : "");
				string rootMem = (InverseReferences ? node.RootMemory.ToString ("n0") : "");
				iter = store.AppendValues (parent, node, "md-class", node.TypeName, !node.HasReferences, node.TotalMemory.ToString("n0"), node.AverageSize.ToString("n0"), node.RefCount.ToString ("n0"), refs, rootRefs, rootMem);
			}

			if (node.HasReferences) {
				// Add a dummy element to make the expansion icon visible
				store.AppendValues (iter, null, "", "", true, "", "", "", "", "", "");
			}
			return iter;
		}
		void FillTree (TreeIter iter, SolutionFolderItem entry)
		{
			TreeIter curIter;
			if (!iter.Equals (TreeIter.Zero)) {
				curIter = store.AppendValues (iter, GetIcon (entry), entry is SolutionFolder ? false : IsIncluded (entry), entry.Name, entry, !(entry is SolutionFolder));
			} else {
				curIter = store.AppendValues (GetIcon (entry), entry is SolutionFolder ? false : IsIncluded (entry), entry.Name, entry, !(entry is SolutionFolder));
			}
			if (entry is SolutionFolder) {
				// Add solutions first, then projects
				foreach (SolutionFolderItem childEntry in ((SolutionFolder)entry).Items)
					if (childEntry is SolutionFolder)
						FillTree (curIter, childEntry);
				foreach (SolutionFolderItem childEntry in ((SolutionFolder)entry).Items)
					if (!(childEntry is TranslationProject) && (childEntry is Project))
						FillTree (curIter, childEntry);
			}
		}
Ejemplo n.º 16
0
        void AddEntry(TreeIter iter, IBuildTarget item)
        {
            if (!IsVisible (item))
                return;

            string icon;
            if (item is Solution)
                icon = MonoDevelop.Ide.Gui.Stock.Solution;
            else if (item is SolutionFolder)
                icon = MonoDevelop.Ide.Gui.Stock.SolutionFolderClosed;
            else if (item is WorkspaceItem)
                icon = MonoDevelop.Ide.Gui.Stock.Workspace;
            else if (item is Project)
                icon = ((Project)item).StockIcon;
            else
                icon = MonoDevelop.Ide.Gui.Stock.Project;

            bool checkVisible = IsCheckboxVisible (item);
            bool selected = activeItems.Contains (item);

            if (!iter.Equals (TreeIter.Zero))
                iter = store.AppendValues (iter, icon, item.Name, item, selected && checkVisible, checkVisible);
            else
                iter = store.AppendValues (icon, item.Name, item, selected && checkVisible, checkVisible);

            if (selected)
                tree.ExpandToPath (store.GetPath (iter));

            foreach (IBuildTarget ce in GetChildren (item))
                AddEntry (iter, ce);
        }
Ejemplo n.º 17
0
 TreeIter AddPropertyTextBox(TreeIter iter, string id, string name, string text, bool editable)
 {
     return !iter.Equals(nulliter) ? 
         listStore.AppendValues(iter, "", false, name, true, text, true, editable, null, "", false, false, id, "", false, "", "", false, "", false): 
         listStore.AppendValues("", false, name, true, text, true, editable, null, "", false, false, id, "", false, "", "", false, "", false);
 }
Ejemplo n.º 18
0
 TreeIter AddPropertyColorBox(TreeIter iter, string id, string name, string color)
 {
     return !iter.Equals(nulliter) ? 
         listStore.AppendValues(iter, "", false, name, true, "", false, false, null, "", false, false, id, "", false, "", color, true, "", false): 
         listStore.AppendValues("", false, name, true, "", false, false, null, "", false, false, id, "", false, "", color, true, "", false);
 }
        public void AddSource (Source source, TreeIter parent)
        {
            lock (sync) {
                if (Filter != null && !Filter (source)) {
                    return;
                }

                // Don't add duplicates
                if (!FindSource (source).Equals (TreeIter.Zero)) {
                    return;
                }

                // Don't add a child source before its parent
                if (parent.Equals (TreeIter.Zero) && source.Parent != null) {
                    return;
                }

                int position = source.Order;

                TreeIter iter = parent.Equals (TreeIter.Zero)
                    ? InsertNode (position)
                    : InsertNode (parent, position);

                SetValue (iter, 0, source);
                SetValue (iter, 1, source.Order);
                SetValue (iter, 2, source is SourceManager.GroupSource);

                lock (source.Children) {
                    foreach (Source child in source.Children) {
                        AddSource (child, iter);
                    }
                }

                source.ChildSourceAdded += OnSourceChildSourceAdded;
                source.ChildSourceRemoved += OnSourceChildSourceRemoved;

                OnSourceRowInserted (source, iter, parent);
            }
        }
Ejemplo n.º 20
0
        ChildInfo FillDirRec(Gtk.TreeIter iter, IWorkspaceFileObject item, HashSet <string> itemFiles, HashSet <string> knownPaths, FilePath dir, bool forceSet)
        {
            ChildInfo cinfo       = ChildInfo.AllSelected;
            bool      hasChildren = false;

            foreach (string sd in knownSubdirs)
            {
                if (dir == item.BaseDirectory.Combine(sd))
                {
                    forceSet = true;
                    break;
                }
            }

            TreeIter dit;

            if (!iter.Equals(TreeIter.Zero))
            {
                dit = store.AppendValues(iter, false, DesktopService.GetPixbufForFile(dir, IconSize.Menu), dir.FileName.ToString(), dir.ToString());
                fileList.ExpandRow(store.GetPath(iter), false);
            }
            else
            {
                dit = store.AppendValues(false, DesktopService.GetPixbufForFile(dir, IconSize.Menu), dir.FileName.ToString(), dir.ToString());
            }

            paths [dir] = dit;

            foreach (string file in Directory.GetFiles(dir))
            {
                string     path   = System.IO.Path.GetFileName(file);
                Gdk.Pixbuf pix    = DesktopService.GetPixbufForFile(file, IconSize.Menu);
                bool       active = itemFiles.Contains(file);
                string     color  = null;
                if (!active)
                {
                    pix   = ImageService.MakeTransparent(pix, 0.5);
                    color = "dimgrey";
                }
                else
                {
                    cinfo |= ChildInfo.HasProjectFiles;
                }

                active = active || forceSet || knownPaths.Contains(file);
                if (!active)
                {
                    cinfo &= ~ChildInfo.AllSelected;
                }
                else
                {
                    cinfo |= ChildInfo.SomeSelected;
                }

                paths [file] = store.AppendValues(dit, active, pix, path, file, color);
                if (!hasChildren)
                {
                    hasChildren = true;
                    fileList.ExpandRow(store.GetPath(dit), false);
                }
            }
            foreach (string cdir in Directory.GetDirectories(dir))
            {
                hasChildren = true;
                ChildInfo ci = FillDirRec(dit, item, itemFiles, knownPaths, cdir, forceSet);
                if ((ci & ChildInfo.AllSelected) == 0)
                {
                    cinfo &= ~ChildInfo.AllSelected;
                }
                cinfo |= ci & (ChildInfo.SomeSelected | ChildInfo.HasProjectFiles);
            }
            if ((cinfo & ChildInfo.AllSelected) != 0 && hasChildren)
            {
                store.SetValue(dit, 0, true);
            }
            if ((cinfo & ChildInfo.HasProjectFiles) == 0)
            {
                Gdk.Pixbuf pix = DesktopService.GetPixbufForFile(dir, IconSize.Menu);
                pix = ImageService.MakeTransparent(pix, 0.5);
                store.SetValue(dit, 1, pix);
                store.SetValue(dit, 4, "dimgrey");
            }
            if ((cinfo & ChildInfo.SomeSelected) != 0 && (cinfo & ChildInfo.AllSelected) == 0)
            {
                fileList.ExpandRow(store.GetPath(dit), false);
            }
            else
            {
                fileList.CollapseRow(store.GetPath(dit));
            }
            return(cinfo);
        }
Ejemplo n.º 21
0
        public NewProjectWizzard_New(Window parent)
        {
            if (parent != null)
                this.TransientFor =parent;
            else
                this.TransientFor = MainClass.MainWindow;

            this.Build();

            atrApplication = new FileTemplate.Attribute();
            atrApplication.Name = "application";
            atrApplication.Type = "text";

            this.DefaultHeight = 390 ;
            this.Title = MainClass.Languages.Translate("moscrif_ide_title_f1");
            ntbWizzard.ShowTabs = false;

            Pango.FontDescription customFont = lblNewProject.Style.FontDescription.Copy();//  Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            customFont.Size = customFont.Size+(int)(customFont.Size/2);
            customFont.Weight = Pango.Weight.Bold;
            lblNewProject.ModifyFont(customFont);

            storeTyp = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof (string),typeof(ProjectTemplate),typeof (bool));
            storeOrientation = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof (string));

            storeOutput = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf));

            nvOutput.Model = storeOutput;
            nvOutput.AppendColumn ("", new Gtk.CellRendererText (), "text", 0);
            nvOutput.AppendColumn ("", new Gtk.CellRendererText (), "text", 1);
            nvOutput.AppendColumn ("", new Gtk.CellRendererPixbuf (), "pixbuf", 2);
            nvOutput.Columns[1].Expand = true;

            ivSelectTyp.Model = storeTyp;
            ivSelectTyp.SelectionMode = SelectionMode.Single;
            ivSelectTyp.Orientation = Orientation.Horizontal;

            CellRendererText rendererSelectTyp = new CellRendererText();
            rendererSelectTyp.Ypad =0;
            ivSelectTyp.PackEnd(rendererSelectTyp,false);
            ivSelectTyp.SetCellDataFunc(rendererSelectTyp, new Gtk.CellLayoutDataFunc(RenderTypProject));
            ivSelectTyp.PixbufColumn = COL_PIXBUF;
            ivSelectTyp.TooltipColumn = COL_DISPLAY_TEXT;
            ivSelectTyp.AddAttribute(rendererSelectTyp, "sensitive", 5);

            Gdk.Pixbuf icon0 = MainClass.Tools.GetIconFromStock("project.png",IconSize.LargeToolbar);
            storeTyp.AppendValues ("New Empty Project", "Create empty application", icon0, "", null,true);

            DirectoryInfo[] diTemplates = GetDirectory(MainClass.Paths.FileTemplateDir);
            foreach (DirectoryInfo di in diTemplates) {

                string name = di.Name;

                string iconFile = System.IO.Path.Combine(di.FullName,"icon.png");
                string descFile = System.IO.Path.Combine(di.FullName,"description.xml");
                if(!File.Exists(iconFile) || !File.Exists(descFile))
                    continue;

                string descr = name;
                ProjectTemplate pt = null;

                if(File.Exists(descFile)){
                    pt = ProjectTemplate.OpenProjectTemplate(descFile);
                    if((pt!= null))
                        descr = pt.Description;
                }
                Gdk.Pixbuf icon = new Gdk.Pixbuf(iconFile);
                DirectoryInfo[] templates = di.GetDirectories();
                bool sensitive = true;

                if(templates.Length<1)
                    sensitive = false;
                else
                    sensitive = true;

                storeTyp.AppendValues (name, descr, icon, di.FullName,pt,sensitive);
            }

            ivSelectTyp.SelectionChanged+= delegate(object sender, EventArgs e)
            {
                Gtk.TreePath[] selRow = ivSelectTyp.SelectedItems;
                if(selRow.Length<1){
                    lblHint.Text = " ";
                    btnNext.Sensitive = false;
                    return;
                }

                Gtk.TreePath tp = selRow[0];
                TreeIter ti = new TreeIter();
                storeTyp.GetIter(out ti,tp);

                if(tp.Equals(TreeIter.Zero))return;

                //string typ = storeTyp.GetValue (ti, 3).ToString();
                string text1 = (string) storeTyp.GetValue (ti, 0);
                string text2 = (string) storeTyp.GetValue (ti, 1);
                bool sensitive = Convert.ToBoolean(storeTyp.GetValue (ti, 5));
                if(!sensitive){
                    ivSelectTyp.SelectPath(selectedTypPrj);
                    return;
                }
                selectedTypPrj = selRow[0];

                lblHint.Text = text1+" - "+text2;
                btnNext.Sensitive = true;
            };
            CellRendererText rendererOrientation = new CellRendererText();

            selectedTypPrj = new TreePath("0");
            ivSelectTyp.SelectPath(selectedTypPrj);

            ivSelectOrientation.Model = storeOrientation;
            ivSelectOrientation.SelectionMode = SelectionMode.Single;
            ivSelectOrientation.Orientation = Orientation.Horizontal;

            ivSelectOrientation.PackEnd(rendererOrientation,false);
            ivSelectOrientation.SetCellDataFunc(rendererOrientation, new Gtk.CellLayoutDataFunc(RenderOrientationProject));
            ivSelectOrientation.PixbufColumn = COL_PIXBUF;
            ivSelectOrientation.TooltipColumn = COL_DISPLAY_TEXT;

            foreach(SettingValue ds in MainClass.Settings.DisplayOrientations){
                storeOrientation.AppendValues (ds.Display,ds.Display,null,ds.Value);
            }
            ivSelectOrientation.SelectPath(new TreePath("0"));
            storeWorkspace = new ListStore(typeof(string), typeof(string), typeof(int));
            cbeWorkspace = new ComboBoxEntry();
            cbeWorkspace.Model = storeWorkspace;
            cbeWorkspace.TextColumn = 0;
            cbeWorkspace.Changed+= OnCbeWorkspaceChanged;

            this.feLocation = new FileEntry();
            this.table3.Attach (this.feLocation,1,2,2,3);
            Gtk.Table.TableChild w9 = ((Gtk.Table.TableChild)(this.table3 [this.feLocation]));
            w9.XOptions = ((Gtk.AttachOptions)(4));
            w9.YOptions = ((Gtk.AttachOptions)(4));

            table3.Attach(cbeWorkspace,1,2,1,2,AttachOptions.Fill|AttachOptions.Expand,AttachOptions.Fill,0,0);

            CellRendererText rendererWorkspace = new CellRendererText();
            cbeWorkspace.PackStart(rendererWorkspace, true);
            cbeWorkspace.SetCellDataFunc(rendererWorkspace, new Gtk.CellLayoutDataFunc(RenderWorkspacePath));
            cbeWorkspace.WidthRequest = 125;

            cbeWorkspace.SetCellDataFunc(cbeWorkspace.Cells[0], new Gtk.CellLayoutDataFunc(RenderWorkspaceName));

            string currentWorkspace ="";
            if((MainClass.Workspace!= null) && !string.IsNullOrEmpty(MainClass.Workspace.FilePath))
            {
                string name = System.IO.Path.GetFileNameWithoutExtension(MainClass.Workspace.FilePath);
                storeWorkspace.AppendValues (name,MainClass.Workspace.FilePath,1);
                currentWorkspace = MainClass.Workspace.FilePath;
            }
            IList<RecentFile> lRecentProjects = MainClass.Settings.RecentFiles.GetWorkspace();

            foreach(RecentFile rf in lRecentProjects){

                if(rf.FileName == currentWorkspace) continue;
                if(File.Exists(rf.FileName)){
                    string name = System.IO.Path.GetFileNameWithoutExtension(rf.FileName);
                    storeWorkspace.AppendValues(name,rf.FileName,0);
                }
            }
                //storeWorkspace.AppendValues("","-------------",-1);

            worksDefaultName = "Workspace"+MainClass.Settings.WorkspaceCount.ToString();
            TreeIter tiNewW = storeWorkspace.AppendValues(worksDefaultName,MainClass.Paths.WorkDir,2);

            if(!String.IsNullOrEmpty(currentWorkspace)){
                cbeWorkspace.Active =0;
            }
            else {
                feLocation.DefaultPath = MainClass.Paths.WorkDir;
                cbeWorkspace.SetActiveIter(tiNewW);
                //storeWorkspace.AppendValues(worksDefaultName,MainClass.Paths.WorkDir,2);

            }
            prjDefaultName = "Project"+MainClass.Settings.ProjectCount.ToString();
            entrProjectName.Text = prjDefaultName;
            cbeWorkspace.ShowAll();
            feLocation.ShowAll();

            CellRendererText rendererTemplate = new CellRendererText();
            cbTemplate.PackStart(rendererTemplate, true);

            storeTemplate = new ListStore(typeof(string), typeof(string), typeof(string));
            cbTemplate.Model = storeTemplate;

            cbTemplate.Changed+= delegate(object sender, EventArgs e) {

                if(cbTemplate.Active <0) return;

                if(cbTemplate.ActiveText != KEY_CUSTOM){

                    tblLibraries.Sensitive = false;
                    tblScreens.Sensitive = false;
                    ivSelectOrientation.Sensitive = false;
                } else {
                    ivSelectOrientation.Sensitive = true;
                    tblLibraries.Sensitive = true;
                    tblScreens.Sensitive = true;
                }

                TreeIter tiChb = new TreeIter();
                cbTemplate.GetActiveIter(out tiChb);

                if(tiChb.Equals(TreeIter.Zero))return;

                string appPath = storeTemplate.GetValue(tiChb, 2).ToString();
                if(File.Exists(appPath)){
                    AppFile app = new AppFile(appPath);
                    List<string> libs = new List<string>(app.Libs);

                    Widget[] widgets = tblLibraries.Children;
                    foreach (Widget w in widgets ){
                        int indx = libs.FindIndex(x=>x==w.Name);
                        if(indx>-1) {
                            (w as CheckButton).Active = true;
                        } else {
                            (w as CheckButton).Active = false;
                        }
                    }
                }
            };
            btnBack.Sensitive = false;
        }
		void BuildTreeChildren (TreeStore store, TreeIter parent, ParsedDocument parsedDocument)
		{
			if (parsedDocument == null)
				return;
			
			foreach (var unresolvedCls in parsedDocument.TopLevelTypeDefinitions) {
				var cls = document.Compilation.MainAssembly.GetTypeDefinition (unresolvedCls.FullTypeName);
				if (cls == null)
					continue;
				TreeIter childIter;
				if (!parent.Equals (TreeIter.Zero))
					childIter = store.AppendValues (parent, cls);
				else
					childIter = store.AppendValues (cls);

				AddTreeClassContents (store, childIter, parsedDocument, cls, unresolvedCls);
			}
		}
		static void UpdateName (ListStore itemStore, TreeIter iter)
		{
			if (iter.Equals (TreeIter.Zero))
				return;

			object item = itemStore.GetValue (iter, 0);
			string name = item.ToString ();
			if (string.IsNullOrEmpty (name))
				name = Mono.Unix.Catalog.GetString ("(Empty)");;

			itemStore.SetValue(iter, 2, name);
		}
		static void BuildTreeChildren (TreeStore store, TreeIter parent, ParsedDocument parsedDocument)
		{
			if (parsedDocument.CompilationUnit == null)
				return;
			foreach (IType cls in parsedDocument.CompilationUnit.Types) {
				TreeIter childIter;
				if (!parent.Equals (TreeIter.Zero))
					childIter = store.AppendValues (parent, cls);
				else
					childIter = store.AppendValues (cls);

				AddTreeClassContents (store, childIter, parsedDocument, cls);
			}
		}
Ejemplo n.º 25
0
 TreeIter AddPropertyFilePathBox(TreeIter iter, string id, string name, string text)
 {
     return !iter.Equals(nulliter) ? 
         listStore.AppendValues(iter, "", false, name, true, "", false, false, null, "", false, false, id, "", false, "", "", false, text, true): 
         listStore.AppendValues("", false, name, true, "", false, false, null, "", false, false, id, "", false, "", "", false, text, true);
 }
Ejemplo n.º 26
0
 public TreeIter InsertRow(TreeIter parent, ArrayList row)
 {
     TreeIter iter;
     if (!parent.Equals(TreeIter.Zero))
         iter = store.AppendNode(parent);
     else
         iter = store.AppendNode();
     for (int i = 0; i < row.Count; i++)
     {
         store.SetValue (iter, i, row[i]);
         Console.WriteLine("Inserting oclumn=" + row[i].GetType().ToString());
     }
     return iter;
 }
Ejemplo n.º 27
0
		void TraverseSubtree (TreeIter iter, Action<TreeIter> action)
		{
			TreeIter newIter;
			if (!iter.Equals (TreeIter.Zero)) {
				if (!store.IterChildren (out newIter, iter))
					return;
			} else {
				if (!store.GetIterFirst (out newIter))
					return;
			}
			do {
				action (newIter);
				if (store.IterHasChild (newIter))
					TraverseSubtree (newIter, action);
			} while (store.IterNext (ref newIter));
		}
		void UpdateTextColumn (TreeIter iter, string value)
		{
			if (!iter.Equals (TreeIter.Zero)) {
				folderTreeStore.SetValue (iter, TextColumn, GLib.Markup.EscapeText (value));
			}
		}
Ejemplo n.º 29
0
 void AppendProperty(TreeIter piter, PropertyDescriptor prop, InstanceData idata)
 {
     TreeIter iter;
     if (piter.Equals (TreeIter.Zero))
         iter = store.AppendValues (prop.Label, prop, false, idata);
     else
         iter = store.AppendValues (piter, prop.Label, prop, false, idata);
     if (prop.HasDependencies)
         sensitives[prop] = prop;
     if (prop.HasVisibility)
         invisibles[prop] = prop;
     propertyRows [prop] = store.GetStringFromIter (iter);
 }
Ejemplo n.º 30
0
		static void BuildTreeChildren (TreeStore store, TreeIter parent, XContainer p)
		{
			foreach (XNode n in p.Nodes) {
				TreeIter childIter;
				if (!parent.Equals (TreeIter.Zero))
					childIter = store.AppendValues (parent, n);
				else
					childIter = store.AppendValues (n);
				
				var c = n as XContainer;
				if (c != null && c.FirstChild != null)
					BuildTreeChildren (store, childIter, c);
			}
		}
Ejemplo n.º 31
0
		void FillInnerExceptionsStore (TreeStore store, ExceptionInfo exception, TreeIter parentIter = default (TreeIter))
		{
			TreeIter iter;
			if (parentIter.Equals (TreeIter.Zero)) {
				iter = store.AppendValues (exception);
				ReverseInnerExceptions [exception] = null;
			} else {
				ReverseInnerExceptions [exception] = (ExceptionInfo)store.GetValue (parentIter, 0);
				iter = store.AppendValues (parentIter, exception);
			}
			var updateInnerExceptions = new System.Action (() => {
				if (!InnerExceptionsStore.IterHasChild (iter)) {
					var innerExceptions = exception.InnerExceptions;
					if (innerExceptions != null && innerExceptions.Count > 0) {
						foreach (var inner in innerExceptions) {
							FillInnerExceptionsStore (store, inner, iter);
						}
					} else {
						var inner = exception.InnerException;
						if (inner != null)
							FillInnerExceptionsStore (store, inner, iter);
					}
				}
			});
			exception.Changed += delegate {
				Application.Invoke (delegate {
					InnerExceptionsStore.EmitRowChanged (InnerExceptionsStore.GetPath (iter), iter);
					updateInnerExceptions ();
					InnerExceptionsTreeView.ExpandRow (InnerExceptionsStore.GetPath (iter), true);
				});
			};
			updateInnerExceptions ();
		}
		IEnumerable<TreeIter> GetAllNodes (TreeIter parent, bool iter_children)
		{
			TreeIter child;
			if (parent.Equals (TreeIter.Zero)) {
				if (!store.IterChildren (out child))
					yield break;
			} else if (!store.IterChildren (out child, parent)) {
				yield break;
			}

			do {
				yield return child;
				if (iter_children && store.IterHasChild (child)) {
					TreeIter iter;
					if (store.IterChildren (out iter, child)) {
						do {
							yield return iter;
						} while (store.IterNext (ref iter));
					}
				}
			} while (store.IterNext (ref child));
		}
Ejemplo n.º 33
0
		protected TreeIter AddSection (TreeIter parentIter, OptionsDialogSection section, object dataObject)
		{
			TreeIter it;
			if (parentIter.Equals (TreeIter.Zero)) {
				string sectionLabel = "<b>" + GLib.Markup.EscapeText (section.Label) + "</b>";
				it = store.AppendValues (section, null, sectionLabel, false, null);
			}
			else {
				string icon = section.Icon.IsNull ? "md-empty-category" : section.Icon.ToString ();
				it = store.AppendValues (parentIter, section, icon, section.Label, true, null);
			}
			
			if (!section.CustomNode)
				AddChildSections (it, section, dataObject);
			
			// Remove the section if it doesn't have children nor panels
			SectionPage page = CreatePage (it, section, dataObject);
			TreeIter cit;
			if (removeEmptySections && page.Panels.Count == 0 && !store.IterChildren (out cit, it)) {
				store.Remove (ref it);
				return TreeIter.Zero;
			}
			return it;
		}
Ejemplo n.º 34
0
 TreeIter AddPropertyCollectionBox(TreeIter iter, string id, string name, string data)
 {
     return !iter.Equals(nulliter) ? 
         listStore.AppendValues(iter, "", false, name, true, "", false, false, null, "", false, false, id, "Collection", true, data, "", false, "", false) : 
         listStore.AppendValues("", false, name, true, "", false, false, null, "", false, false, id, "Collection", true, data, "", false, "", false);
 }
        public TreeIter InsertRow(TreeIter parent, IDictionary row)
        {
            TreeIter myIter;
            // If parent is not the root of the tree
            if (!parent.Equals(TreeIter.Zero))
                myIter = store.AppendNode(parent);
            else
                myIter = store.AppendNode();

            ICollection keys = row.Keys;
            foreach (int key in keys)
                store.SetValue (myIter, key, row[key]);
            return myIter;
        }
Ejemplo n.º 36
0
        TreeIter AddPropertyComboBox(TreeIter iter, string id, string name, string[] values, string text)
        {
            var store = new TreeStore (typeof (string));

            foreach (string value in values)
                store.AppendValues(value);

            return !iter.Equals(nulliter) ? 
                listStore.AppendValues(iter, "", false, name, true, "", false, false, store, text, true, true, id, "", false, "", "", false, "", false): 
                listStore.AppendValues("", false, name, true, "", false, false, store, text, true, true, id, "", false, "", "", false, "", false);
        }
        public TreeIter InsertRow(TreeIter parent, string[] row)
        {
            TreeIter myIter;
            // If parent is not the root of the tree
            if (!parent.Equals(TreeIter.Zero))
                myIter = store.AppendNode(parent);
            else
                myIter = store.AppendNode();

            int i = 0;
            foreach (string val in row)
                store.SetValue (myIter, i++, val);

            return myIter;
        }
        public void ScrollToIter(TreeIter iter)
        {
            if (iter.Equals (TreeIter.Zero) ||
                    !model.IterIsValid (iter))
            {
                return;
            }

            TreePath path;

            path = model.GetPath (iter);

            if (path != null)
            {
                ScrollToCell (path, null, false, 0, 0);
            }
        }
        public TreeIter InsertRow(TreeIter parent, ArrayList row)
        {
            TreeIter myIter;
            // If parent is not the root of the tree
            if (!parent.Equals(TreeIter.Zero))
                myIter = store.AppendNode(parent);
            else
                myIter = store.AppendNode();

            for (int i = 0; i < row.Count; i++)
                store.SetValue (myIter, i, row[i]);

            return myIter;
        }