88 lines
3.0 KiB
Diff
88 lines
3.0 KiB
Diff
diff -up gnome-system-monitor-2.22.0/src/procman.h.system-tab-arg gnome-system-monitor-2.22.0/src/procman.h
|
|
--- gnome-system-monitor-2.22.0/src/procman.h.system-tab-arg 2008-04-01 17:09:29.000000000 -0400
|
|
+++ gnome-system-monitor-2.22.0/src/procman.h 2008-04-01 17:09:29.000000000 -0400
|
|
@@ -58,6 +58,7 @@ enum
|
|
static const unsigned MIN_UPDATE_INTERVAL = 1 * 1000;
|
|
static const unsigned MAX_UPDATE_INTERVAL = 100 * 1000;
|
|
|
|
+#define SHOW_SYSTEM_TAB_CMD "SHOWSYSTAB" /* elegant, eh */
|
|
|
|
enum ProcmanTab
|
|
{
|
|
diff -up gnome-system-monitor-2.22.0/src/procman.cpp.system-tab-arg gnome-system-monitor-2.22.0/src/procman.cpp
|
|
--- gnome-system-monitor-2.22.0/src/procman.cpp.system-tab-arg 2008-04-01 17:09:29.000000000 -0400
|
|
+++ gnome-system-monitor-2.22.0/src/procman.cpp 2008-04-01 17:10:20.000000000 -0400
|
|
@@ -626,14 +626,19 @@ cb_server (const gchar *msg, gpointer us
|
|
{
|
|
GdkWindow *window;
|
|
ProcData *procdata;
|
|
- guint32 timestamp;
|
|
+ guint32 timestamp = 0;
|
|
|
|
window = gdk_get_default_root_window ();
|
|
|
|
procdata = *(ProcData**)user_data;
|
|
g_assert (procdata != NULL);
|
|
|
|
- timestamp = strtoul(msg, NULL, 0);
|
|
+ procman_debug("cb_server(%s)", msg);
|
|
+ if (msg != NULL && strcmp(SHOW_SYSTEM_TAB_CMD, msg) == 0) {
|
|
+ procman_debug("Changing to PROCMAN_TAB_SYSINFO via bacon message");
|
|
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(procdata->notebook), PROCMAN_TAB_SYSINFO);
|
|
+ } else
|
|
+ timestamp = strtoul(msg, NULL, 0);
|
|
|
|
if (timestamp == 0)
|
|
{
|
|
@@ -669,12 +674,28 @@ main (int argc, char *argv[])
|
|
ProcData *procdata;
|
|
BaconMessageConnection *conn;
|
|
|
|
+ /* Parse commandline arguments */
|
|
+ GError *error = NULL;
|
|
+ GOptionContext *context;
|
|
+ static gboolean show_system_tab = FALSE;
|
|
+ static GOptionEntry entries[] =
|
|
+ {
|
|
+ { "show-system-tab", 's', 0, G_OPTION_ARG_NONE, &show_system_tab, "Show the System tab", NULL },
|
|
+ { NULL }
|
|
+ };
|
|
+
|
|
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
textdomain (GETTEXT_PACKAGE);
|
|
|
|
startup_timestamp = get_startup_timestamp();
|
|
|
|
+ context = g_option_context_new("- a simple process and system monitor.");
|
|
+ g_option_context_set_ignore_unknown_options(context, TRUE);
|
|
+ g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE);
|
|
+ g_option_context_parse(context, &argc, &argv, &error);
|
|
+ g_option_context_free(context);
|
|
+
|
|
Gtk::Main kit(&argc, &argv);
|
|
procman_debug("post gtk_init");
|
|
|
|
@@ -691,6 +712,9 @@ main (int argc, char *argv[])
|
|
|
|
timestamp = g_strdup_printf ("%" G_GUINT32_FORMAT, startup_timestamp);
|
|
|
|
+ if (show_system_tab)
|
|
+ bacon_message_connection_send(conn, SHOW_SYSTEM_TAB_CMD);
|
|
+
|
|
bacon_message_connection_send (conn, timestamp);
|
|
|
|
gdk_notify_startup_complete ();
|
|
@@ -727,6 +751,11 @@ main (int argc, char *argv[])
|
|
|
|
g_assert(procdata->app);
|
|
|
|
+ if (show_system_tab) {
|
|
+ procman_debug("Starting with PROCMAN_TAB_SYSINFO by commandline request");
|
|
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(procdata->notebook), PROCMAN_TAB_SYSINFO);
|
|
+ }
|
|
+
|
|
gtk_widget_show(procdata->app);
|
|
|
|
procman_debug("begin gtk_main");
|