Ajout rename
This commit is contained in:
parent
46afd98e9b
commit
b50a8301b4
2 changed files with 29 additions and 1 deletions
|
|
@ -84,12 +84,40 @@ namespace DMX2
|
||||||
string l = tree_model.GetValue (iter, 0) as string;
|
string l = tree_model.GetValue (iter, 0) as string;
|
||||||
(cell as Gtk.CellRendererText).Text = l;
|
(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)
|
public SeqSonUI (SequenceurSon s):base(s)
|
||||||
{
|
{
|
||||||
this.Build ();
|
this.Build ();
|
||||||
sequenceur = s;
|
sequenceur = s;
|
||||||
buildListFiles();
|
buildListFiles();
|
||||||
|
|
||||||
|
new ContextMenuHelper(frame1,RenamePopup);
|
||||||
}
|
}
|
||||||
#region implemented abstract members of DMX2.SequenceurUI
|
#region implemented abstract members of DMX2.SequenceurUI
|
||||||
public override void Update (bool full)
|
public override void Update (bool full)
|
||||||
|
|
|
||||||
|
|
@ -3957,7 +3957,7 @@ trames DMX (ms)</property>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="Gtk.Label" id="GtkLabel9">
|
<widget class="Gtk.Label" id="titreLabel">
|
||||||
<property name="MemberName" />
|
<property name="MemberName" />
|
||||||
<property name="LabelProp" translatable="yes">Sequenceur Son</property>
|
<property name="LabelProp" translatable="yes">Sequenceur Son</property>
|
||||||
<property name="UseMarkup">True</property>
|
<property name="UseMarkup">True</property>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue