changeset 3531:18391c12c18c trunk

Ctrl-C copies current title to clipboard now.
author Jonathan Schleifer <js@h3c.de>
date Sat, 15 Sep 2007 10:54:08 +0200
parents 7e8c4aadfc32
children 7532ab3d25e5
files src/audacious/ui_main.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_main.c	Sat Sep 15 00:23:12 2007 +0300
+++ b/src/audacious/ui_main.c	Sat Sep 15 10:54:08 2007 +0200
@@ -970,9 +970,25 @@
         mainwin_minimize_cb();
         break;
     case GDK_Tab:
+	// FIXME
         if (event->state & GDK_CONTROL_MASK)
             gtk_window_present(GTK_WINDOW(equalizerwin));
         break;
+    case GDK_c:
+	if (event->state & GDK_CONTROL_MASK) {
+	    Playlist *playlist = playlist_get_active();
+	    gint pos = playlist_get_position(playlist);
+	    gchar *title = playlist_get_songtitle(playlist, pos);
+
+	    if (title != NULL) {
+		GtkClipboard *clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
+		gtk_clipboard_set_text(clip, title, -1);
+		gtk_clipboard_store(clip);
+	    }
+
+	    return TRUE;
+	}
+	return FALSE;
     default:
         return FALSE;
     }