diff options
-rw-r--r-- | plugins/gtkui/callbacks.c | 18 | ||||
-rw-r--r-- | plugins/gtkui/callbacks.h | 5 | ||||
-rw-r--r-- | plugins/gtkui/deadbeef.glade | 1 | ||||
-rw-r--r-- | plugins/gtkui/interface.c | 3 |
4 files changed, 25 insertions, 2 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 18ea6c58..103056ce 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -49,6 +49,7 @@ extern GtkWidget *mainwin; extern gtkplaylist_t main_playlist; extern gtkplaylist_t search_playlist; extern DB_functions_t *deadbeef; // defined in gtkui.c +GtkWidget *trackproperties; gboolean playlist_tooltip_handler (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer unused) @@ -2301,8 +2302,11 @@ on_properties1_activate (GtkMenuItem *menuitem, fprintf (stderr, "attempt to view properties of non-existing item\n"); return; } - widget = create_trackproperties (); - gtk_window_set_transient_for (GTK_WINDOW (widget), GTK_WINDOW (mainwin)); + if (!trackproperties) { + trackproperties = create_trackproperties (); + gtk_window_set_transient_for (GTK_WINDOW (trackproperties), GTK_WINDOW (mainwin)); + } + widget = trackproperties; // fill in metadata // location w = lookup_widget (widget, "location"); @@ -2387,3 +2391,13 @@ on_cursor_follows_playback_activate (GtkMenuItem *menuitem, + +gboolean +on_trackproperties_delete_event (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) +{ + trackproperties = NULL; + return FALSE; +} + diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h index 7c5812a0..80fd811f 100644 --- a/plugins/gtkui/callbacks.h +++ b/plugins/gtkui/callbacks.h @@ -782,3 +782,8 @@ on_add_column_activate (GtkMenuItem *menuitem, void on_edit_column_activate (GtkMenuItem *menuitem, gpointer user_data); + +gboolean +on_trackproperties_delete_event (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index 0a0ceda4..f54f18bf 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -2572,6 +2572,7 @@ SOCKS5_HOSTNAME</property> <property name="focus_on_map">True</property> <property name="urgency_hint">False</property> <signal name="key_press_event" handler="on_trackproperties_key_press_event" last_modification_time="Thu, 31 Dec 2009 13:46:40 GMT"/> + <signal name="delete_event" handler="on_trackproperties_delete_event" last_modification_time="Sat, 02 Jan 2010 21:38:32 GMT"/> <child> <widget class="GtkTable" id="table7"> diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index d2bfe710..ed1bbb47 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -1946,6 +1946,9 @@ create_trackproperties (void) g_signal_connect ((gpointer) trackproperties, "key_press_event", G_CALLBACK (on_trackproperties_key_press_event), NULL); + g_signal_connect ((gpointer) trackproperties, "delete_event", + G_CALLBACK (on_trackproperties_delete_event), + NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (trackproperties, trackproperties, "trackproperties"); |