client: Add calls to save and redraw input prompt
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 27 Mar 2013 11:53:55 +0000 (13:53 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 4 Apr 2013 07:25:27 +0000 (10:25 +0300)
client/commands.c
client/dbus_helpers.c

index 6e124f9..6e2680b 100644 (file)
@@ -38,9 +38,9 @@
 #include "technology.h"
 #include "data_manager.h"
 
-#include "commands.h"
 #include "dbus_helpers.h"
 #include "input.h"
+#include "commands.h"
 
 #define MANDATORY_ARGS 3
 
@@ -404,6 +404,8 @@ static DBusHandlerResult monitor_changed(DBusConnection *connection,
        if (path != NULL && *path != '\0')
                path++;
 
+       __connmanctl_save_rl();
+
        if (dbus_message_is_signal(message, "net.connman.Manager",
                                        "ServicesChanged") == TRUE) {
 
@@ -432,6 +434,8 @@ static DBusHandlerResult monitor_changed(DBusConnection *connection,
        __connmanctl_dbus_print(&iter, "", " = ", " = ");
        fprintf(stdout, "\n");
 
+       __connmanctl_redraw_rl();
+
        return DBUS_HANDLER_RESULT_HANDLED;
 }
 
index 816da73..ccdf695 100644 (file)
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <glib.h>
 
+#include "input.h"
 #include "dbus_helpers.h"
 
 #define TIMEOUT         60000
@@ -129,6 +130,8 @@ static void dbus_method_reply(DBusPendingCall *call, void *user_data)
        DBusMessage *reply;
        DBusMessageIter iter;
 
+       __connmanctl_save_rl();
+
        reply = dbus_pending_call_steal_reply(call);
        if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
                DBusError err;
@@ -146,6 +149,10 @@ static void dbus_method_reply(DBusPendingCall *call, void *user_data)
        callback->cb(&iter, NULL, callback->user_data);
 
 end:
+       __connmanctl_redraw_rl();
+       if (__connmanctl_is_interactive() == false)
+               __connmanctl_quit();
+
        g_free(callback);
        dbus_message_unref(reply);
 }