Ejemplo n.º 1
0
        protected virtual void OnEditButtonClicked(object sender, System.EventArgs e)
        {
            //userTreeview.Selection.GetSelected(out iter);

            Gtk.TreePath[] path_array = userTreeview.Selection.GetSelectedRows();

            if (path_array.Length == 1)
            {
                Gtk.TreeIter iter;
                store.GetIter(out iter, path_array[0]);
                //Console.WriteLine(store.GetValue(iter,0));
                LdapUser return_user = null;
                foreach (LdapUser user in user_list)
                {
                    if (user.uid == (string)store.GetValue(iter, 0))
                    {
                        return_user = user;
                        break;
                    }
                }

                llum.Core core = llum.Core.getCore();

                core.edit_user_wid = new EditUser(return_user);
                core.mw.setCurrentWidget(core.edit_user_wid);
            }
        }
Ejemplo n.º 2
0
        /**
         * Gets both iters from the provided ListStore obj based on the passed TreePath object(the selected row)
         */
        private bool getPrevIterFromSelection(out Gtk.TreeIter selectedIter, out Gtk.TreeIter prevIter,
                                              Gtk.TreePath selectedRow, Gtk.ListStore listModel)
        {
            listModel.GetIter(out selectedIter, selectedRow);
            selectedRow.Prev();
            listModel.GetIter(out prevIter, selectedRow);

            return(prevIter.Stamp != 0 && !prevIter.Equals(selectedIter));
        }
Ejemplo n.º 3
0
        /**
         * Gets both iters from the provided ListStore obj based on the passed TreePath object(the selected row)
         */

        private bool getNextIterFromSelection(out Gtk.TreeIter selectedIter, out Gtk.TreeIter nextIter,
                                              Gtk.TreePath selectedRow, Gtk.ListStore listModel)
        {
            listModel.GetIter(out selectedIter, selectedRow);
            selectedRow.Next();
            listModel.GetIter(out nextIter, selectedRow);

            return(nextIter.Stamp != 0 && !nextIter.Equals(selectedIter));
        }
 void UpdatePriorityButtons()
 {
     Gtk.TreePath[] paths = engineList.Selection.GetSelectedRows();
     if (paths.Length > 0)
     {
         Gtk.TreePath p = paths [0];
         Gtk.TreeIter it;
         engineStore.GetIter(out it, p);
         buttonDown.Sensitive = engineStore.IterNext(ref it);
         buttonUp.Sensitive   = p.Prev();
     }
     else
     {
         buttonDown.Sensitive = buttonUp.Sensitive = false;
     }
 }
 private void setCell(int column, string nt, Gtk.TreePath path)
 {
     Gtk.TreeIter iter;
     _store.GetIter(out iter, path);
     _store.SetValue(iter, column, nt);
     Hyena.Log.Information("Cuesheet editing - data=" + nt + ", path=" + path.Indices[0]);
 }
Ejemplo n.º 6
0
 void UpdateComboValue(string path, int col, string activeText)
 {
     Gtk.TreeIter iter;
     if (sourceListStore.GetIter(out iter, new Gtk.TreePath(path)))
     {
         sourceListStore.SetValue(iter, col, activeText);
     }
 }
Ejemplo n.º 7
0
        protected virtual void OnCellEdited(object sender, Gtk.EditedArgs args, int column)
        {
            Gtk.TreeIter iter;
            rtListStore.GetIter(out iter, new Gtk.TreePath(args.Path));

            rtListStore.SetValue(iter, column, args.NewText);

            UpdatePrefs();
        }
Ejemplo n.º 8
0
        private void OnNormalPackageToggled(object sender, Gtk.ToggledArgs args)
        {
            Gtk.TreeIter iter;
            bool         old = true;
            string       name;
            string       version;

            if (normalPackageListStore.GetIter(out iter, new Gtk.TreePath(args.Path)))
            {
                old = (bool)normalPackageListStore.GetValue(iter, 0);
                normalPackageListStore.SetValue(iter, 0, !old);
            }

            name    = (string)normalPackageListStore.GetValue(iter, 1);
            version = (string)normalPackageListStore.GetValue(iter, 2);

            if (old == false)
            {
                selectedPackagesListStore.AppendValues(name, version);
                selectedPackages.Add(new ProjectPackage(name));
            }
            else
            {
                Gtk.TreeIter search_iter;
                bool         has_elem = selectedPackagesListStore.GetIterFirst(out search_iter);

                if (has_elem)
                {
                    while (true)
                    {
                        string current = (string)selectedPackagesListStore.GetValue(search_iter, 0);

                        if (current.Equals(name))
                        {
                            selectedPackagesListStore.Remove(ref search_iter);
                            foreach (ProjectPackage p in selectedPackages)
                            {
                                if (p.Name == name)
                                {
                                    selectedPackages.Remove(p);
                                    break;
                                }
                            }

                            break;
                        }

                        if (!selectedPackagesListStore.IterNext(ref search_iter))
                        {
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 9
0
 void OnPolicySelectionChanged(object s, ComboSelectionChangedArgs args)
 {
     Gtk.TreeIter iter;
     if (store.GetIter(out iter, new Gtk.TreePath(args.Path)))
     {
         MimeTypePanelData mt = (MimeTypePanelData)store.GetValue(iter, 0);
         if (args.Active != -1)
         {
             string sel = args.ActiveText;
             if (sel == (panel.IsCustomUserPolicy ? systemPolicyText : parentPolicyText))
             {
                 mt.UseParentPolicy = true;
             }
             else if (sel != customPolicyText)
             {
                 PolicySet pset = PolicyService.GetPolicySet(sel);
                 mt.AssignPolicies(pset);
             }
         }
     }
 }
Ejemplo n.º 10
0
        /*
         * Returns the value of the removed element, or null- if no element removed
         */
        private String removeSelectedElementInTreeview(Gtk.TreeView target, Gtk.ListStore model)
        {
            Gtk.TreeIter   iter;
            Gtk.TreePath[] selectedRows = target.Selection.GetSelectedRows();

            if (selectedRows.Length > 0)
            {
                model.GetIter(out iter, selectedRows[0]);
                string value = (string)model.GetValue(iter, 0);

                if (model.Remove(ref iter))
                {
                    return(value);
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }