示例#1
0
    private void CreateButtonClicked(object obj, EventArgs args)
    {
        Note note = new Note("New", "");

        store.AddNode(new NoteTreeNode(note));
        clientActivated.CreateRecord(note);
    }
示例#2
0
        public FolderListGui(string Title, string Description, string[] Folders)
        {
            this.Build ();

            this.Folders = Folders;
            this.label12.Text = Description;
            this.Title = Title;

            NodeStore store = new NodeStore(typeof(StringNode));
            foreach(string folder in Folders)
                store.AddNode(new StringNode(){ Value = folder});
            nodeview1.NodeStore = store;
            nodeview1.AppendColumn("Folder", new Gtk.CellRendererText (), "text", 0);

            buttonOk.Clicked += delegate {
                // get the folders
                List<string> nodes = new List<string>();
                var enumerator = store.GetEnumerator();
                while(enumerator.MoveNext())
                {
                    string folder = ((StringNode)enumerator.Current).Value;
                    if(folder.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                        folder = folder.Substring(0, folder.Length - 1);
                    nodes.Add(folder);
                }
                this.Folders = nodes.ToArray();
                this.DialogResult = ResponseType.Ok;
                this.Destroy();
            };
            buttonCancel.Clicked += delegate{
                this.DialogResult = ResponseType.Cancel;
                this.Destroy();
            };

            btnAdd.Clicked += delegate {
                using(Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the Folder to scan.",
                          	                    						    this,
                                                                            FileChooserAction.SelectFolder,
                                                                            "Cancel", ResponseType.Cancel,
                                                     				 	    "Open", ResponseType.Accept)){
                    fc.LocalOnly = false;
                    if (fc.Run() == (int)ResponseType.Accept)
                    {
                        store.AddNode(new StringNode(){ Value = fc.Filename});
                    }
                    //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
                    fc.Destroy();
                }
            };

            btnRemove.Clicked += delegate {
                foreach(var node in nodeview1.NodeSelection.SelectedNodes)
                    store.RemoveNode(node);
            };
        }
示例#3
0
    protected void loadNotes()
    {
        store.Clear();
        notesStore = new FilesystemNotesStore(this.notesDirPath);

        ArrayList notes = notesStore.getAllNotes();

        for (int i = 0; i < notes.Count; i++)
        {
            Note noteEntry = notes[i] as Note;

            store.AddNode(new NoteNode(noteEntry));
        }
    }
示例#4
0
        private void AgentKeyListChangeHandler(object sender, Agent.KeyListChangeEventArgs e)
        {
//      if (IsDisposed) {
//        return;
//      }
            switch (e.Action)
            {
            case Agent.KeyListChangeEventAction.Add:
                Gtk.Application.Invoke(delegate(object sender1, EventArgs e1)
                {
                    mKeyCollection.AddNode(new KeyNode(e.Key));
                    UpdateVisibility();
                });
                break;

            case Agent.KeyListChangeEventAction.Remove:
                Gtk.Application.Invoke(delegate(object sender1, EventArgs e1)
                {
                    var matchFingerprint = e.Key.GetMD5Fingerprint().ToHexString();

                    var matches = mKeyCollection.Cast <KeyNode>()
                                  .Where(k => k.Fingerprint == matchFingerprint);
                    foreach (var keyNode in matches)
                    {
                        mKeyCollection.RemoveNode(keyNode);
                    }
                    UpdateVisibility();
                });
                break;
            }
        }
示例#5
0
 private void ReloadKeyListView()
 {
     mKeyCollection = new Gtk.NodeStore(typeof(KeyNode));
     try {
         foreach (var key in mAgent.GetAllKeys())
         {
             mKeyCollection.AddNode(new KeyNode(key));
         }
         mKeyNodeView.NodeStore = mKeyCollection;
         //mKeyNodeView.ShowAll ();
         //mKeyNodeView.ColumnsAutosize ();
         // TODO show different error messages for specific exceptions
         // should also do something besides MessageBox so that this control
         // can be integrated into other applications
     } catch (Exception) {
         // TODO - fix strings
         var messageDialog =
             new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal,
                                   Gtk.MessageType.Error, Gtk.ButtonsType.Close,
                                   "failed" /*Strings.errListKeysFailed*/);
         messageDialog.Run();
         messageDialog.Destroy();
     }
     UpdateVisibility();
     UpdateButtonStates();
 }
示例#6
0
        private void SetInputInfo(bool isEditable)
        {
            if (m_metadata.IOSpec.Input.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore inputStore = new Gtk.NodeStore(typeof(IOItemNode));

                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                //inputs
                this.inputView.AppendColumn("Input", textRenderer, "text", 0);
                this.inputView.AppendColumn(CreateInputMappingColumnWithComboBox(inputStore, "Mapped to"));
                this.inputView.AppendColumn("Type", textRenderer, "text", 2);

                //prepare input and output store
                foreach (IOItem item in m_metadata.IOSpec.Input.Values)
                {
                    inputStore.AddNode(new IOItemNode(item));
                }

                inputView.NodeStore = inputStore;

                //disables/enables the controls
                inputView.Sensitive = isEditable;

                inputView.HoverSelection         = true;
                inputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                inputView.Visible = false;
            }
        }
示例#7
0
    protected void OnToolbarAdd(object sender, EventArgs e)
    {
        Gtk.FileChooserDialog fileChooserDialog = new Gtk.FileChooserDialog("Choose files to open",
                                                                            this,
                                                                            FileChooserAction.Open,
                                                                            "Cancel", ResponseType.Cancel,
                                                                            "Open", ResponseType.Accept);
        fileChooserDialog.SelectMultiple = true;


        if (fileChooserDialog.Run() == (int)ResponseType.Accept)
        {
            //table1.NRows = (uint) fileChooserDialog.Filenames.Length + 1;
            uint i = 1;
            foreach (string filename in fileChooserDialog.Filenames)
            {
                fileNames += "\"" + filename + "\"" + " ";                 // also fixes spaces
                string name = System.IO.Path.GetFileName(filename);
                //Gtk.Label label = new Label(name);
                //table1.Attach(label, 0, 1, i , i + 1);
                //label.Show();

                long size = new System.IO.FileInfo(filename).Length;

                store.AddNode(new UltimateArchiverZ.NodeView.TreeNode(name, size));
                //listOfFIlesNodeView.NodeStore.AddNode(new UltimateArchiverZ.NodeView.TreeNode("ime", 5));

                i++;
            }
        }

        fileChooserDialog.Destroy();
    }
 void BuildList()
 {
     foreach (var target in MeadowProject.DeploymentTargetsManager.GetTargetList())
     {
         var node = new MyTreeNode(target, icon);
         Store.AddNode(node);
     }
 }
