diff options
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/gsm_color_button.c | 2 | ||||
-rw-r--r-- | src/gsm_color_button.h | 2 | ||||
-rw-r--r-- | src/mate-system-monitor.convert | 74 | ||||
-rw-r--r-- | src/org.mate.system-monitor.gschema.xml.in.in | 48 | ||||
-rw-r--r-- | src/procman.cpp | 29 |
6 files changed, 150 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 69535c3..8dd903c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -58,6 +58,9 @@ gsettings_SCHEMAS = org.mate.system-monitor.gschema.xml %.gschema.xml.in: %.gschema.xml.in.in Makefile $(AM_V_GEN) $(SED) -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@ +convertdir = $(datadir)/MateConf/gsettings +dist_convert_DATA = mate-system-monitor.convert + dist_noinst_DATA = \ $(gsettings_in_file) diff --git a/src/gsm_color_button.c b/src/gsm_color_button.c index e8eb320..0d69889 100644 --- a/src/gsm_color_button.c +++ b/src/gsm_color_button.c @@ -251,7 +251,7 @@ fill_image_buffer_from_file (cairo_t *cr, const char *filePath) tmp_cr = cairo_create (tmp_surface); rsvg_handle_render_cairo (handle, tmp_cr); cairo_destroy (tmp_cr); - rsvg_handle_free (handle); + g_object_unref (handle); return tmp_surface; } diff --git a/src/gsm_color_button.h b/src/gsm_color_button.h index ac8d87e..0194887 100644 --- a/src/gsm_color_button.h +++ b/src/gsm_color_button.h @@ -27,7 +27,9 @@ #include <gtk/gtk.h> #include <cairo.h> #include <librsvg/rsvg.h> +#ifndef RSVG_CAIRO_H #include <librsvg/rsvg-cairo.h> +#endif G_BEGIN_DECLS /* The GtkColorSelectionButton widget is a simple color picker in a button. diff --git a/src/mate-system-monitor.convert b/src/mate-system-monitor.convert new file mode 100644 index 0000000..f3011cc --- /dev/null +++ b/src/mate-system-monitor.convert @@ -0,0 +1,74 @@ +[org.mate.system-monitor] +width = /apps/procman/width +height = /apps/procman/height +show-tree = /apps/procman/show_tree +solaris-mode = /apps/procman/solaris_mode +smooth-refresh = /apps/procman/smooth_refresh +kill-dialog = /apps/procman/kill_dialog +update-interval = /apps/procman/update_interval +graph-update-interval = /apps/procman/graph_update_interval +show-all-fs = /apps/procman/show_all_fs +disks-interval = /apps/procman/disks_interval +view-as = /apps/procman/view_as +current-tab = /apps/procman/current_tab +cpu-color0 = /apps/procman/cpu_color0 +cpu-color1 = /apps/procman/cpu_color1 +cpu-color2 = /apps/procman/cpu_color2 +cpu-color3 = /apps/procman/cpu_color3 +mem-color = /apps/procman/mem_color +swap-color = /apps/procman/swap_color +net-in-color = /apps/procman/net_in_color +net-out-color = /apps/procman/net_out_color +network-in-bits = /apps/procman/network_in_bits + +[org.mate.system-monitor.proctree] +sort-col = /apps/procman/proctree/sort_col +columns-order = /apps/procman/proctree/columns_order +sort-order = /apps/procman/proctree/sort_order +col-0-width = /apps/procman/proctree/col_0_width +col-0-visible = /apps/procman/proctree/col_0_visible +col-1-width = /apps/procman/proctree/col_1_width +col-1-visible = /apps/procman/proctree/col_1_visible +col-2-width = /apps/procman/proctree/col_2_width +col-2-visible = /apps/procman/proctree/col_2_visible +col-3-width = /apps/procman/proctree/col_3_width +col-3-visible = /apps/procman/proctree/col_3_visible +col-4-width = /apps/procman/proctree/col_4_width +col-4-visible = /apps/procman/proctree/col_4_visible +col-5-width = /apps/procman/proctree/col_5_width +col-5-visible = /apps/procman/proctree/col_5_visible +col-6-width = /apps/procman/proctree/col_6_width +col-6-visible = /apps/procman/proctree/col_6_visible +col-7-width = /apps/procman/proctree/col_7_width +col-7-visible = /apps/procman/proctree/col_7_visible +col-8-width = /apps/procman/proctree/col_8_width +col-8-visible = /apps/procman/proctree/col_8_visible +col-9-width = /apps/procman/proctree/col_9_width +col-9-visible = /apps/procman/proctree/col_9_visible +col-10-width = /apps/procman/proctree/col_10_width +col-10-visible = /apps/procman/proctree/col_10_visible +col-11-width = /apps/procman/proctree/col_11_width +col-11-visible = /apps/procman/proctree/col_11_visible +col-12-width = /apps/procman/proctree/col_12_width +col-12-visible = /apps/procman/proctree/col_12_visible +col-13-width = /apps/procman/proctree/col_13_width +col-13-visible = /apps/procman/proctree/col_13_visible +col-14-width = /apps/procman/proctree/col_14_width +col-14-visible = /apps/procman/proctree/col_14_visible +col-15-width = /apps/procman/proctree/col_15_width +col-15-visible = /apps/procman/proctree/col_15_visible +col-16-width = /apps/procman/proctree/col_16_width +col-16-visible = /apps/procman/proctree/col_16_visible + +[org.mate.system-monitor.disktreenew] +sort-col = /apps/procman/disktreenew/sort_col +sort-order = /apps/procman/disktreenew/sort_order +columns-order = /apps/procman/disktreenew/columns_order + +[org.mate.system-monitor.memmapstree] +sort-col = /apps/procman/memmapstree/sort_col +sort-order = /apps/procman/memmapstree/sort_order + +[org.mate.system-monitor.openfilestree] +sort-col = /apps/procman/openfilestree/sort_col +sort-order = /apps/procman/openfilestree/sort_order diff --git a/src/org.mate.system-monitor.gschema.xml.in.in b/src/org.mate.system-monitor.gschema.xml.in.in index 3caadc7..008432a 100644 --- a/src/org.mate.system-monitor.gschema.xml.in.in +++ b/src/org.mate.system-monitor.gschema.xml.in.in @@ -68,6 +68,54 @@ <default>'#2D7DB3'</default> <_summary>Default graph cpu color</_summary> </key> + <key name="cpu-color4" type="s"> + <default>'#FF6600'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color5" type="s"> + <default>'#6600CC'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color6" type="s"> + <default>'#990000'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color7" type="s"> + <default>'#000099'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color8" type="s"> + <default>'#FFCC00'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color9" type="s"> + <default>'#009900'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color10" type="s"> + <default>'#CC6600'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color11" type="s"> + <default>'#330099'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color12" type="s"> + <default>'#CC0066'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color13" type="s"> + <default>'#00FFCC'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color14" type="s"> + <default>'#FFCC99'</default> + <_summary>Default graph cpu color</_summary> + </key> + <key name="cpu-color15" type="s"> + <default>'#339999'</default> + <_summary>Default graph cpu color</_summary> + </key> <key name="mem-color" type="s"> <default>'#AB1852'</default> <_summary>Default graph mem color</_summary> diff --git a/src/procman.cpp b/src/procman.cpp index 9c683ef..dc0c9ea 100644 --- a/src/procman.cpp +++ b/src/procman.cpp @@ -66,6 +66,18 @@ ProcData* ProcData::get_instance() return &instance; } +static gboolean +has_key (gchar **keys, const gchar *key) +{ + gchar **loop = keys; + + while (*loop) { + if (!strcmp (*loop++, key)) + return TRUE; + } + + return FALSE; +} static void tree_changed_cb (GSettings *settings, const gchar *key, gpointer data) @@ -177,7 +189,15 @@ static void color_changed_cb (GSettings *settings, const gchar *key, gpointer data) { ProcData * const procdata = static_cast<ProcData*>(data); - const gchar *color = g_settings_get_string (settings, key); + gchar **keys; + gchar *color = NULL; + + keys = g_settings_list_keys (settings); + if (has_key (keys, key)) + color = g_settings_get_string (settings, key); + else + color = g_strdup("#000000"); /* black default color */ + g_strfreev (keys); if (g_str_has_prefix (key, "cpu-color")) { for (int i = 0; i < procdata->config.num_cpus; i++) { @@ -701,8 +721,7 @@ main (int argc, char *argv[]) exit (0); } - /* initialize rsvg */ - rsvg_init (); + g_type_init (); gtk_window_set_default_icon_name ("utilities-system-monitor"); g_set_application_name(_("System Monitor")); @@ -741,10 +760,6 @@ main (int argc, char *argv[]) glibtop_close (); - // This function should only be called just before program exit. - // See MATE bug #592100 for a discussion about this. - rsvg_term (); - return 0; } |