~gue5t/midori/suggestion-regression

« back to all changes in this revision

Viewing changes to midori/main.c

  • Committer: Christian Dywan
  • Date: 2011-04-14 01:29:50 UTC
  • Revision ID: git-v1:ed6ed712399a66b50197064ca5f5a68566f43f14
Embed extensions into preferences dialogue

MidoriBrowser gains the show-preferences signal which
gives API users a chance to add preferences.

katze_preferences_add_category now returns a box to
allow freely packing a widget into the page.

The extension panel is packed into the preferences now
rather than being appended as a proper panel.

Motivation is consistency here, such as with Gedit or
Emerillon and also the aspect that extensions often
really do tweak behaviour like preferences do.

Spacing and icons are added for visual consistency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
695
695
}
696
696
 
697
697
static void
 
698
midori_browser_show_preferences_cb (MidoriBrowser*    browser,
 
699
                                    KatzePreferences* preferences,
 
700
                                    MidoriApp*        app)
 
701
{
 
702
    GtkWidget* scrolled = katze_scrolled_new (NULL, NULL);
 
703
    GtkWidget* addon = g_object_new (MIDORI_TYPE_EXTENSIONS, NULL);
 
704
    GList* children = gtk_container_get_children (GTK_CONTAINER (addon));
 
705
    GtkWidget* page;
 
706
    gtk_widget_reparent (g_list_nth_data (children, 0), scrolled);
 
707
    g_list_free (children);
 
708
    g_object_set (addon, "app", app, NULL);
 
709
    gtk_widget_show (scrolled);
 
710
    page = katze_preferences_add_category (preferences,
 
711
                                           _("Extensions"), STOCK_EXTENSIONS);
 
712
    gtk_box_pack_start (GTK_BOX (page), scrolled, TRUE, TRUE, 4);
 
713
}
 
714
 
 
715
static void
698
716
midori_app_add_browser_cb (MidoriApp*     app,
699
717
                           MidoriBrowser* browser,
700
718
                           KatzeNet*      net)
722
740
    #endif
723
741
 
724
742
    /* Extensions */
725
 
    addon = g_object_new (MIDORI_TYPE_EXTENSIONS, NULL);
726
 
    gtk_widget_show (addon);
727
 
    g_object_set (addon, "app", app, NULL);
728
 
    midori_panel_append_page (MIDORI_PANEL (panel), MIDORI_VIEWABLE (addon));
 
743
    g_signal_connect (browser, "show-preferences",
 
744
        G_CALLBACK (midori_browser_show_preferences_cb), app);
729
745
 
730
746
    g_object_unref (panel);
731
747
}