示例#9
0
        public Gtk.NodeStore generateStore()
        {
            Gtk.NodeStore store = new Gtk.NodeStore(typeof(SimEntry));

            foreach (Simulator s in this.server.listSims()) {
                store.AddNode(new SimEntry(s));
            }
            return store;
        }
 private Gtk.NodeStore getStore(List <Stavka> lista)
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(StavkePrimkeTreeNode));
         foreach (Stavka s in lista)
         {
             store.AddNode(new StavkePrimkeTreeNode(s));
         }
     }
     return(store);
 }
示例#11
0
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(OtpremnicaTreeNode));
         List <Otpremnica> listaOtpremnica = Otpremnica.DohvatiOtpremnice();
         foreach (Otpremnica o in listaOtpremnica)
         {
             store.AddNode(new OtpremnicaTreeNode(o));
         }
     }
     return(store);
 }
示例#12
0
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(KategorijaTreeNode));
         List <Kategorija> listaKategorije = Kategorija.Dohvati();
         foreach (Kategorija k in listaKategorije)
         {
             store.AddNode(new KategorijaTreeNode(k));
         }
     }
     return(store);
 }
示例#13
0
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(DobavljacTreeNode));
         List <Dobavljac> listaDobavljaci = Dobavljac.DohvatiDobavljace();
         foreach (Dobavljac d in listaDobavljaci)
         {
             store.AddNode(new DobavljacTreeNode(d));
         }
     }
     return(store);
 }
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(PrijevoznikTreeNode));
         List <Prijevoznik> listaPrijevoznici = Prijevoznik.DohvatiPrijevoznike();
         foreach (Prijevoznik p in listaPrijevoznici)
         {
             store.AddNode(new PrijevoznikTreeNode(p));
         }
     }
     return(store);
 }
示例#15
0
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(PrimkaTreeNode));
         List <Primka> listaPrimki = Primka.DohvatiPrimke();
         foreach (Primka p in listaPrimki)
         {
             store.AddNode(new PrimkaTreeNode(p));
         }
     }
     return(store);
 }
示例#16
0
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(ZaposlenikTreeNode));
         List <Zaposlenik> listaZaposlenici = Zaposlenik.DohvatiZaposlenike();
         foreach (Zaposlenik z in listaZaposlenici)
         {
             store.AddNode(new ZaposlenikTreeNode(z));
         }
     }
     return(store);
 }
示例#17
0
 private Gtk.NodeStore getStore()
 {
     if (store == null)
     {
         store = new Gtk.NodeStore(typeof(ArtiklTreeNode));
         List <Artikl> listaArtikli = Artikl.DohvatiArtikle();
         foreach (Artikl a in listaArtikli)
         {
             store.AddNode(new ArtiklTreeNode(a));
         }
     }
     return(store);
 }
示例#18
0
        private void LoadLastCampaigns()
        {
            lblState.Text = "Loading...";

            Thread oThread = new Thread(new ThreadStart(delegate() {
                try{
                    nodeviewTable.Hide();

                    int[] ids = api.GetCampaigns();

                    Gtk.NodeStore store = new Gtk.NodeStore(typeof(CampaignTreeNode));
                    foreach (int i in ids)
                    {
                        store.AddNode(new CampaignTreeNode(i, getStatName(i)));
                    }

                    Gtk.NodeView view = new Gtk.NodeView(store);

                    nodeviewTable.NodeStore = view.NodeStore;

                    nodeviewTable.AppendColumn("Id", new Gtk.CellRendererText(), "text", 0);
                    nodeviewTable.AppendColumn("Name", new Gtk.CellRendererText(), "text", 1);

                    lblTableTitle.Text = "Last Campaigns";
                    nodeviewTable.NodeSelection.Changed += new System.EventHandler(OnNodeviewTableChange);

                    nodeviewTable.Show();
                }catch (Exception ex) {
                    MessageDialog msg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, ex.Message);
                    msg.Title         = "Error";

                    ResponseType response = (ResponseType)msg.Run();
                    if (response == ResponseType.Close || response == ResponseType.DeleteEvent)
                    {
                        msg.Destroy();
                    }
                }
                lblState.Text = "Ready";
            }));

            oThread.Start();
        }
示例#19
0
        private void SetIOInfo()
        {
            //set columns in input and output views
            Gtk.NodeStore inputStore  = new Gtk.NodeStore(typeof(IOItemNode));
            Gtk.NodeStore outputStore = new Gtk.NodeStore(typeof(IOItemNode));

            Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

            //inputs
            TreeViewColumn mappedToColumn = CreateInputMappingColumnWithComboBox(inputStore);

            this.inputView.AppendColumn("Input", textRenderer, "text", 0);
            this.inputView.AppendColumn(mappedToColumn);
            this.inputView.AppendColumn("Type", textRenderer, "text", 2);

            //outputs
            Gtk.CellRendererText editableTextRenderer = new CellRendererText();
            editableTextRenderer.Editable = true;
            editableTextRenderer.Edited  += delegate(object o, EditedArgs args) {
                IOItemNode n = (IOItemNode)outputStore.GetNode(new TreePath(args.Path));
                n.MappedTo = args.NewText;
            };

            this.outputView.AppendColumn("Output", textRenderer, "text", 0);
            this.outputView.AppendColumn("Output as", editableTextRenderer, "text", 1);
            this.outputView.AppendColumn("Type", textRenderer, "text", 2);

            //prepare input and output store
            foreach (IOItem item in m_metadata.IOSpec.Input.Values)
            {
                inputStore.AddNode(new IOItemNode(item));
            }

            foreach (IOItem item in m_metadata.IOSpec.Output.Values)
            {
                outputStore.AddNode(new IOItemNode(item));
            }

            inputView.NodeStore  = inputStore;
            outputView.NodeStore = outputStore;
        }
示例#20
0
        private void loadDisplay()
        {
            if (index != null)
            {
                if (pesStore != null)
                {
                    pesStore.Clear();
                }
                foreach (DataFile f in index.DataFiles)
                {
                    if (f.Status == FileStatus.InLibrary)
                    {
                        log.DebugFormat("Loading file {0}.", f.IconPath);
                        Gdk.Pixbuf icon = new Gdk.Pixbuf(f.IconPath);
                        int        w, h;
                        w = h = 255;
                        if (icon.Width < icon.Height)
                        {
                            w = (icon.Width * w) / icon.Height;
                        }
                        else
                        {
                            h = (icon.Height * h) / icon.Width;
                        }

                        icon = icon.ScaleSimple(w, h, InterpType.Bilinear);

                        log.DebugFormat("Loaded file {0}. Adding to node view.", f.FileName);
                        log.DebugFormat("Size of pixbuf {0}x{1}", icon.Width, icon.Height);
                        if (pesStore != null)
                        {
                            PesFile pf = new PesFile(icon, f.FileName + "\n" + "Test");
                            ResizeIcon += new ResizeIconDelegate(pf.ResizeIcon);
                            pesStore.AddNode(pf);
                        }
                    }
                }
                pesView.NodeStore = pesStore;
            }
        }
