diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-09-06 14:42:20 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-09-06 14:42:20 +0200 |
commit | 6929a16a2eb615cd4efb67f43d3289f0916614b5 (patch) | |
tree | 8b143f779ce8a5e0cefbd1b3f86b73157025d9c6 | |
parent | ea367e0df1a3ecfb6c59cd4285998e88db98c26c (diff) |
added config option to control close(X) button behaviour
-rw-r--r-- | callbacks.c | 10 | ||||
-rw-r--r-- | conf.c | 4 | ||||
-rw-r--r-- | conf.h | 1 | ||||
-rw-r--r-- | config-example | 4 | ||||
-rw-r--r-- | 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; } @@ -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); } @@ -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 <hr/> <p><a href="http://sourceforge.net/">Project Web Hosted by<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=272657&type=3" alt="SourceForge.net"/></a></p> +<script type="text/javascript"> +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +</script> +<script type="text/javascript"> +try { +var pageTracker = _gat._getTracker("UA-3180744-2"); +pageTracker._trackPageview(); +} catch(err) {}</script> </body> |