2 * vim:ts=4:sw=4:et:cindent:cino=(0
5 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
8 #include "maemo-tweaks-types.h"
9 #include "libmaemo-tweaks-section/maemo-tweaks-section.h"
10 #include "maemo-tweaks-module-manager.h"
12 GtkWidget *create_dialog (GtkWindow *parent)
16 dialog = gtk_dialog_new_with_buttons
19 GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
29 osso_return_t execute (osso_context_t *osso, gpointer data,
30 gboolean user_activated)
35 MaemoTweaksModuleManager *manager;
38 GList *sections = NULL;
41 manager = g_object_new (MAEMO_TWEAKS_TYPE_MODULE_MANAGER,
42 "module-path", MODULES_DIR,
45 section_types = g_type_children (MAEMO_TWEAKS_TYPE_SECTION, &n_sections);
47 dialog = create_dialog (GTK_WINDOW (data));
49 for (i = 0; i < n_sections; i++)
51 MaemoTweaksSection *section;
52 MaemoTweaksSectionClass *klass;
54 klass = g_type_class_ref (section_types[i]);
55 section = maemo_tweaks_section_new (section_types[i]);
57 sections = g_list_prepend (sections, section);
58 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
59 maemo_tweaks_section_get_widget (section),
62 g_type_class_unref (klass);
65 gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
66 response = gtk_dialog_run (GTK_DIALOG (dialog));
67 if (response == GTK_RESPONSE_OK)
72 gtk_widget_destroy (GTK_WIDGET (dialog));
73 g_object_unref (manager);
74 g_list_foreach (sections, (GFunc) g_object_unref, NULL);
76 g_list_free (sections);