From 6929a16a2eb615cd4efb67f43d3289f0916614b5 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sun, 6 Sep 2009 14:42:20 +0200 Subject: added config option to control close(X) button behaviour --- callbacks.c | 10 +++++++--- conf.c | 4 ++++ conf.h | 1 + config-example | 4 ++++ web/index.html | 9 +++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/callbacks.c b/callbacks.c index 51f82d8b..bafaa7c8 100644 --- a/callbacks.c +++ b/callbacks.c @@ -44,6 +44,7 @@ #include "progress.h" #include "volume.h" #include "session.h" +#include "conf.h" #include "plugins.h" @@ -1145,9 +1146,12 @@ on_mainwin_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) { -// messagepump_push (M_TERMINATE, 0, 0, 0); - - gtk_widget_hide (widget); + if (conf_close_send_to_tray) { + gtk_widget_hide (widget); + } + else { + messagepump_push (M_TERMINATE, 0, 0, 0); + } return TRUE; } diff --git a/conf.c b/conf.c index bd28f2ec..ff841c98 100644 --- a/conf.c +++ b/conf.c @@ -26,6 +26,7 @@ int conf_src_quality = 1; char conf_hvsc_path[1024] = ""; int conf_hvsc_enable = 0; char conf_blacklist_plugins[1024]; // plugins listed in this option will not be loaded +int conf_close_send_to_tray = 0; int conf_load (void) { @@ -89,6 +90,9 @@ conf_load (void) { strncpy (conf_blacklist_plugins, value, sizeof (conf_blacklist_plugins)); conf_blacklist_plugins[sizeof (conf_blacklist_plugins)-1] = 0; } + else if (!strcasecmp (str, "close_send_to_tray")) { + conf_close_send_to_tray = atoi (value); + } else { fprintf (stderr, "error in config file line %d\n", line); } diff --git a/conf.h b/conf.h index b393e46b..39f41e3f 100644 --- a/conf.h +++ b/conf.h @@ -24,6 +24,7 @@ extern int conf_src_quality; extern char conf_hvsc_path[1024]; extern int conf_hvsc_enable; extern char conf_blacklist_plugins[1024]; +extern int conf_close_send_to_tray; int conf_load (void); diff --git a/config-example b/config-example index 04549e21..7a5bf47e 100644 --- a/config-example +++ b/config-example @@ -25,6 +25,10 @@ samplerate 48000 # http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=9772&view=findpost&p=98252 src_quality 2 +# default behaviour of close(X) button is to close player +# this option allows to minimize to tray instead +#close_send_to_tray 1 + # those next 2 are disabled by default, cause most people probably don't have HVSC # in case you don't know what HVSC is - keep disabled #hvsc_path /home/waker/hvsc/C64Music/DOCUMENTS/Songlengths.txt diff --git a/web/index.html b/web/index.html index 5f3ee46d..afad6bca 100644 --- a/web/index.html +++ b/web/index.html @@ -149,4 +149,13 @@ implemented basic session management, window size/position, volume, playmode are

Project Web Hosted bySourceForge.net

+ + -- cgit v1.2.3