[gnome-system-monitor] Move column header clicked callback to procman-app.cpp
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Move column header clicked callback to procman-app.cpp
- Date: Wed, 24 Jul 2013 19:53:28 +0000 (UTC)
commit fc83d696c08937067a810d9ad82e149eae2d7aa5
Author: Stefano Facchini <stefano facchini gmail com>
Date: Wed Jul 24 13:43:11 2013 +0200
Move column header clicked callback to procman-app.cpp
For now it seems the best place, since it is called there
https://bugzilla.gnome.org/show_bug.cgi?id=704800
src/callbacks.cpp | 28 ----------------------------
src/callbacks.h | 4 ----
src/procman-app.cpp | 26 ++++++++++++++++++++++++++
3 files changed, 26 insertions(+), 32 deletions(-)
---
diff --git a/src/callbacks.cpp b/src/callbacks.cpp
index 60667c9..6c767bd 100644
--- a/src/callbacks.cpp
+++ b/src/callbacks.cpp
@@ -78,31 +78,3 @@ cb_column_resized(GtkWidget *widget, GParamSpec* param, gpointer data)
}
g_free (key);
}
-
-
-static void
-cb_header_menu_position_function(GtkMenu* menu, gint *x, gint *y, gboolean *push_in, gpointer data)
-{
- GdkEventButton* event = static_cast<GdkEventButton*>(data);
- gint wx, wy, ww, wh;
- gdk_window_get_geometry(event->window, &wx, &wy, &ww, &wh);
- gdk_window_get_origin(event->window, &wx, &wy);
-
- *x = wx + event->x;
- *y = wy + wh;
- *push_in = TRUE;
-}
-
-gboolean
-cb_column_header_clicked (GtkTreeViewColumn* column, GdkEvent* event, gpointer data)
-{
- GtkMenu *menu = static_cast<GtkMenu*>(data);
- if (event->button.button == GDK_BUTTON_SECONDARY) {
- gtk_menu_popup(GTK_MENU(menu), NULL, NULL, cb_header_menu_position_function, &(event->button),
event->button.button, event->button.time);
- return TRUE;
- }
-
- return FALSE;
-
-}
-
diff --git a/src/callbacks.h b/src/callbacks.h
index 6ad43c2..7d16344 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -28,8 +28,4 @@ gint cb_timeout (gpointer data);
void cb_column_resized (GtkWidget* column, GParamSpec* param, gpointer data);
-gboolean cb_column_header_clicked (GtkTreeViewColumn* column,
- GdkEvent* event,
- gpointer data);
-
#endif /* _PROCMAN_CALLBACKS_H_ */
diff --git a/src/procman-app.cpp b/src/procman-app.cpp
index 25c2e6b..b2e0354 100644
--- a/src/procman-app.cpp
+++ b/src/procman-app.cpp
@@ -354,6 +354,32 @@ void ProcmanApp::on_activate()
gtk_window_present (GTK_WINDOW (main_window));
}
+static void
+cb_header_menu_position_function (GtkMenu* menu, gint *x, gint *y, gboolean *push_in, gpointer data)
+{
+ GdkEventButton* event = (GdkEventButton *) data;
+ gint wx, wy, ww, wh;
+ gdk_window_get_geometry(event->window, &wx, &wy, &ww, &wh);
+ gdk_window_get_origin(event->window, &wx, &wy);
+
+ *x = wx + event->x;
+ *y = wy + wh;
+ *push_in = TRUE;
+}
+
+static gboolean
+cb_column_header_clicked (GtkTreeViewColumn* column, GdkEvent* event, gpointer data)
+{
+ GtkMenu *menu = (GtkMenu *) data;
+
+ if (event->button.button == GDK_BUTTON_SECONDARY) {
+ gtk_menu_popup(GTK_MENU(menu), NULL, NULL, cb_header_menu_position_function, &(event->button),
event->button.button, event->button.time);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
gboolean
procman_get_tree_state (GSettings *settings, GtkWidget *tree, const gchar *child_schema)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]