示例#21
0
        private void SetOutputInfo(bool isEditable)
        {
            if (m_metadata.IOSpec.Output.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore outputStore = new Gtk.NodeStore(typeof(IOItemNode));

                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                Gtk.CellRendererText editableTextRenderer = new CellRendererText();
                editableTextRenderer.Editable = isEditable;
                editableTextRenderer.Edited  += delegate(object o, EditedArgs args) {
                    IOItemNode n = (IOItemNode)outputStore.GetNode(new TreePath(args.Path));
                    n.MappedTo = args.NewText;
                    RefreshIOHighlightInExperiment(n.MappedTo);
                };

                this.outputView.AppendColumn("Output", textRenderer, "text", 0);
                this.outputView.AppendColumn("Output as", editableTextRenderer, "text", 1);
                this.outputView.AppendColumn("Type", textRenderer, "text", 2);

                foreach (IOItem item in m_metadata.IOSpec.Output.Values)
                {
                    outputStore.AddNode(new IOItemNode(item));
                }

                outputView.NodeStore = outputStore;

                //disables/enables the controls
                outputView.Sensitive = isEditable;

                outputView.HoverSelection         = true;
                outputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                outputView.Visible = false;
            }
        }
示例#22
0
    public void buildHashTable()
    {
        textview7.Buffer.Text = Semantico.erroresSemanticos;
        string typeString = "", lista = "";

        NodeStore store = new Gtk.NodeStore(typeof(MyTreeNode));

        foreach (var item in Semantico.tablaHash)
        {
            switch (item.Value.tipo)
            {
            case TipoNodo.integer:
                typeString = "Int";
                break;

            case TipoNodo.float_number:
                typeString = "Float";
                break;

            case TipoNodo.boolean:
                typeString = "Boolean";
                break;
            }
            lista = "";
            item.Value.lista.ForEach(element =>
            {
                lista += element.ToString() + " ";
            });
            store.AddNode(new MyTreeNode(item.Value.nombre, item.Value.location, lista, typeString, item.Value.valor.ToString()));
        }

        nodeview1.NodeStore = store;
        nodeview1.AppendColumn("Nombre", new Gtk.CellRendererText(), "text", 0);
        nodeview1.AppendColumn("Locación", new Gtk.CellRendererText(), "text", 1);
        nodeview1.AppendColumn("Lineas", new Gtk.CellRendererText(), "text", 2);
        nodeview1.AppendColumn("Tipo", new Gtk.CellRendererText(), "text", 3);
        nodeview1.AppendColumn("Valor", new Gtk.CellRendererText(), "text", 4);
    }
示例#23
0
        private void FillNodeView()
        {
            NodeStore store = new NodeStore(typeof(Pack));
            PackModel m = new PackModel();
            IDataReader reader = m.GetAll();
            Pack p = null;
            while(reader.Read())
            {
                p = new Pack();
                p.Id = (long) reader["Id"];
                p.Name = (string) reader["Name"];
                p.Price = (float) reader["Price"];
                p.Membership = (float) reader["Membership"];
                p.Areas = new LinkedList<long>();
                store.AddNode(p);
            }

            this.PacksNodeView.NodeStore = store;
            this.PacksNodeView.ShowAll();
        }
        private void SetIOInfo() 
        {
            //set columns in input and output views
            Gtk.NodeStore inputStore = new Gtk.NodeStore(typeof(IOItemNode));
            Gtk.NodeStore outputStore = new Gtk.NodeStore(typeof(IOItemNode));
            
            Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

            //inputs
            TreeViewColumn mappedToColumn = CreateInputMappingColumnWithComboBox(inputStore);
            this.inputView.AppendColumn("Input", textRenderer, "text", 0);
            this.inputView.AppendColumn(mappedToColumn);
            this.inputView.AppendColumn("Type", textRenderer, "text", 2);

            //outputs
            Gtk.CellRendererText editableTextRenderer = new CellRendererText();
            editableTextRenderer.Editable = true;
            editableTextRenderer.Edited += delegate(object o, EditedArgs args) {
                IOItemNode n = (IOItemNode)outputStore.GetNode (new TreePath (args.Path));
                n.MappedTo = args.NewText;
            };

            this.outputView.AppendColumn("Output", textRenderer, "text", 0);
            this.outputView.AppendColumn("Output as", editableTextRenderer, "text", 1);
            this.outputView.AppendColumn("Type", textRenderer, "text", 2);
            
            //prepare input and output store
            foreach(IOItem item in m_metadata.IOSpec.Input.Values) {
                inputStore.AddNode(new IOItemNode(item));
            }
            
            foreach(IOItem item in m_metadata.IOSpec.Output.Values) {
                outputStore.AddNode(new IOItemNode(item));
            }
            
            inputView.NodeStore = inputStore;
            outputView.NodeStore = outputStore;
        }
示例#25
0
 void AddFolder(NodeStore Store)
 {
     if (PlatformDetection.IsWindows)
     {
         using (Ionic.Utils.FolderBrowserDialogEx dialog = new Ionic.Utils.FolderBrowserDialogEx())
         {
             dialog.Description = "Choose the Folder to scan.";
             dialog.ShowNewFolderButton = false;
             dialog.ShowFullPathInEditBox = true;
             if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 if (!String.IsNullOrWhiteSpace(dialog.SelectedPath))
                 {
                     try
                     {
                         Store.AddNode(new StringNode() { Value = new System.IO.DirectoryInfo(dialog.SelectedPath).FullName });
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(ex.Message);
                     }
                 }
             }
         }
     }
     else
     {
         using (Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the Folder to scan.",
                                                                     this,
                                                                     FileChooserAction.SelectFolder,
                                                                     "Cancel", ResponseType.Cancel,
                                                                     "Open", ResponseType.Accept))
         {
             fc.LocalOnly = false;
             if (fc.Run() == (int)ResponseType.Accept)
             {
                 try
                 {
                     Store.AddNode(new StringNode() { Value = new System.IO.DirectoryInfo(fc.Filename).FullName });
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message);
                 }
             }
             //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
             fc.Destroy();
         }
     }
 }
