diff --git a/DMX-2.0/SeqSonUI.cs b/DMX-2.0/SeqSonUI.cs index 6a27225..95f86f8 100644 --- a/DMX-2.0/SeqSonUI.cs +++ b/DMX-2.0/SeqSonUI.cs @@ -84,12 +84,40 @@ namespace DMX2 string l = tree_model.GetValue (iter, 0) as string; (cell as Gtk.CellRendererText).Text = l; } + + void RenamePopup (object sender, ContextMenuEventArgs e) + { + Menu m = new Menu(); + MenuItem renameItem = new MenuItem("Renommer le Sequenceur"); + renameItem.ButtonPressEvent += new ButtonPressEventHandler(OnRenameItemButtonPressed); + m.Add(renameItem); + m.ShowAll(); + m.Popup(); + } + + void OnRenameItemButtonPressed (object o, ButtonPressEventArgs args) + { + var dlg = new Dialog ("Nouveau Nom ?", GetAncestor(Gtk.Window.GType) as Gtk.Window , DialogFlags.Modal); var entry = new Entry (sequenceur.Name); + dlg.AddButton (Stock.Ok, ResponseType.Ok).GrabDefault(); dlg.AddButton (Stock.Cancel, ResponseType.Cancel); + dlg.VBox.Add (entry); dlg.VBox.ShowAll (); + entry.ActivatesDefault=true; + + + + if ((ResponseType)dlg.Run () == ResponseType.Ok) { + sequenceur.Name = entry.Text; + titreLabel.Text = sequenceur.Name; + } + dlg.Destroy(); + } public SeqSonUI (SequenceurSon s):base(s) { this.Build (); sequenceur = s; buildListFiles(); + + new ContextMenuHelper(frame1,RenamePopup); } #region implemented abstract members of DMX2.SequenceurUI public override void Update (bool full) diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index eee773b..c532190 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -3957,7 +3957,7 @@ trames DMX (ms) - + Sequenceur Son True