X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=properties%2Fev-properties-main.c;h=27b80c31c47c057a63694a6abdefdbded9d3c322;hb=9a56c842cd84566f69f31d7ab4e1ec0492a157a3;hp=3b1e8e06eb3b490a03d55d26c6fa40fa21873cef;hpb=70f641411b2fbab930b481ac844984819b48805d;p=evince.git diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c index 3b1e8e06..27b80c31 100644 --- a/properties/ev-properties-main.c +++ b/properties/ev-properties-main.c @@ -27,16 +27,19 @@ * */ -#include "ev-properties-view.h" -#include "ev-document-factory.h" - #include + #include + #include -#include +#include + #include #include +#include +#include "ev-properties-view.h" + static GType epp_type = 0; static void property_page_provider_iface_init (NautilusPropertyPageProviderIface *iface); @@ -46,7 +49,7 @@ static GList *ev_properties_get_pages static void ev_properties_plugin_register_type (GTypeModule *module) { - static const GTypeInfo info = { + const GTypeInfo info = { sizeof (GObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, @@ -57,7 +60,7 @@ ev_properties_plugin_register_type (GTypeModule *module) 0, (GInstanceInitFunc) NULL }; - static const GInterfaceInfo property_page_provider_iface_info = { + const GInterfaceInfo property_page_provider_iface_info = { (GInterfaceInitFunc)property_page_provider_iface_init, NULL, NULL @@ -89,7 +92,7 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, char *uri = NULL; GtkWidget *page, *label; NautilusPropertyPage *property_page; - + /* only add properties page if a single file is selected */ if (files == NULL || files->next != NULL) goto end; @@ -103,9 +106,12 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, g_error_free (error); goto end; } + + if (!document) + goto end; label = gtk_label_new (_("Document")); - page = ev_properties_view_new (); + page = ev_properties_view_new (uri); ev_properties_view_set_info (EV_PROPERTIES_VIEW (page), ev_document_get_info (document)); gtk_widget_show (page); @@ -130,11 +136,14 @@ nautilus_module_initialize (GTypeModule *module) /* set up translation catalog */ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + + ev_init (); } void nautilus_module_shutdown (void) { + ev_shutdown (); } void @@ -147,4 +156,3 @@ nautilus_module_list_types (const GType **types, *types = type_list; *num_types = G_N_ELEMENTS (type_list); } -