示例#26
0
    private void SetDetailView()
    {
        var selectednode = (MovieTreeNode)MovieNodeView.NodeSelection.SelectedNode;
        if (selectednode == null)
            return;
        var store = new NodeStore (typeof(DetailTreeNode));
        store.AddNode (new DetailTreeNode ("Added:", selectednode.SubAddDate));
        store.AddNode (new DetailTreeNode ("Release:", selectednode.ReleaseName));
        store.AddNode (new DetailTreeNode ("Comments:", selectednode.AuthorCommments));
        store.AddNode (new DetailTreeNode ("Language:", selectednode.Language));
        store.AddNode (new DetailTreeNode ("Rating:", selectednode.SubRating));
        store.AddNode (new DetailTreeNode ("IMDB:", selectednode.IMDBRating));
        store.AddNode (new DetailTreeNode ("Format:", selectednode.SubFormat));
        store.AddNode (new DetailTreeNode ("HearingImpaired:", selectednode.SubHearingImpaired.ToString ()));

        DetailNode.NodeStore = store;
        DetailNode.ShowAll ();
        Downloadbutton.Sensitive = true;
    }
示例#27
0
        // END HERZUM BUG FIX: alignment input-output TLAB-255
        private void SetInputInfo(bool isEditable)
        {
            Gdk.Color colorBack;
            if (m_metadata.IOSpec.Input.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore inputStore = new Gtk.NodeStore(typeof(IOItemNode));

                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                // HERZUM SPRINT 4.2: TLAB-226
                // HERZUM SPRINT 5: TLAB-242
                colorBack = new  Gdk.Color(245, 245, 245);
                textRenderer.CellBackgroundGdk = colorBack;
                // END HERZUM SPRINT 5: TLAB-242
                //textRenderer.CellBackground = "grey";
                // END HERZUM SPRINT 4.2: TLAB-226

                //inputs
                // HERZUM BUG FIX: alignment input-output TLAB-255
                //HERZUM SPRINT 5.4 TLAB-241;
                t_Input           = this.inputView.AppendColumn(Convert.ToChar(187) + " Input", textRenderer, "text", 0);
                t_Input.Resizable = true;
                //END HERZUM SPRINT 5.4 TLAB-241
                t_InputMapped           = CreateInputMappingColumnWithComboBox(inputStore, "Mapped to");
                t_InputMapped.Resizable = true;
                inputView.AppendColumn(t_InputMapped);
                t_InputType           = this.inputView.AppendColumn("Type", textRenderer, "text", 2);
                t_InputType.Resizable = true;
                //END HERZUM BUG FIX TLAB-255

                //prepare input and output store
                // HERZUM BUG FIX: alignment input-output TLAB-255
                int currentLengthInput       = 0;
                int currentLengthInputMapped = 0;
                foreach (IOItem item in m_metadata.IOSpec.Input.Values)
                {
                    inputStore.AddNode(new IOItemNode(item));
                    currentLengthInput       = item.IOItemDefinition.Name.Length;
                    currentLengthInputMapped = item.MappedTo.Length;
                    if (currentLengthInput > maxLengthInput)
                    {
                        maxLengthInput = currentLengthInput;
                    }
                    if (currentLengthInputMapped > maxLengthInputMapped)
                    {
                        maxLengthInputMapped = currentLengthInputMapped;
                    }
                }
                // END HERZUM BUG FIX: alignment input-output TLAB-255

                inputView.NodeStore = inputStore;

                //disables/enables the controls
                inputView.Sensitive = isEditable;

                inputView.HoverSelection         = true;
                inputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                inputView.Visible = false;
            }
        }
示例#28
0
        // END HERZUM BUG FIX: alignment input-output TLAB-255
        private void SetInputInfo(bool isEditable) 
        {
            Gdk.Color colorBack;
            if(m_metadata.IOSpec.Input.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore inputStore = new Gtk.NodeStore(typeof(IOItemNode));

                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                // HERZUM SPRINT 4.2: TLAB-226
                // HERZUM SPRINT 5: TLAB-242
                colorBack = new  Gdk.Color (245, 245, 245);
                textRenderer.CellBackgroundGdk = colorBack;
                // END HERZUM SPRINT 5: TLAB-242
                //textRenderer.CellBackground = "grey";
                // END HERZUM SPRINT 4.2: TLAB-226

                //inputs
                // HERZUM BUG FIX: alignment input-output TLAB-255
                //HERZUM SPRINT 5.4 TLAB-241;
                t_Input = this.inputView.AppendColumn( Convert.ToChar (187) + " Input", textRenderer, "text", 0);
                t_Input.Resizable = true;
                //END HERZUM SPRINT 5.4 TLAB-241
                t_InputMapped=CreateInputMappingColumnWithComboBox (inputStore, "Mapped to");
                t_InputMapped.Resizable = true;
                inputView.AppendColumn(t_InputMapped);
                t_InputType=this.inputView.AppendColumn("Type", textRenderer, "text", 2);
                t_InputType.Resizable = true;
                //END HERZUM BUG FIX TLAB-255

                //prepare input and output store
                // HERZUM BUG FIX: alignment input-output TLAB-255
                int currentLengthInput=0;
                int currentLengthInputMapped=0;
                foreach(IOItem item in m_metadata.IOSpec.Input.Values) 
                {
                    inputStore.AddNode(new IOItemNode(item));
                    currentLengthInput = item.IOItemDefinition.Name.Length;
                    currentLengthInputMapped = item.MappedTo.Length;
                    if (currentLengthInput>maxLengthInput)
                        maxLengthInput = currentLengthInput;
                    if (currentLengthInputMapped > maxLengthInputMapped)
                        maxLengthInputMapped = currentLengthInputMapped;
                }
                // END HERZUM BUG FIX: alignment input-output TLAB-255

                inputView.NodeStore = inputStore;

                //disables/enables the controls
                inputView.Sensitive = isEditable;

                inputView.HoverSelection = true;
                inputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                inputView.Visible = false;
            }
        }
        private void SetInputInfo(bool isEditable) 
        {
            if(m_metadata.IOSpec.Input.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore inputStore = new Gtk.NodeStore(typeof(IOItemNode));

                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                //inputs
                this.inputView.AppendColumn("Input", textRenderer, "text", 0);
                this.inputView.AppendColumn(CreateInputMappingColumnWithComboBox(inputStore, "Mapped to"));
                this.inputView.AppendColumn("Type", textRenderer, "text", 2);

                //prepare input and output store
                foreach(IOItem item in m_metadata.IOSpec.Input.Values) 
                {
                    inputStore.AddNode(new IOItemNode(item));
                }

                inputView.NodeStore = inputStore;

                //disables/enables the controls
                inputView.Sensitive = isEditable;

                inputView.HoverSelection = true;
                inputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                inputView.Visible = false;
            }
        }
