Load the file chooser's widgets from the .ui file

This is Tristan's *excellent* work, minus the old code for the shortcuts bar - that is all done
in GtkPlacesSidebar now.

The UI gets loaded from a Glade resource; most of the old code to create the UI by hand is gone.

There is still code for save_widgets_create(); this needs to be moved into the UI file, but it
is not a big deal.

gtk_file_chooser_default_init() calls a new post_process_ui() that takes care of all the things
that cannot be done directly in Glade.
This commit is contained in:
Tristan Van Berkom 2013-04-11 20:37:01 -05:00 committed by Federico Mena Quintero
parent 1d946367d3
commit a6f9ef0d3a
4 changed files with 397 additions and 650 deletions

View File

@ -1110,6 +1110,7 @@ COMPOSITE_TEMPLATES = \
gtkcoloreditor.ui \
gtkdialog.ui \
gtkfilechooserbutton.ui \
gtkfilechooserdefault.ui \
gtkfilechooserdialog.ui \
gtkfontbutton.ui \
gtkfontchooserdialog.ui \

View File

@ -19,6 +19,7 @@
<file compressed="true">gtkcoloreditor.ui</file>
<file compressed="true">gtkdialog.ui</file>
<file compressed="true">gtkfilechooserbutton.ui</file>
<file compressed="true">gtkfilechooserdefault.ui</file>
<file compressed="true">gtkfilechooserdialog.ui</file>
<file compressed="true">gtkfontbutton.ui</file>
<file compressed="true">gtkfontchooserdialog.ui</file>

File diff suppressed because it is too large Load Diff

View File

@ -37,6 +37,9 @@ test_dialog_basic (void)
dialog = gtk_dialog_new();
g_assert (GTK_IS_DIALOG (dialog));
g_assert (gtk_dialog_get_action_area (GTK_DIALOG (dialog)) != NULL);
g_assert (gtk_dialog_get_content_area (GTK_DIALOG (dialog)) != NULL);
gtk_widget_destroy (dialog);
}
@ -158,6 +161,13 @@ test_app_chooser_dialog_basic (void)
widget = gtk_app_chooser_dialog_new_for_content_type (NULL, 0, "text/plain");
g_assert (GTK_IS_APP_CHOOSER_DIALOG (widget));
/* GtkAppChooserDialog bug, if destroyed before spinning
* the main context then app_chooser_online_get_default_ready_cb()
* will be eventually called and segfault.
*/
g_timeout_add (500, main_loop_quit_cb, NULL);
gtk_main();
gtk_widget_destroy (widget);
}