Commit 9a19b8d8 authored by Benoît Dejean's avatar Benoît Dejean Committed by Benoît Dejean
Browse files

Added a configure switch for Irix/Solaris mode. Closes #410795.

2007-04-24  Benoît Dejean  <benoit@placenet.org>

	* configure.in:
	* src/Makefile.am:
	* src/gconf-keys.cpp:
	* src/gconf-keys.h:
	* src/gnome-system-monitor.schemas.in:
	* src/procdialogs.cpp:
	* src/procman.cpp:
	* src/procman.h:
	* src/proctable.cpp:

	Added a configure switch for Irix/Solaris mode.
	Closes #410795.

svn path=/trunk/; revision=2012
parent 67753a43
2007-04-24 Benoît Dejean <benoit@placenet.org>
* configure.in:
* src/Makefile.am:
* src/gconf-keys.cpp:
* src/gconf-keys.h:
* src/gnome-system-monitor.schemas.in:
* src/procdialogs.cpp:
* src/procman.cpp:
* src/procman.h:
* src/proctable.cpp:
Added a configure switch for Irix/Solaris mode.
Closes #410795.
2007-04-23 Benoît Dejean <benoit@placenet.org>
* NEWS:
......
......@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
AC_INIT([gnome-system-monitor], [2.19.1],
AC_INIT([gnome-system-monitor], [2.19.2],
[http://bugzilla.gnome.org/enter_bug.cgi?product=system-monitor])
AC_CONFIG_SRCDIR(configure.in)
AC_CONFIG_HEADERS(config.h)
......
......@@ -28,6 +28,7 @@ gnome_system_monitor_SOURCES = \
procman_gksu.h procman_gksu.cpp \
sysinfo.cpp sysinfo.h \
lsof.cpp lsof.h \
gconf-keys.cpp gconf-keys.h \
e_date.c e_date.h
......
#include "gconf-keys.h"
namespace procman
{
namespace gconf
{
const std::string root("/apps/procman");
const std::string solaris_mode(root + "/solaris_mode");
}
}
#ifndef H_PROCMAN_GCONF_KEYS_1177430397
#define H_PROCMAN_GCONF_KEYS_1177430397
#include <string>
namespace procman
{
namespace gconf
{
extern const std::string root;
extern const std::string solaris_mode;
}
}
#endif // H_PROCMAN_GCONF_KEYS_1177430397
......@@ -36,6 +36,18 @@
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/procman/solaris_mode</key>
<applyto>/apps/procman/solaris_mode</applyto>
<owner>procman</owner>
<type>bool</type>
<default>FALSE</default>
<locale name="C">
<short>Solaris mode for CPU percentage</short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/procman/smooth_refresh</key>
......
......@@ -31,7 +31,7 @@
#include "procactions.h"
#include "util.h"
#include "load-graph.h"
#include "gconf-keys.h"
#include "procman_gnomesu.h"
#include "procman_gksu.h"
......@@ -271,6 +271,19 @@ show_kill_dialog_toggled (GtkToggleButton *button, gpointer data)
}
static void
solaris_mode_toggled(GtkToggleButton *button, gpointer data)
{
ProcData *procdata = static_cast<ProcData*>(data);
GConfClient *client = procdata->client;
gboolean toggled;
toggled = gtk_toggle_button_get_active(button);
gconf_client_set_bool(client, procman::gconf::solaris_mode.c_str(), toggled, NULL);
}
static void
smooth_refresh_toggled(GtkToggleButton *button, gpointer data)
{
......@@ -570,6 +583,25 @@ procdialog_create_preferences_dialog (ProcData *procdata)
G_CALLBACK (show_kill_dialog_toggled), procdata);
gtk_box_pack_start (GTK_BOX (hbox2), check_button, FALSE, FALSE, 0);
hbox2 = gtk_hbox_new(FALSE, 6);
gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 0);
GtkWidget *solaris_button;
solaris_button = gtk_check_button_new_with_mnemonic(_("Solaris Mode"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(solaris_button),
gconf_client_get_bool(procdata->client,
procman::gconf::solaris_mode.c_str(),
NULL));
g_signal_connect(G_OBJECT(solaris_button), "toggled",
G_CALLBACK(solaris_mode_toggled), procdata);
gtk_box_pack_start(GTK_BOX(hbox2), solaris_button, TRUE, TRUE, 0);
hbox2 = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
......
......@@ -40,7 +40,7 @@
#include "callbacks.h"
#include "smooth_refresh.h"
#include "util.h"
#include "gconf-keys.h"
ProcData* ProcData::get_instance()
{
......@@ -61,6 +61,18 @@ tree_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data
}
static void
solaris_mode_changed_cb(GConfClient *client, guint id, GConfEntry *entry, gpointer data)
{
ProcData *procdata = static_cast<ProcData*>(data);
GConfValue *value = gconf_entry_get_value (entry);
procdata->config.solaris_mode = gconf_value_get_bool(value);
proctable_update_all (procdata);
}
static void
view_as_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
{
......@@ -241,6 +253,11 @@ procman_data_new (GConfClient *client)
pd->config.show_tree = gconf_client_get_bool (client, "/apps/procman/show_tree", NULL);
gconf_client_notify_add (client, "/apps/procman/show_tree", tree_changed_cb,
pd, NULL, NULL);
pd->config.solaris_mode = gconf_client_get_bool(client, procman::gconf::solaris_mode.c_str(), NULL);
gconf_client_notify_add(client, procman::gconf::solaris_mode.c_str(), solaris_mode_changed_cb, pd, NULL, NULL);
pd->config.show_kill_warning = gconf_client_get_bool (client, "/apps/procman/kill_dialog",
NULL);
gconf_client_notify_add (client, "/apps/procman/kill_dialog", warning_changed_cb,
......
......@@ -82,6 +82,7 @@ struct _ProcConfig
GdkColor bg_color;
GdkColor frame_color;
gint num_cpus;
bool solaris_mode;
};
......
......@@ -797,6 +797,9 @@ update_info (ProcData *procdata, ProcInfo *info)
info->pcpu = (proctime.rtime - info->cpu_time_last) * 100 / total_time;
info->pcpu = MIN(info->pcpu, 100);
if (procdata->config.solaris_mode)
info->pcpu /= procdata->config.num_cpus;
info->cpu_time_last = proctime.rtime;
info->nice = procuid.nice;
info->ppid = procuid.ppid;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment