allow return to previous view with enter
authorJulien Desfossez <julien.desfossez@efficios.com>
Tue, 10 Apr 2012 21:09:31 +0000 (17:09 -0400)
committerJulien Desfossez <julien.desfossez@efficios.com>
Tue, 10 Apr 2012 21:09:31 +0000 (17:09 -0400)
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
src/cursesdisplay.c
src/cursesdisplay.h

index 3d8d4e40dbb17ab9d56447ca0c703d9c6c80a88b..7dfe7ad0937ac2164d530f8aed373573c0c6bfa9 100644 (file)
@@ -904,8 +904,12 @@ void *handle_keyboard(void *p)
                        break;
 
                case 13: /* FIXME : KEY_ENTER ?? */
-                       if (current_view == cpu) {
+                       if (current_view != process_details) {
+                               previous_view = current_view;
                                current_view = process_details;
+                       } else {
+                               current_view = previous_view;
+                               previous_view = process_details;
                        }
                        update_current_view();
                        break;
index 38e1996678d4422e449e8a53445875a7a664a631..9188659d430b410943add1ea3e1aef0a80bd1519 100644 (file)
 #include <ncurses.h>
 #include "common.h"
 
-enum current_view_list
+enum view_list
 {
        cpu = 1,
        perf,
        process_details,
        iostream,
        tree,
-} current_view;
+};
+
+enum view_list current_view;
+enum view_list previous_view;
 
 void display(unsigned int);
 void init_ncurses();
This page took 0.02422 seconds and 4 git commands to generate.