[gnome-control-center] RANDR - Factor out function to generate strings for refresh rate like '60 Hz'
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-control-center] RANDR - Factor out function to generate strings for refresh rate like '60 Hz'
- Date: Thu, 16 Jul 2009 17:48:53 +0000 (UTC)
commit bba301ff9c2246d3779d88d0db91352e781332f9
Author: Federico Mena Quintero <federico novell com>
Date: Wed Jul 15 18:55:24 2009 -0500
RANDR - Factor out function to generate strings for refresh rate like '60 Hz'
Signed-off-by: Federico Mena Quintero <federico novell com>
capplets/display/xrandr-capplet.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index 23cb713..75073f1 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -378,6 +378,12 @@ rebuild_rotation_combo (App *app)
combo_select (app->rotation_combo, _("Normal"));
}
+static char *
+make_rate_string (int hz)
+{
+ return g_strdup_printf (_("%d Hz"), hz);
+}
+
static void
rebuild_rate_combo (App *app)
{
@@ -412,7 +418,7 @@ rebuild_rate_combo (App *app)
height == app->current_output->height)
{
add_key (app->refresh_combo,
- idle_free (g_strdup_printf (_("%d Hz"), rate)),
+ idle_free (make_rate_string (rate)),
0, 0, rate, -1);
if (rate > best)
@@ -420,8 +426,8 @@ rebuild_rate_combo (App *app)
}
}
- if (!combo_select (app->refresh_combo, idle_free (g_strdup_printf (_("%d Hz"), app->current_output->rate))))
- combo_select (app->refresh_combo, idle_free (g_strdup_printf (_("%d Hz"), best)));
+ if (!combo_select (app->refresh_combo, idle_free (make_rate_string (app->current_output->rate))))
+ combo_select (app->refresh_combo, idle_free (make_rate_string (best)));
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]