summaryrefslogtreecommitdiff
path: root/src/callbacks.cpp
diff options
context:
space:
mode:
authorraveit <[email protected]>2012-11-06 18:19:51 +0100
committerraveit <[email protected]>2012-11-06 18:19:51 +0100
commitf27253b155db8d3c06bf13801c63bdc282da4157 (patch)
treee8a449764975fe5066a67c9275ea73c56a88309b /src/callbacks.cpp
parent7caef9a314fc9f1fea996d79601d4242286825b1 (diff)
downloadmate-system-monitor-f27253b155db8d3c06bf13801c63bdc282da4157.tar.bz2
mate-system-monitor-f27253b155db8d3c06bf13801c63bdc282da4157.tar.xz
Port to gesettings
Diffstat (limited to 'src/callbacks.cpp')
-rw-r--r--src/callbacks.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/callbacks.cpp b/src/callbacks.cpp
index 36d5a81..192e939 100644
--- a/src/callbacks.cpp
+++ b/src/callbacks.cpp
@@ -218,7 +218,7 @@ cb_end_process_button_pressed (GtkButton *button, gpointer data)
}
-static void change_mateconf_color(MateConfClient *client, const char *key,
+static void change_settings_color(GSettings *settings, const char *key,
GSMColorButton *cp)
{
GdkColor c;
@@ -226,7 +226,7 @@ static void change_mateconf_color(MateConfClient *client, const char *key,
gsm_color_button_get_color(cp, &c);
g_snprintf(color, sizeof color, "#%04x%04x%04x", c.red, c.green, c.blue);
- mateconf_client_set_string (client, key, color, NULL);
+ g_settings_set_string (settings, key, color);
}
@@ -235,18 +235,18 @@ cb_cpu_color_changed (GSMColorButton *cp, gpointer data)
{
char key[80];
gint i = GPOINTER_TO_INT (data);
- MateConfClient *client = mateconf_client_get_default ();
+ GSettings *settings = g_settings_new (GSM_GSETTINGS_SCHEMA);
- g_snprintf(key, sizeof key, "/apps/procman/cpu_color%d", i);
+ g_snprintf(key, sizeof key, "cpu-color%d", i);
- change_mateconf_color(client, key, cp);
+ change_settings_color(settings, key, cp);
}
void
cb_mem_color_changed (GSMColorButton *cp, gpointer data)
{
ProcData * const procdata = static_cast<ProcData*>(data);
- change_mateconf_color(procdata->client, "/apps/procman/mem_color", cp);
+ change_settings_color(procdata->settings, "mem-color", cp);
}
@@ -254,21 +254,21 @@ void
cb_swap_color_changed (GSMColorButton *cp, gpointer data)
{
ProcData * const procdata = static_cast<ProcData*>(data);
- change_mateconf_color(procdata->client, "/apps/procman/swap_color", cp);
+ change_settings_color(procdata->settings, "swap-color", cp);
}
void
cb_net_in_color_changed (GSMColorButton *cp, gpointer data)
{
ProcData * const procdata = static_cast<ProcData*>(data);
- change_mateconf_color(procdata->client, "/apps/procman/net_in_color", cp);
+ change_settings_color(procdata->settings, "net-in-color", cp);
}
void
cb_net_out_color_changed (GSMColorButton *cp, gpointer data)
{
ProcData * const procdata = static_cast<ProcData*>(data);
- change_mateconf_color(procdata->client, "/apps/procman/net_out_color", cp);
+ change_settings_color(procdata->settings, "net-out-color", cp);
}
static void
@@ -432,6 +432,6 @@ cb_radio_processes(GtkAction *action, GtkRadioAction *current, gpointer data)
procdata->config.whose_process = gtk_radio_action_get_current_value(current);
- mateconf_client_set_int (procdata->client, "/apps/procman/view_as",
- procdata->config.whose_process, NULL);
+ g_settings_set_int (procdata->settings, "view_as",
+ procdata->config.whose_process);
}