[gnome-system-monitor] Fold do_popup_menu into proctable



commit 9d2d2b6f1d4ba685f3354a96056792e331737a8b
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Mon Aug 5 18:13:10 2013 +0200

    Fold do_popup_menu into proctable

 src/interface.cpp |   19 -------------------
 src/interface.h   |    1 -
 src/proctable.cpp |    8 ++++++--
 3 files changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/src/interface.cpp b/src/interface.cpp
index 98729c0..1439bb4 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -697,25 +697,6 @@ create_main_window (ProcmanApp *app)
 }
 
 void
-do_popup_menu (ProcmanApp *app, GdkEventButton *event)
-{
-    guint button;
-    guint32 event_time;
-
-    if (event) {
-        button = event->button;
-        event_time = event->time;
-    }
-    else {
-        button = 0;
-        event_time = gtk_get_current_event_time ();
-    }
-
-    gtk_menu_popup (GTK_MENU (app->popup_menu), NULL, NULL,
-                    NULL, NULL, button, event_time);
-}
-
-void
 update_sensitivity(ProcmanApp *app)
 {
     const char * const selected_actions[] = { "send-signal-stop",
diff --git a/src/interface.h b/src/interface.h
index 8966b1d..b97ad84 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -27,6 +27,5 @@
 
 void            create_main_window (ProcmanApp *app);
 void            update_sensitivity (ProcmanApp *app);
-void            do_popup_menu(ProcmanApp *app, GdkEventButton *event);
 
 #endif /* _PROCMAN_INTERFACE_H_ */
diff --git a/src/proctable.cpp b/src/proctable.cpp
index 2490324..c5f542b 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -182,7 +182,9 @@ cb_tree_button_pressed (GtkWidget *widget, GdkEventButton *event, gpointer data)
     ProcmanApp *app = (ProcmanApp *) data;
 
     if (gdk_event_triggers_context_menu ((GdkEvent *) event)) {
-        do_popup_menu (app, event);
+        gtk_menu_popup (GTK_MENU (app->popup_menu),
+                        NULL, NULL, NULL, NULL,
+                        event->button, event->time);
         return TRUE;
     }
 
@@ -194,7 +196,9 @@ cb_tree_popup_menu (GtkWidget *widget, gpointer data)
 {
     ProcmanApp *app = (ProcmanApp *) data;
 
-    do_popup_menu (app, NULL);
+    gtk_menu_popup (GTK_MENU (app->popup_menu),
+                    NULL, NULL, NULL, NULL,
+                    0, gtk_get_current_event_time ());
 
     return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]