diff src/scrobbler/configure.c @ 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 224727e6c73d
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);