changeset 2319:146381a317df

stop plugin when user starts to type new details into configuration window, and start it when he finishes
author Tomasz Mon <desowin@gmail.com>
date Tue, 15 Jan 2008 20:35:07 +0100
parents d7c321957be8
children 15aa13c91259
files src/scrobbler/configure.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/scrobbler/configure.c	Tue Jan 15 20:26:27 2008 +0100
+++ b/src/scrobbler/configure.c	Tue Jan 15 20:35:07 2008 +0100
@@ -25,6 +25,7 @@
 
 GtkWidget *entry1, *entry2, *ge_entry1, *ge_entry2, *cfgdlg;
 guint apply_timeout = 0; /* ID of timeout to save new config */
+gboolean running = TRUE; /* if plugin threads are running */
 
 static char *hexify(char *pass, int len)
 {
@@ -82,14 +83,19 @@
         }
 
     apply_timeout = 0;
-    stop();
     start();
+    running = TRUE;
     return FALSE;
 }
 
 static void
 entry_changed(GtkWidget *widget, gpointer data)
 {
+    if (running) {
+        stop();
+        running = FALSE;
+    }
+
     if (apply_timeout)
         g_source_remove(apply_timeout);