From ab64fa187f7df94a3242982722d1cd05242446c7 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Thu, 19 Jun 2014 21:52:01 +0200 Subject: gtkui, playlist: disable custom title in both "add location" and playlist context menu, until new title formatting is finished --- playlist.c | 15 ++++++++++++++- plugins/gtkui/actionhandlers.c | 13 +++++++++++-- plugins/gtkui/deadbeef.glade | 1 - plugins/gtkui/interface.c | 1 - plugins/gtkui/plcommon.c | 11 +++++++++++ 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/playlist.c b/playlist.c index 16f0e6a1..d3d3a6be 100644 --- a/playlist.c +++ b/playlist.c @@ -62,6 +62,9 @@ #include "volume.h" #include "pltmeta.h" +// disable custom title function, until we have new title formatting (0.7) +#define DISABLE_CUSTOM_TITLE + #define DISABLE_LOCKING 0 #define DEBUG_LOCKING 0 #define DETECT_PL_LOCK_RC 0 @@ -2906,11 +2909,18 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, } else if (*fmt == 'a') { meta = pl_find_meta_raw (it, "artist"); +#ifndef DISABLE_CUSTOM_TITLE const char *custom = pl_find_meta_raw (it, ":CUSTOM_TITLE"); - if (!meta && !custom) { +#endif + if (!meta +#ifndef DISABLE_CUSTOM_TITLE + && !custom +#endif + ) { meta = "Unknown artist"; } +#ifndef DISABLE_CUSTOM_TITLE if (custom) { if (!meta) { meta = custom; @@ -2922,6 +2932,7 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, meta = out; } } +#endif } else if (*fmt == 't') { meta = pl_find_meta_raw (it, "title"); @@ -2970,6 +2981,7 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, } } +#ifndef DISABLE_CUSTOM_TITLE const char *custom = pl_find_meta_raw (it, ":CUSTOM_TITLE"); if (custom) { if (!meta) { @@ -2982,6 +2994,7 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, meta = out; } } +#endif } else if (*fmt == 'C') { meta = pl_find_meta_raw (it, "composer"); diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c index ad4bf04c..99a658bb 100644 --- a/plugins/gtkui/actionhandlers.c +++ b/plugins/gtkui/actionhandlers.c @@ -40,6 +40,9 @@ #include "callbacks.h" #include +// disable custom title function, until we have new title formatting (0.7) +#define DISABLE_CUSTOM_TITLE + extern GtkWidget *mainwin; extern DB_functions_t *deadbeef; @@ -401,7 +404,6 @@ on_toggle_set_custom_title (GtkToggleButton *togglebutton, gpointer user_data) { deadbeef->conf_save (); } - gboolean action_add_location_handler_cb (void *user_data) { GtkWidget *dlg = create_addlocationdlg (); @@ -409,18 +411,23 @@ action_add_location_handler_cb (void *user_data) { GtkWidget *sct = lookup_widget (dlg, "set_custom_title"); GtkWidget *ct = lookup_widget (dlg, "custom_title"); +#ifndef DISABLE_CUSTOM_TITLE if (deadbeef->conf_get_int ("gtkui.location_set_custom_title", 0)) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sct), TRUE); gtk_widget_set_sensitive (ct, TRUE); } - else { + else +#endif + { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sct), FALSE); gtk_widget_set_sensitive (ct, FALSE); } +#ifndef DISABLE_CUSTOM_TITLE g_signal_connect ((gpointer) sct, "toggled", G_CALLBACK (on_toggle_set_custom_title), dlg); +#endif gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_OK); int res = gtk_dialog_run (GTK_DIALOG (dlg)); @@ -433,9 +440,11 @@ action_add_location_handler_cb (void *user_data) { if (!deadbeef->plt_add_files_begin (plt, 0)) { DB_playItem_t *tail = deadbeef->plt_get_last (plt, PL_MAIN); DB_playItem_t *it = deadbeef->plt_insert_file2 (0, plt, tail, text, NULL, NULL, NULL); +#ifndef DISABLE_CUSTOM_TITLE if (it && deadbeef->conf_get_int ("gtkui.location_set_custom_title", 0)) { deadbeef->pl_replace_meta (it, ":CUSTOM_TITLE", gtk_entry_get_text (GTK_ENTRY (ct))); } +#endif if (tail) { deadbeef->pl_item_unref (tail); } diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index 7828a9bf..57dd0cbe 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -6342,7 +6342,6 @@ if you don't press Apply. - True False 8 diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index 5cd3ce7e..c4c02b73 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -3223,7 +3223,6 @@ create_addlocationdlg (void) gtk_entry_set_activates_default (GTK_ENTRY (addlocation_entry), TRUE); hbox122 = gtk_hbox_new (FALSE, 8); - gtk_widget_show (hbox122); gtk_box_pack_start (GTK_BOX (vbox45), hbox122, TRUE, TRUE, 0); set_custom_title = gtk_check_button_new_with_mnemonic (_("Set custom title")); diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c index a6077929..d7df4f62 100644 --- a/plugins/gtkui/plcommon.c +++ b/plugins/gtkui/plcommon.c @@ -38,6 +38,9 @@ //#define trace(...) { fprintf(stderr, __VA_ARGS__); } #define trace(fmt,...) +// disable custom title function, until we have new title formatting (0.7) +#define DISABLE_CUSTOM_TITLE + char group_by_str[MAX_GROUP_BY_STR]; extern GtkWidget *theme_treeview; @@ -478,6 +481,7 @@ on_toggle_set_custom_title (GtkToggleButton *togglebutton, gpointer user_data) { deadbeef->conf_save (); } +#ifndef DISABLE_CUSTOM_TITLE void on_set_custom_title_activate (GtkMenuItem *menuitem, gpointer user_data) { @@ -530,6 +534,7 @@ on_set_custom_title_activate (GtkMenuItem *menuitem, gpointer user_data) gtk_widget_destroy (dlg); lv->binding->unref (it); } +#endif void on_remove_from_disk_activate (GtkMenuItem *menuitem, @@ -624,7 +629,9 @@ list_context_menu (DdbListview *listview, DdbListviewIter it, int idx) { GtkWidget *separator8; GtkWidget *properties1; GtkWidget *reload_metadata; +#ifndef DISABLE_CUSTOM_TITLE GtkWidget *set_custom_title; +#endif playlist_menu = gtk_menu_new (); add_to_playback_queue1 = gtk_menu_item_new_with_mnemonic (_("Add To Playback Queue")); @@ -795,6 +802,7 @@ list_context_menu (DdbListview *listview, DdbListviewIter it, int idx) { gtk_widget_set_sensitive (separator8, FALSE); } +#ifndef DISABLE_CUSTOM_TITLE set_custom_title = gtk_menu_item_new_with_mnemonic (_("Set Custom Title")); gtk_widget_show (set_custom_title); gtk_container_add (GTK_CONTAINER (playlist_menu), set_custom_title); @@ -806,6 +814,7 @@ list_context_menu (DdbListview *listview, DdbListviewIter it, int idx) { gtk_widget_show (separator); gtk_container_add (GTK_CONTAINER (playlist_menu), separator); gtk_widget_set_sensitive (separator, FALSE); +#endif properties1 = gtk_menu_item_new_with_mnemonic (_("Track Properties")); gtk_widget_show (properties1); @@ -829,9 +838,11 @@ list_context_menu (DdbListview *listview, DdbListviewIter it, int idx) { G_CALLBACK (on_remove_from_disk_activate), NULL); } +#ifndef DISABLE_CUSTOM_TITLE g_signal_connect ((gpointer) set_custom_title, "activate", G_CALLBACK (on_set_custom_title_activate), listview); +#endif g_signal_connect ((gpointer) properties1, "activate", G_CALLBACK (main_properties_activate), NULL); -- cgit v1.2.3