示例#30
0
 private void ReloadKeyListView()
 {
     mKeyCollection = new Gtk.NodeStore(typeof(KeyNode));
       try {
     foreach (var key in mAgent.GetAllKeys()) {
       mKeyCollection.AddNode (new KeyNode(key));
     }
     mKeyNodeView.NodeStore  = mKeyCollection;
     //mKeyNodeView.ShowAll ();
     //mKeyNodeView.ColumnsAutosize ();
     // TODO show different error messages for specific exceptions
     // should also do something besides MessageBox so that this control
     // can be integrated into other applications
       } catch (Exception) {
     // TODO - fix strings
     var messageDialog =
       new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal ,
                         Gtk.MessageType.Error , Gtk.ButtonsType.Close ,
                         "failed"/*Strings.errListKeysFailed*/);
     messageDialog.Run ();
     messageDialog.Destroy ();
       }
       UpdateVisibility();
       UpdateButtonStates();
 }
示例#31
0
        public EpisodesEditorGui(iMetaLibrary.Metadata.TvFileMeta Meta)
        {
            this.Build ();

            this.Meta = Meta;

            this.buttonOk.Clicked += HandleButtonOkhandleClicked;

            string tbnFile = Meta.Filename.Substring(0, Meta.Filename.LastIndexOf(".")+1) + "tbn";
            if (System.IO.File.Exists(tbnFile))
            {
                using(System.Drawing.Image image = System.Drawing.Image.FromFile(tbnFile))
                {
                    imgThumbnail.Pixbuf = GuiHelper.ImageToPixbufIcon(image, 320, 240);
                }
                //UsingTbnFile = true;
            }
            else
            {
                //picThumbnail.Image = Resources.noposter;
            }

            store = new NodeStore(typeof(TvEpisodeNode));

            //List<iMetaLibrary.Metadata.TvEpisodeMeta> episodes = new List<iMetaLibrary.Metadata.TvEpisodeMeta>();
            bool first = true;
            foreach (iMetaLibrary.Metadata.TvEpisodeMeta episode in Meta.Episodes)
            {
                //episodes.Add(episode.Clone());
                iMetaLibrary.Metadata.TvEpisodeMeta epmeta = episode.Clone();
                if(first)
                {
                    episodeEditor.Initialize(epmeta);
                    first = false;
                }
                store.AddNode(new TvEpisodeNode(epmeta));
            }
			nvEpisodeList.NodeStore = store;

            nvEpisodeList.AppendColumn("Episode", new Gtk.CellRendererText (), "text", 0);

            nvEpisodeList.NodeSelection.Changed += delegate(object o, System.EventArgs args) {

                Gtk.NodeSelection selection = (Gtk.NodeSelection) o;
                TvEpisodeNode node = (TvEpisodeNode) selection.SelectedNode;
                // check selection hasnt changed
                if (node == SelectedEpisodeNode)
                    return;
                // check if current data in episode editor is valid
                if (!episodeEditor.IsValid())
                {
                    nvEpisodeList.NodeSelection.SelectNode(SelectedEpisodeNode);
                    return;
                }
                else // if valid saved the data to the meta object
                {
                    episodeEditor.Save();
                    // this reassignment to itself forces the listbox to revalidate it and updates the text in the listbox if change, otherwise it doesnt update
                    //lstEpisodes.Items[SelectedEpisodeIndex] = lstEpisodes.Items[SelectedEpisodeIndex];
                }
                // update selected epsiode index
                SelectedEpisodeNode = node;
                // initialize the newly selected episode data
                episodeEditor.Initialize(node.Meta);
            };
示例#32
0
        private void FillNodeView(IDataReader reader)
        {
            NodeStore store = new NodeStore(typeof(Client));
            Client c = null;

            while(reader.Read())
            {
                c = new Client();
                c.Id = (long) reader["Id"];
                c.Name = (string) reader["Name"];
                c.Surname = (string) reader["Surname"];
                c.Address = (string) reader["Address"];
                c.PhoneNumber = (string) reader["PhoneNumber"];
                c.Email = (string) reader["Email"];

                store.AddNode(c);
            }

            this.MembersNodeView.NodeStore = store;
            this.MembersNodeView.ShowAll();
        }
示例#33
0
        private void FillNodeView()
        {
            NodeStore store = new NodeStore(typeof (Area));

            AreaModel m = new AreaModel();
            IDataReader reader = m.GetAll();

            Area a = null;
            while(reader.Read())
            {
                a = new Area();
                a.Id = (long) reader["Id"];
                a.Name = (string) reader["Name"];
                store.AddNode(a);
            }

            this.AreasNodeView.NodeStore = store;
            this.AreasNodeView.ShowAll();
        }
示例#34
0
        private void FillNodeView()
        {
            NodeStore store = new NodeStore(typeof(User));
            User u = null;
            UserModel model = new UserModel();
            System.Data.IDataReader reader = model.GetAll();

            while(reader.Read())
            {
                u = new User();
                u.Id = (long) reader["Id"];
                u.Name = (string) reader["Name"];
                u.Alias = (string) reader["Alias"];
                u.Password = (string) reader["Password"];
                u.Active = (bool) reader["Active"];
                u.Admin = (bool) reader["Admin"];

                store.AddNode(u);
            }

            this.UsersNodeView.NodeStore = store;
            this.UsersNodeView.ShowAll();
        }
示例#35
0
        public static NodeStore getFicheNodeStoreFromIdOperation(int idOperation)
        {
            NodeStore ficheNodeStore = new NodeStore (typeof(FicheNodeTree));

            ConnectionBdd.open ();
            // On cherche la matière entrante correspondante à l'operation
            string requeteSql = "SELECT id_matiere FROM concerne WHERE id_operation=" + idOperation.ToString () + " AND in_out='in'";
            ConnectionBdd.executeRequeteSql (requeteSql);
            ConnectionBdd.data.Read ();
            int idMatiere = (int)ConnectionBdd.data ["id_matiere"];
            ConnectionBdd.close ();
            // On cherche l'operation qui a produite la matiere entrante
            ConnectionBdd.open ();
            requeteSql = "SELECT id_operation FROM concerne WHERE id_matiere=" + idMatiere + " AND in_out='out'";
            ConnectionBdd.executeRequeteSql (requeteSql);
            ConnectionBdd.data.Read ();
            int idOperationPrecedant = (int)ConnectionBdd.data ["id_operation"];
            ConnectionBdd.close();
            // On récupere les fiches en attente d'une operation
            ConnectionBdd.open();
            requeteSql = "SELECT effectue.id_operation, effectue.horodate, effectue.numero_tracabilite, personne.prenom, personne.nom, operation.libelle_operation, effectue.id_fiche " +
                "FROM effectue " +
                "JOIN personne ON personne.id = effectue.id_personne " +
                "JOIN operation ON effectue.id_operation = operation.id " +
                "WHERE effectue.id_operation >=" + idOperationPrecedant.ToString () + " " +
                "GROUP BY effectue.numero_tracabilite " +
                "HAVING COUNT( * ) =1";
            ConnectionBdd.executeRequeteSql (requeteSql);
            while (ConnectionBdd.data.Read()) {
                ficheNodeStore.AddNode(new FicheNodeTree(
                    (int)ConnectionBdd.data["id_operation"],
                    ConnectionBdd.data["horodate"].ToString(),
                    (String)ConnectionBdd.data["numero_tracabilite"],
                    (String)ConnectionBdd.data["prenom"],
                    (String)ConnectionBdd.data["nom"],
                    (String)ConnectionBdd.data["libelle_operation"],
                    (int)ConnectionBdd.data["id_fiche"]
                ));
            }
            ConnectionBdd.close ();
            return ficheNodeStore;
        }
示例#36
0
        // END HERZUM BUG FIX: alignment input-output TLAB-255
        private void SetOutputInfo(bool isEditable) 
        {
            if(m_metadata.IOSpec.Output.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore outputStore = new Gtk.NodeStore(typeof(IOItemNode));
                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                Gtk.CellRendererText editableTextRenderer = new CellRendererText();
                editableTextRenderer.Editable = isEditable;
                editableTextRenderer.Edited += delegate(object o, EditedArgs args) {
                    IOItemNode n = (IOItemNode)outputStore.GetNode (new TreePath (args.Path));
                    n.MappedTo = args.NewText;
                    RefreshIOHighlightInExperiment(n.MappedTo);
                };

                // HERZUM SPRINT 4.2: TLAB-226
                //textRenderer.CellBackground = "grey";
                // HERZUM SPRINT 5: TLAB-242
                Gdk.Color colorBack = new  Gdk.Color (245, 245, 245);
                textRenderer.CellBackgroundGdk = colorBack;
                // END HERZUM SPRINT 5: TLAB-242
                // END HERZUM SPRINT 4.2: TLAB-226 

                // HERZUM BUG FIX: alignment input-output TLAB-255
                //HERZUM SPRINT 5.4 TLAB-241
                t_Output = this.outputView.AppendColumn(Convert.ToChar(171) + " Output", textRenderer, "text", 0);
                t_Output.Resizable = true;
                //END HERZUM SPRINT 5.4 TLAB-241
                t_OutputAs=this.outputView.AppendColumn("Output as", editableTextRenderer, "text", 1);
                t_OutputAs.Resizable = true;
                t_OutputType=this.outputView.AppendColumn("Type", textRenderer, "text", 2);
                t_OutputType.Resizable = true;
                // END HERZUM BUG FIX: alignment input-output TLAB-255

                int currentLengthOutput;
                int currentLengthOutputAs;
                foreach(IOItem item in m_metadata.IOSpec.Output.Values) 
                {
                    outputStore.AddNode(new IOItemNode(item));
                    // HERZUM BUG FIX: alignment input-output TLAB-255
                    currentLengthOutput = item.IOItemDefinition.Name.Length;
                    currentLengthOutputAs = item.MappedTo.Length;
                    if (currentLengthOutput>maxLengthOutput)
                        maxLengthOutput = currentLengthOutput;
                    if (currentLengthOutputAs>maxLengthOutputAs)
                        maxLengthOutputAs = currentLengthOutputAs;
                    // END HERZUM BUG FIX: alignment input-output TLAB-255
                }

                outputView.NodeStore = outputStore;
                
                //disables/enables the controls
                outputView.Sensitive = isEditable;

                outputView.HoverSelection = true;
                outputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                outputView.Visible = false;
            }
        }
        public void NewStore ()
        {
            institutions = Institution.FindAllOrderedByName ();

            store = new Gtk.NodeStore (typeof(InstitutionNode));

            foreach (Institution i in institutions)
                store.AddNode (new InstitutionNode (i));
            if (institutions.Length > 0)
                institutionNodeView.NodeSelection.SelectPath(new Gtk.TreePath("0"));
            total.Text = institutions.Length.ToString () + " " + Catalog.GetString("records");
        }
示例#38
0
        public PreferencesDialog()
        {
            this.Build ();

            notebook1.ShowTabs = false;
            notebook1.ShowBorder = false;

            ChangeTab(0);

            storeMovieFolders = new NodeStore (typeof(StringNode));
            storeTvFolders = new NodeStore (typeof(StringNode));

            foreach (string folder in iMetaLibrary.Settings.MovieFolders)
                storeMovieFolders.AddNode (new StringNode (){ Value = folder});
            nvMovieFolders.NodeStore = storeMovieFolders;
            nvMovieFolders.AppendColumn ("Folder", new Gtk.CellRendererText (), "text", 0);

            foreach (string folder in iMetaLibrary.Settings.TvFolders)
                storeTvFolders.AddNode (new StringNode (){ Value = folder});
            nvTvFolders.NodeStore = storeTvFolders;
            nvTvFolders.AppendColumn ("Folder", new Gtk.CellRendererText (), "text", 0);

            btnMovieFolderAdd.Clicked += delegate {
                AddFolder (storeMovieFolders);
            };
            btnTvFolderAdd.Clicked += delegate {
                AddFolder (storeTvFolders);
            };
            btnMovieFolderRemove.Clicked += delegate {
                RemoveFolder (nvMovieFolders, storeMovieFolders);
            };
            btnTvFolderRemove.Clicked += delegate {
                RemoveFolder (nvTvFolders, storeTvFolders);
            };
            eventTabGeneral.ButtonPressEvent += delegate {
                ChangeTab(0);
            };
            eventTabMovies.ButtonPressEvent += delegate {
                ChangeTab (1);
            };
            eventTabTvShows.ButtonPressEvent += delegate {
                ChangeTab (2);
            };
            eventTabAdvanced.ButtonPressEvent += delegate {
                ChangeTab (3);
            };
            eventTabMovies.ExposeEvent += delegate {

                using (Cairo.Context ctx = Gdk.CairoHelper.Create(eventTabMovies.GdkWindow)) {
                    //ctx.SetSourceRGB(0.2, 0.23, 0.9);
                    //ctx.Rectangle(0, 0, 200, 200);
                    //ctx.Fill();
                    /*
                    Cairo.Gradient pat = new Cairo.LinearGradient (0, 0, 100, 100);
                    pat.AddColorStop (0, new Cairo.Color (0,0,0));
                    pat.AddColorStop (1, new Cairo.Color (1,1,1));
                    ctx.Pattern = pat;
                    */

                    // Shape
                    ctx.MoveTo (new PointD (0, 0));
                    ctx.MoveTo (new PointD (200, 0));
                    ctx.MoveTo (new PointD (200, 200));
                    ctx.MoveTo (new PointD (0, 0));

                    ctx.ClosePath ();
                    // Save the state to restore it later. That will NOT save the path
                    ctx.Save ();
                    Cairo.Gradient pat = new Cairo.LinearGradient (100, 200, 200, 100);
                    pat.AddColorStop (0, new Cairo.Color (0, 0, 0, 1));
                    pat.AddColorStop (1, new Cairo.Color (1, 0, 0, 1));
                    ctx.Pattern = pat;

                    // Fill the path with pattern
                    ctx.FillPreserve ();

                    // We "undo" the pattern setting here
                    ctx.Restore ();

                    // Color for the stroke
                    ctx.Color = new Color (0, 0, 0);

                    ctx.LineWidth = 3;
                    ctx.Stroke ();
                }
            };

            fcbCachePath.SetUri (iMetaLibrary.Settings.CachePath);

            storeVideoExtensions = new ListStore (typeof(string));
            List<string> extensions = new List<string> (iMetaLibrary.Settings.VideoExtensions);
            extensions.Sort ();
            foreach (string extension in extensions)
                storeVideoExtensions.AppendValues (extension);
            nvVideoExtensions.Model = storeVideoExtensions;

            nvVideoExtensions.AppendColumn ("Extension", new CellRendererText (), "text", 0);

            txtTvRegex.Text = iMetaLibrary.Settings.TvRegularExpression;
            txtTvEpisodeNumbersRegex.Text = iMetaLibrary.Settings.TvEpisodeExpression;
            txtTvSeasonRegex.Text = iMetaLibrary.Settings.TvSeasonExpression;
            txtTvShowTitleRegex.Text = iMetaLibrary.Settings.TvShowTitleExpression;

            numMaxFanArt.Value = iMetaLibrary.Settings.MaxFanArt;
            chkAddYearToMovieFolders.Active = iMetaLibrary.Settings.AddYearToMovieFolders;
            chkAttempToDownloadTrailers.Active = iMetaLibrary.Settings.AttemptTrailerDownload;
            chkAttemptToDownloadMissingTrailers.Active = iMetaLibrary.Settings.AttemptTrailerDownloadMissingTrailers;
            chkUseFolderNameForMovieLookup.Active = iMetaLibrary.Settings.UseFolderNameForMovieLookup;

            chkAutoRenameEpisodes.Active = iMetaLibrary.Settings.AutoRenameEpisodes;

            txtFanArtResolution.Text = iMetaLibrary.Settings.FanArtWidth + "x" + iMetaLibrary.Settings.FanArtHeight;
            txtPosterResolution.Text = iMetaLibrary.Settings.PosterWidth + "x" + iMetaLibrary.Settings.PosterHeight;
            txtBannerResolution.Text = iMetaLibrary.Settings.BannerWidth + "x" + iMetaLibrary.Settings.BannerHeight;
            txtImageQuality.Text = iMetaLibrary.Settings.ImageQuality.ToString ();
            chkUseBannersForFolderImage.Active = iMetaLibrary.Settings.UseBannersForTvFolders;

            buttonOk.Clicked += HandleButtonOkClicked;
            /*
            buttonCancel.Clicked += delegate
            {
                this.DialogResult = Gtk.ResponseType.Cancel;
                this.Destroy();
            };*/

            btnAddVideoExtension.Clicked += delegate {

            };
            btnRemoveVideoExtension.Clicked += delegate {

            };
        }
        private void SetOutputInfo(bool isEditable) 
        {
            if(m_metadata.IOSpec.Output.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore outputStore = new Gtk.NodeStore(typeof(IOItemNode));
                
                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                Gtk.CellRendererText editableTextRenderer = new CellRendererText();
                editableTextRenderer.Editable = isEditable;
                editableTextRenderer.Edited += delegate(object o, EditedArgs args) {
                    IOItemNode n = (IOItemNode)outputStore.GetNode (new TreePath (args.Path));
                    n.MappedTo = args.NewText;
                    RefreshIOHighlightInExperiment(n.MappedTo);
                };
                
                this.outputView.AppendColumn("Output", textRenderer, "text", 0);
                this.outputView.AppendColumn("Output as", editableTextRenderer, "text", 1);
                this.outputView.AppendColumn("Type", textRenderer, "text", 2);

                foreach(IOItem item in m_metadata.IOSpec.Output.Values) 
                {
                    outputStore.AddNode(new IOItemNode(item));
                }

                outputView.NodeStore = outputStore;
                
                //disables/enables the controls
                outputView.Sensitive = isEditable;

                outputView.HoverSelection = true;
                outputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                outputView.Visible = false;
            }
        }
示例#40
0
 private NodeStore CreateContactNodeStore()
 {
     var store = new Gtk.NodeStore(typeof(ContactTreeNode));
     foreach (var contact in this.contactService.getAllContacts()) {
         store.AddNode(new ContactTreeNode(contact));
     }
     return store;
 }
示例#41
0
    private void GetSubs()
    {
        var store = new NodeStore (typeof(MovieTreeNode));
        statusbar1.Push (1, "Searching for filename.");
        var opensub = new OpenSubtitlesClient ();
        _subtitles = opensub.FileSearch (_fname, GetCurrentLang ());
        statusbar1.Push (2, "Found " + _subtitles.Count + " titles");
        if (_subtitles.Count > 0) {
            foreach (OpenSubtitlesClient.SearchResult sub in _subtitles) {
                var node = new MovieTreeNode {
                    Title = sub.MovieName,
                    Year = sub.MovieYear,
                    Season = sub.SeriesSeason,
                    Episode = sub.SeriesEpisode,
                    Uploader = sub.UserNickName,
                    Downloads = sub.SubDownloadsCnt,
                    DownloadLink = sub.SubDownloadLink,
                    AuthorCommments = sub.SubAuthorComment,
                    SubAddDate = sub.SubAddDate.ToShortDateString(),
                    ReleaseName = sub.MovieReleaseName,
                    IMDBRating = sub.MovieImdbRating,
                    SubRating = sub.SubRating,
                    Lang = sub.SubLanguageID,
                    Language = sub.LanguageName,
                    SubFormat = sub.SubFormat,
                    SubHearingImpaired = sub.SubHearingImpaired == "1",
                    IDMovieImdb = sub.IDMovieImdb
                };
                store.AddNode (node);
            }
        }

        MovieNodeView.NodeStore = store;
        DetailNode.NodeStore = null;
        MovieNodeView.ShowAll ();
        DetailNode.ShowAll ();

        TreeIter it;
        if (MovieNodeView.Model.GetIterFirst (out it)) {
            MovieNodeView.Selection.SelectIter (it);
            SetDetailView ();
        } else {
            Downloadbutton.Sensitive = false;
        }
    }
示例#42
0
        public MovieEditor(iMetaLibrary.Metadata.MovieMeta Meta)
        {
            this.Build ();
            this.Meta = Meta;
            #region setup the actors datagrid
            store = new NodeStore(typeof(ActorNode));

            CellRendererText nameRender = new CellRendererText(){ Editable = true, };
            nameRender.Edited += delegate(object o, EditedArgs args) {
                // update the text
                ActorNode node = (ActorNode)store.GetNode(new Gtk.TreePath(args.Path));
                node.Name = args.NewText;
            };
            nvActors.AppendColumn("Name", nameRender, "text", 0);
            CellRendererText roleRender = new CellRendererText(){ Editable = true, };
            roleRender.Edited += delegate(object o, EditedArgs args) {
                // update the text
                ActorNode node = (ActorNode)store.GetNode(new Gtk.TreePath(args.Path));
                node.Role = args.NewText;
            };
            nvActors.AppendColumn("Role", roleRender, "text", 1);

            nvActors.NodeStore = store;

            btnActorsRemove.Clicked += delegate
            {
                ActorNode node = nvActors.NodeSelection.SelectedNode as ActorNode;
                if(node != null)
                    store.RemoveNode(node);
            };
            btnActorsAdd.Clicked += delegate {
                var node = new ActorNode();
                store.AddNode(node);
                nvActors.NodeSelection.SelectNode(node);
                int _n = 0;
                var enumerator = store.GetEnumerator();
                while(enumerator.MoveNext()) _n++;
                nvActors.ScrollToCell(new TreePath(new int[] {_n-1}), null, false, 0, 0);
            };
            #endregion

            if(Meta.Actors != null){
                foreach(var actor in Meta.Actors)
                    store.AddNode(new ActorNode() { Name = actor.Key, Role = actor.Value});
            }

            txtTitle.Text = Meta.Title ?? "";
            txtSortTitle.Text = Meta.SortTitle ?? "";
            txtSet.Text = Meta.Set ?? "";
            txtTagline.Text = Meta.TagLine ?? "";
            txtGenres.Text = String.Join(", ", Meta.Genres ?? new string[] {});
            txtDirectors.Text = String.Join(", ", Meta.Directors ?? new string[] {});
            txtWriters.Text = String.Join(", ", Meta.Writers ?? new string[] {});
            txtTrailer.Text = Meta.Trailer ?? "";
            txtImdbId.Text = Meta.Id ?? "";
            txtMpaa.Text = Meta.Mpaa ?? "";
            txtReleaseDate.Text = Meta.ReleaseDate > new DateTime(1850, 1,1) ? Meta.ReleaseDate.ToString("yyyy-MM-dd") : "";
            txtPlot.Buffer.Text = Meta.Plot ?? "";
            numRuntime.Value = Meta.Runtime / 60; // convert seconds to minutes
            ratingwidget.Value = (int)Meta.Rating;

            Poster = GuiHelper.ImageToPixbuf(Meta.LoadThumbnail(290, 1000));

            //ratingwidget.Visible  = false;

            buttonOk.Clicked += delegate {
                Save ();
            };

            eventPoster.ButtonPressEvent +=	delegate{
                BrowseForNewPoster();
            };
        }
示例#43
0
        // END HERZUM BUG FIX: alignment input-output TLAB-255
        private void SetOutputInfo(bool isEditable)
        {
            if (m_metadata.IOSpec.Output.Count > 0)
            {
                //set columns in input and output views
                Gtk.NodeStore        outputStore  = new Gtk.NodeStore(typeof(IOItemNode));
                Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();

                Gtk.CellRendererText editableTextRenderer = new CellRendererText();
                editableTextRenderer.Editable = isEditable;
                editableTextRenderer.Edited  += delegate(object o, EditedArgs args) {
                    IOItemNode n = (IOItemNode)outputStore.GetNode(new TreePath(args.Path));
                    n.MappedTo = args.NewText;
                    RefreshIOHighlightInExperiment(n.MappedTo);
                };

                // HERZUM SPRINT 4.2: TLAB-226
                //textRenderer.CellBackground = "grey";
                // HERZUM SPRINT 5: TLAB-242
                Gdk.Color colorBack = new  Gdk.Color(245, 245, 245);
                textRenderer.CellBackgroundGdk = colorBack;
                // END HERZUM SPRINT 5: TLAB-242
                // END HERZUM SPRINT 4.2: TLAB-226

                // HERZUM BUG FIX: alignment input-output TLAB-255
                //HERZUM SPRINT 5.4 TLAB-241
                t_Output           = this.outputView.AppendColumn(Convert.ToChar(171) + " Output", textRenderer, "text", 0);
                t_Output.Resizable = true;
                //END HERZUM SPRINT 5.4 TLAB-241
                t_OutputAs             = this.outputView.AppendColumn("Output as", editableTextRenderer, "text", 1);
                t_OutputAs.Resizable   = true;
                t_OutputType           = this.outputView.AppendColumn("Type", textRenderer, "text", 2);
                t_OutputType.Resizable = true;
                // END HERZUM BUG FIX: alignment input-output TLAB-255

                int currentLengthOutput;
                int currentLengthOutputAs;
                foreach (IOItem item in m_metadata.IOSpec.Output.Values)
                {
                    outputStore.AddNode(new IOItemNode(item));
                    // HERZUM BUG FIX: alignment input-output TLAB-255
                    currentLengthOutput   = item.IOItemDefinition.Name.Length;
                    currentLengthOutputAs = item.MappedTo.Length;
                    if (currentLengthOutput > maxLengthOutput)
                    {
                        maxLengthOutput = currentLengthOutput;
                    }
                    if (currentLengthOutputAs > maxLengthOutputAs)
                    {
                        maxLengthOutputAs = currentLengthOutputAs;
                    }
                    // END HERZUM BUG FIX: alignment input-output TLAB-255
                }

                outputView.NodeStore = outputStore;

                //disables/enables the controls
                outputView.Sensitive = isEditable;

                outputView.HoverSelection         = true;
                outputView.NodeSelection.Changed += SelectionHandleChanged;
            }
            else
            {
                outputView.Visible = false;
            }
        }
示例#44
0
        private void LoadPhones()
        {
            NodeStore store = new NodeStore(typeof(SipListNode));

            try {
                FileStream file = new FileStream("sip.txt", FileMode.OpenOrCreate);
                StreamReader reader = new StreamReader(file);
                string line = reader.ReadLine();
                while (line != null) {
                    line = reader.ReadLine();
                    string[] parts = line.Split(',');
                    store.AddNode(new SipListNode(parts[0].Trim(), "", parts[1].Trim(), ""));
                }
                reader.Close();
                reader.Dispose();
                file.Close();
                file.Dispose();

            } catch (Exception ex) {
                Console.WriteLine(ex.Source);
                Console.WriteLine(ex.StackTrace);
            }

            nodeSip.NodeStore = store;
            nodeSip.ColumnsAutosize();
        }