[gnome-system-monitor] Move the callbacks used only once from callbacks to procman-app
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Move the callbacks used only once from callbacks to procman-app
- Date: Tue, 23 Jul 2013 21:11:13 +0000 (UTC)
commit 1a94a7a500012a28b106e6afef6551b1e44f27a6
Author: Robert Roth <robert roth off gmail com>
Date: Wed Jul 24 00:10:26 2013 +0300
Move the callbacks used only once from callbacks to procman-app
src/callbacks.cpp | 29 -----------------------------
src/callbacks.h | 7 -------
src/procman-app.cpp | 12 +++++++++---
3 files changed, 9 insertions(+), 39 deletions(-)
---
diff --git a/src/callbacks.cpp b/src/callbacks.cpp
index 534a11e..5967531 100644
--- a/src/callbacks.cpp
+++ b/src/callbacks.cpp
@@ -37,23 +37,6 @@
#include "lsof.h"
void
-cb_edit_preferences (GtkAction *action, gpointer data)
-{
- ProcmanApp *app = static_cast<ProcmanApp *>(data);
-
- procdialog_create_preferences_dialog (app);
-}
-
-
-void
-cb_show_lsof(GtkAction *action, gpointer data)
-{
- ProcmanApp *app = static_cast<ProcmanApp *>(data);
- procman_lsof(app);
-}
-
-
-void
cb_about (GtkAction *action, gpointer data)
{
ProcmanApp *app = static_cast<ProcmanApp *>(data);
@@ -101,18 +84,6 @@ cb_about (GtkAction *action, gpointer data)
);
}
-
-void
-cb_help_contents (GtkAction *action, gpointer data)
-{
- GError* error = 0;
- if (!g_app_info_launch_default_for_uri("help:gnome-system-monitor", NULL, &error)) {
- g_warning("Could not display help : %s", error->message);
- g_error_free(error);
- }
-}
-
-
gboolean
cb_main_window_delete (GtkWidget *window, GdkEvent *event, gpointer data)
{
diff --git a/src/callbacks.h b/src/callbacks.h
index 2d57ed1..bd8df1b 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -24,17 +24,10 @@
#include <gtk/gtk.h>
#include "gsm_color_button.h"
-
-void cb_show_lsof(GtkAction *action, gpointer data);
-void cb_edit_preferences (GtkAction *action, gpointer data);
-
-void cb_help_contents (GtkAction *action, gpointer data);
void cb_about (GtkAction *action, gpointer data);
gboolean cb_main_window_delete (GtkWidget *window, GdkEvent *event, gpointer data);
-void cb_info_button_pressed (GtkButton *button, gpointer user_data);
-
void cb_cpu_color_changed (GSMColorButton *widget, gpointer user_data);
void cb_mem_color_changed (GSMColorButton *widget, gpointer user_data);
void cb_swap_color_changed (GSMColorButton *widget, gpointer user_data);
diff --git a/src/procman-app.cpp b/src/procman-app.cpp
index f69f71d..25c2e6b 100644
--- a/src/procman-app.cpp
+++ b/src/procman-app.cpp
@@ -5,6 +5,7 @@
#include <glibtop/close.h>
#include "procman-app.h"
+#include "procdialogs.h"
#include "interface.h"
#include "proctable.h"
#include "callbacks.h"
@@ -13,6 +14,7 @@
#include "argv.h"
#include "util.h"
#include "cgroups.h"
+#include "lsof.h"
static void
mount_changed(const Glib::RefPtr<Gio::Mount>&, ProcmanApp *app)
@@ -575,19 +577,23 @@ int ProcmanApp::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine>&
void
ProcmanApp::on_help_activate(const Glib::VariantBase&)
{
- cb_help_contents (NULL, this);
+ GError* error = 0;
+ if (!g_app_info_launch_default_for_uri("help:gnome-system-monitor", NULL, &error)) {
+ g_warning("Could not display help : %s", error->message);
+ g_error_free(error);
+ }
}
void
ProcmanApp::on_lsof_activate(const Glib::VariantBase&)
{
- cb_show_lsof (NULL, this);
+ procman_lsof(this);
}
void
ProcmanApp::on_preferences_activate(const Glib::VariantBase&)
{
- cb_edit_preferences (NULL, this);
+ procdialog_create_preferences_dialog (this);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]