diff options
author | waker <wakeroid@gmail.com> | 2011-03-10 11:31:25 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-03-10 11:31:25 +0100 |
commit | bf8c195369b6e9c105a255427c59bdf3e8fef065 (patch) | |
tree | f73f8d390c1bf96c6109d1b123a692cac462d7e9 /plugins/gtkui | |
parent | 4c518826541470586bbc875eee477d3be48530eb (diff) |
don't send single track to trkproperties;
never disable Write button in trkproperties
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/plcommon.c | 8 | ||||
-rw-r--r-- | plugins/gtkui/trkproperties.c | 40 | ||||
-rw-r--r-- | plugins/gtkui/trkproperties.h | 2 |
3 files changed, 7 insertions, 43 deletions
diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c index bffaa6c9..216b7122 100644 --- a/plugins/gtkui/plcommon.c +++ b/plugins/gtkui/plcommon.c @@ -267,13 +267,7 @@ void main_properties_activate (GtkMenuItem *menuitem, gpointer user_data) { - DB_playItem_t *it = deadbeef->pl_get_for_idx_and_iter (clicked_idx, PL_MAIN); - if (!it) { - fprintf (stderr, "attempt to view properties of non-existing item\n"); - return; - } - show_track_properties_dlg (it); - deadbeef->pl_item_unref (it); + show_track_properties_dlg (); } void diff --git a/plugins/gtkui/trkproperties.c b/plugins/gtkui/trkproperties.c index 92b85f25..ca50da2a 100644 --- a/plugins/gtkui/trkproperties.c +++ b/plugins/gtkui/trkproperties.c @@ -342,7 +342,7 @@ trkproperties_fill_metadata (void) { } void -show_track_properties_dlg (DB_playItem_t *it) { +show_track_properties_dlg (void) { deadbeef->plt_lock (); deadbeef->pl_lock (); @@ -384,29 +384,6 @@ show_track_properties_dlg (DB_playItem_t *it) { deadbeef->pl_unlock (); deadbeef->plt_unlock (); - int allow_editing = 0; - - int is_subtrack = deadbeef->pl_get_item_flags (it) & DDB_IS_SUBTRACK; - - if (!is_subtrack && deadbeef->is_local_file (deadbeef->pl_find_meta (it, ":URI"))) { - // get decoder plugin by id - DB_decoder_t *dec = NULL; - const char *decoder_id = deadbeef->pl_find_meta (it, ":DECODER"); - if (decoder_id) { - DB_decoder_t **decoders = deadbeef->plug_get_decoder_list (); - for (int i = 0; decoders[i]; i++) { - if (!strcmp (decoders[i]->plugin.id, decoder_id)) { - dec = decoders[i]; - break; - } - } - } - - if (dec && dec->write_metadata) { - allow_editing = 1; - } - } - GtkTreeView *tree; GtkTreeView *proptree; if (!trackproperties) { @@ -419,11 +396,9 @@ show_track_properties_dlg (DB_playItem_t *it) { gtk_tree_view_set_model (tree, GTK_TREE_MODEL (store)); GtkCellRenderer *rend_text = gtk_cell_renderer_text_new (); rend_text2 = GTK_CELL_RENDERER (ddb_cell_renderer_text_multiline_new ()); - if (allow_editing) { - g_signal_connect ((gpointer)rend_text2, "edited", - G_CALLBACK (on_metadata_edited), - store); - } + g_signal_connect ((gpointer)rend_text2, "edited", + G_CALLBACK (on_metadata_edited), + store); GtkTreeViewColumn *col1 = gtk_tree_view_column_new_with_attributes (_("Key"), rend_text, "text", 0, NULL); GtkTreeViewColumn *col2 = gtk_tree_view_column_new_with_attributes (_("Value"), rend_text2, "text", 1, NULL); gtk_tree_view_append_column (tree, col1); @@ -458,12 +433,7 @@ show_track_properties_dlg (DB_playItem_t *it) { trkproperties_fill_metadata (); - if (allow_editing) { - gtk_widget_set_sensitive (lookup_widget (widget, "write_tags"), TRUE); - } - else { - gtk_widget_set_sensitive (lookup_widget (widget, "write_tags"), FALSE); - } + gtk_widget_set_sensitive (lookup_widget (widget, "write_tags"), TRUE); gtk_widget_show (widget); gtk_window_present (GTK_WINDOW (widget)); diff --git a/plugins/gtkui/trkproperties.h b/plugins/gtkui/trkproperties.h index ba8018d8..ccdaa69f 100644 --- a/plugins/gtkui/trkproperties.h +++ b/plugins/gtkui/trkproperties.h @@ -22,7 +22,7 @@ struct DB_playItem_s; void -show_track_properties_dlg (struct DB_playItem_s *it); +show_track_properties_dlg (void); void trkproperties_destroy (void); |