[longomatch] Add support for editing playlists names
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add support for editing playlists names
- Date: Wed, 5 Nov 2014 19:01:51 +0000 (UTC)
commit 318d5b133eaeba85bd1f4b4522f944521e1bb28d
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Oct 30 18:00:04 2014 +0100
Add support for editing playlists names
LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs | 41 ++++++++++++++--------
1 files changed, 26 insertions(+), 15 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs
index 1320490..ef98919 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs
@@ -91,26 +91,27 @@ namespace LongoMatch.Gui.Component
menu = new Menu ();
- delete = new MenuItem (Catalog.GetString ("Delete"));
- delete.Activated += (sender, e) => {
- project.Playlists.Remove (playlist);
- (Model as TreeStore).Remove (ref selectedIter);
- Config.EventsBroker.EmitPlaylistsChanged (this);
- };
- menu.Append (delete);
-
- if (element is PlaylistPlayElement) {
+ if (element is PlaylistPlayElement || element == null) {
PlaylistPlayElement pl = element as PlaylistPlayElement;
- edit = new MenuItem (Catalog.GetString ("Edit"));
+
+ edit = new MenuItem (Catalog.GetString ("Edit name"));
edit.Activated += (sender, e) => {
string name = Config.GUIToolkit.QueryMessage (Catalog.GetString
("Name:"), null,
- pl.Title);
+ pl.Title);
if (!String.IsNullOrEmpty (name)) {
- pl.Title = name;
+ pl.Title = name;
}
};
menu.Append (edit);
}
+
+ delete = new MenuItem (Catalog.GetString ("Delete"));
+ delete.Activated += (sender, e) => {
+ project.Playlists.Remove (playlist);
+ (Model as TreeStore).Remove (ref selectedIter);
+ Config.EventsBroker.EmitPlaylistsChanged (this);
+ };
+ menu.Append (delete);
menu.ShowAll ();
menu.Popup ();
@@ -119,10 +120,20 @@ namespace LongoMatch.Gui.Component
void ShowPlaylistMenu (Playlist playlist)
{
Menu menu;
- MenuItem delete, render;
+ MenuItem edit, delete, render;
menu = new Menu ();
+ edit = new MenuItem (Catalog.GetString ("Edit name"));
+ edit.Activated += (sender, e) => {
+ string name = Config.GUIToolkit.QueryMessage (Catalog.GetString ("Name:"),
null,
+ playlist.Name);
+ if (!String.IsNullOrEmpty (name)) {
+ playlist.Name = name;
+ }
+ };
+ menu.Append (edit);
+
render = new MenuItem (Catalog.GetString ("Render"));
render.Activated += (sender, e) => {
Config.EventsBroker.EmitRenderPlaylist (playlist);
@@ -258,8 +269,8 @@ namespace LongoMatch.Gui.Component
out dragSourceElement);
base.OnDragBegin (context);
}
-
- protected override bool OnKeyPressEvent(Gdk.EventKey evnt)
+
+ protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
{
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]