summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-19 13:58:56 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-19 13:58:56 +0100
commita28632ec78486dbc3cd9c011810f96cfe2738f1e (patch)
tree48ed0d851151a4624329ad38f6350faf26fa9f97 /plugins/gtkui
parentb9bfcd5b01a8d222ab7c2b421b73c00bf484dd83 (diff)
gtkui: hide hotkeys tab in preferences, if the hotkeys plugin is not available
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/hotkeys.c8
-rw-r--r--plugins/gtkui/prefwin.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/gtkui/hotkeys.c b/plugins/gtkui/hotkeys.c
index 10caec85..7111703f 100644
--- a/plugins/gtkui/hotkeys.c
+++ b/plugins/gtkui/hotkeys.c
@@ -421,9 +421,15 @@ on_hotkeys_actions_clicked (GtkButton *button,
gtk_widget_destroy (dlg);
}
-
void
prefwin_init_hotkeys (GtkWidget *_prefwin) {
+ DB_plugin_t *hkplug = deadbeef->plug_get_for_id ("hotkeys");
+ if (!hkplug) {
+ // remove hotkeys tab
+ gtk_notebook_remove_page (GTK_NOTEBOOK (lookup_widget (_prefwin, "notebook")), 6);
+ return;
+ }
+
gtkui_hotkeys_changed = 0;
ctx_names[DDB_ACTION_CTX_MAIN] = _("Main");
ctx_names[DDB_ACTION_CTX_SELECTION] = _("Selection");
diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c
index 850de341..6034feef 100644
--- a/plugins/gtkui/prefwin.c
+++ b/plugins/gtkui/prefwin.c
@@ -333,10 +333,6 @@ gtkui_run_preferences_dlg (void) {
gtk_widget_set_sensitive (lookup_widget (prefwin, "configure_plugin"), FALSE);
// hotkeys
-// DB_plugin_t *hotkeys = deadbeef->plug_get_for_id ("hotkeys");
-// if (hotkeys) {
-// prefwin_add_hotkeys_tab (prefwin);
-// }
prefwin_init_hotkeys (prefwin);
deadbeef->conf_unlock ();