X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=maemo-tweaks.c;h=67f9a27bd0eac8dbb0ffc9094ca413ba3b253218;hb=2f361187de89fe177b8021bbb1616dbf22bc4726;hp=ca3f125cc2916e05d11431799e84e4d23810b7bc;hpb=71a4a614d9e72f1895cf2d1043185499a47c02fb;p=tweakr diff --git a/maemo-tweaks.c b/maemo-tweaks.c index ca3f125..67f9a27 100644 --- a/maemo-tweaks.c +++ b/maemo-tweaks.c @@ -5,6 +5,10 @@ #include #include +#include "maemo-tweaks-types.h" +#include "libmaemo-tweaks-section/maemo-tweaks-section.h" +#include "maemo-tweaks-module-manager.h" + GtkWidget *create_dialog (GtkWindow *parent) { GtkWidget *dialog; @@ -22,20 +26,54 @@ GtkWidget *create_dialog (GtkWindow *parent) return dialog; } - osso_return_t execute (osso_context_t *osso, gpointer data, gboolean user_activated) { GtkWidget *dialog; gint response; + MaemoTweaksModuleManager *manager; + GType *section_types; + guint n_sections; + GList *sections = NULL; + gint i; + + manager = g_object_new (MAEMO_TWEAKS_TYPE_MODULE_MANAGER, + "module-path", MODULES_DIR, + NULL); + + section_types = g_type_children (MAEMO_TWEAKS_TYPE_SECTION, &n_sections); + dialog = create_dialog (GTK_WINDOW (data)); + + for (i = 0; i < n_sections; i++) + { + MaemoTweaksSection *section; + MaemoTweaksSectionClass *klass; + + klass = g_type_class_ref (section_types[i]); + section = maemo_tweaks_section_new (section_types[i]); + + sections = g_list_prepend (sections, section); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + maemo_tweaks_section_get_widget (section), + FALSE, FALSE, 0); + + g_type_class_unref (klass); + } + response = gtk_dialog_run (GTK_DIALOG (dialog)); if (response == GTK_RESPONSE_OK) { } + gtk_widget_destroy (GTK_WIDGET (dialog)); + g_object_unref (manager); + g_list_foreach (sections, (GFunc) g_object_unref, NULL); + if (sections) + g_list_free (sections); + return OSSO_OK; }