Factor out function to sanitize and save the RANDR configuration
Signed-off-by: Federico Mena Quintero <federico@novell.com>
This commit is contained in:
parent
8c7020b832
commit
eaa7342a04
1 changed files with 16 additions and 4 deletions
|
@ -2033,10 +2033,10 @@ apply_configuration_returned_cb (DBusGProxy *proxy,
|
||||||
gtk_widget_set_sensitive (app->dialog, TRUE);
|
gtk_widget_set_sensitive (app->dialog, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
apply (App *app)
|
sanitize_and_save_configuration (App *app)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error;
|
||||||
|
|
||||||
gnome_rr_config_sanitize (app->current_configuration);
|
gnome_rr_config_sanitize (app->current_configuration);
|
||||||
|
|
||||||
|
@ -2046,13 +2046,25 @@ apply (App *app)
|
||||||
|
|
||||||
ensure_current_configuration_is_saved ();
|
ensure_current_configuration_is_saved ();
|
||||||
|
|
||||||
|
error = NULL;
|
||||||
if (!gnome_rr_config_save (app->current_configuration, &error))
|
if (!gnome_rr_config_save (app->current_configuration, &error))
|
||||||
{
|
{
|
||||||
error_message (app, _("Could not save the monitor configuration"), error->message);
|
error_message (app, _("Could not save the monitor configuration"), error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
apply (App *app)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
if (!sanitize_and_save_configuration (app))
|
||||||
|
return;
|
||||||
|
|
||||||
g_assert (app->connection == NULL);
|
g_assert (app->connection == NULL);
|
||||||
g_assert (app->proxy == NULL);
|
g_assert (app->proxy == NULL);
|
||||||
g_assert (app->proxy_call == NULL);
|
g_assert (app->proxy_call == NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue