static void
row_activated (GtkListBox  *box,
               GtkListBoxRow *row,
               GtkDialog   *chooser)
{
        CcFormatChooserPrivate *priv = GET_PRIVATE (chooser);
        gchar *new_locale_id;

        if (priv->adding)
                return;

        if (row == NULL)
                return;

        if (row == priv->more_item) {
                show_more (chooser);
                return;
        }
        new_locale_id = g_object_get_data (G_OBJECT (row), "locale-id");
        if (g_strcmp0 (new_locale_id, priv->region) == 0) {
                gtk_dialog_response (GTK_DIALOG (chooser),
                                     gtk_dialog_get_response_for_widget (GTK_DIALOG (chooser),
                                                                         priv->done_button));
        } else {
                set_locale_id (chooser, new_locale_id);
        }
}
static void
row_activated (GtkListBox        *box,
               GtkListBoxRow     *row,
               GtkDialog *chooser)
{
        CcLanguageChooserPrivate *priv = GET_PRIVATE (chooser);
        gchar *new_locale_id;

        if (row == NULL)
                return;

        if (row == priv->more_item) {
                show_more (chooser);
                return;
        }
        new_locale_id = g_object_get_data (G_OBJECT (row), "locale-id");
        set_locale_id (chooser, new_locale_id);
}
static void
row_activated (GtkListBox        *box,
               GtkListBoxRow     *row,
               CcLanguageChooser *chooser)
{
        GtkWidget *child;
        CcLanguageChooserPrivate *priv = chooser->priv;
        LanguageWidget *widget;

        if (row == NULL)
                return;

        child = gtk_bin_get_child (GTK_BIN (row));
        if (child == priv->more_item) {
                show_more (chooser);
        } else {
                widget = get_language_widget (child);
                if (widget == NULL)
                        return;
                set_locale_id (chooser, widget->locale_id);
        }
}
void
cc_language_chooser_set_language (GtkWidget   *chooser,
                                  const gchar *language)
{
        set_locale_id (GTK_DIALOG (chooser), language);
}
void
cc_format_chooser_set_region (GtkWidget   *chooser,
                              const gchar *region)
{
        set_locale_id (GTK_DIALOG (chooser), region);
}
void
cc_language_chooser_set_language (CcLanguageChooser *chooser,
                                  const gchar        *language)
{
        set_locale_id (chooser, language);
}