summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-12 11:25:27 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-12 11:25:27 +0000
commit03f0d32dee2e717ac3cf1fa1ca1563110403934e (patch)
tree4ba8c706f5f4c4a74bb35187c757bdb73c1c1b67 /src
parent42eddac0e9f0216175fef223fd9b1023ed502a6e (diff)
introduce a 0.35 second sleep between acknowledgement of an interactive action and requesting a full update. Transmission seems to have a small lag before a pause takes effect.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/trg-main-window.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index aef0496..ecb6b3b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,7 +23,7 @@ schemadir = @GCONF_SCHEMA_FILE_DIR@
schema_DATA = transmission-remote-gtk.schemas
bin_PROGRAMS = transmission-remote-gtk
-INCLUDES = --pedantic -Wall -I.. -O2 -DTRGLICENSE=\""$(trglicense)"\" -DTRGLOCALEDIR=\""$(trglocaledir)"\" $(jsonglib_CFLAGS) $(gthread_CFLAGS) $(gtk_CFLAGS) $(gconf_CFLAGS) $(gio_CFLAGS) $(unique_CFLAGS) $(notify_CFLAGS) -std=c99
+INCLUDES = --pedantic -Wall -I.. -O2 -DTRGLICENSE=\""$(trglicense)"\" -DTRGLOCALEDIR=\""$(trglocaledir)"\" $(jsonglib_CFLAGS) $(gthread_CFLAGS) $(gtk_CFLAGS) $(gconf_CFLAGS) $(gio_CFLAGS) $(unique_CFLAGS) $(notify_CFLAGS)
transmission_remote_gtk_SOURCES = main.c \
requests.c \
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index b1c78d8..52b5bc5 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <glib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
@@ -1157,9 +1158,15 @@ on_generic_interactive_action(JsonObject * response, int status,
trg_dialog_error_handler(TRG_MAIN_WINDOW(data), response, status);
gdk_threads_leave();
- if (status == CURLE_OK || status == FAIL_RESPONSE_UNSUCCESSFUL)
+ if (status == CURLE_OK || status == FAIL_RESPONSE_UNSUCCESSFUL) {
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 350000000;
+ nanosleep(&ts, NULL);
+
dispatch_async(priv->client, torrent_get(FALSE),
on_torrent_get_interactive, data);
+ }
}
response_unref(response);