Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2008-12-03 15:45:10 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2008-12-03 15:45:10 (GMT)
commit309a8fb96dd401d07f774c687bda59da77bd41d2 (patch)
tree9240f09e65f8adf291c5c62e8fd02f137f498b12
parent7401194be132a52138b9a40e29c63847d125795d (diff)
Add document URI to properties page. Fixes bug #555376.
2008-12-03 Carlos Garcia Campos <carlosgc@gnome.org> * properties/ev-properties-main.c: (ev_properties_get_pages): * properties/ev-properties-view.[ch]: (ev_properties_view_dispose), (ev_properties_view_class_init), (ev_properties_view_set_info), (ev_properties_view_new): * shell/ev-properties-dialog.[ch]: (ev_properties_dialog_set_document): * shell/ev-window.c: (ev_window_setup_document), (ev_window_cmd_file_properties): Add document URI to properties page. Fixes bug #555376. svn path=/trunk/; revision=3290
-rw-r--r--ChangeLog13
-rw-r--r--properties/ev-properties-main.c2
-rw-r--r--properties/ev-properties-view.c25
-rw-r--r--properties/ev-properties-view.h3
-rw-r--r--shell/ev-properties-dialog.c3
-rw-r--r--shell/ev-properties-dialog.h1
-rw-r--r--shell/ev-window.c2
7 files changed, 44 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 87e6cf4..111884b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2008-12-03 Carlos Garcia Campos <carlosgc@gnome.org>
+ * properties/ev-properties-main.c: (ev_properties_get_pages):
+ * properties/ev-properties-view.[ch]:
+ (ev_properties_view_dispose), (ev_properties_view_class_init),
+ (ev_properties_view_set_info), (ev_properties_view_new):
+ * shell/ev-properties-dialog.[ch]:
+ (ev_properties_dialog_set_document):
+ * shell/ev-window.c: (ev_window_setup_document),
+ (ev_window_cmd_file_properties):
+
+ Add document URI to properties page. Fixes bug #555376.
+
+2008-12-03 Carlos Garcia Campos <carlosgc@gnome.org>
+
* configure.ac:
* data/Makefile.am:
* data/evince-password.glade: Removed
diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c
index b25df9e..d7f88e2 100644
--- a/properties/ev-properties-main.c
+++ b/properties/ev-properties-main.c
@@ -112,7 +112,7 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider,
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);
diff --git a/properties/ev-properties-view.c b/properties/ev-properties-view.c
index 65f29d1..6382af4 100644
--- a/properties/ev-properties-view.c
+++ b/properties/ev-properties-view.c
@@ -35,6 +35,7 @@
typedef enum {
TITLE_PROPERTY,
+ URI_PROPERTY,
SUBJECT_PROPERTY,
AUTHOR_PROPERTY,
KEYWORDS_PROPERTY,
@@ -56,6 +57,7 @@ typedef struct {
static const PropertyInfo properties_info[] = {
{ TITLE_PROPERTY, N_("Title") },
+ { URI_PROPERTY, N_("Location") },
{ SUBJECT_PROPERTY, N_("Subject") },
{ AUTHOR_PROPERTY, N_("Author") },
{ KEYWORDS_PROPERTY, N_("Keywords") },
@@ -74,6 +76,7 @@ struct _EvPropertiesView {
GtkVBox base_instance;
GtkWidget *table;
+ gchar *uri;
};
struct _EvPropertiesViewClass {
@@ -83,8 +86,24 @@ struct _EvPropertiesViewClass {
G_DEFINE_TYPE (EvPropertiesView, ev_properties_view, GTK_TYPE_VBOX)
static void
+ev_properties_view_dispose (GObject *object)
+{
+ EvPropertiesView *properties = EV_PROPERTIES_VIEW (object);
+
+ if (properties->uri) {
+ g_free (properties->uri);
+ properties->uri = NULL;
+ }
+
+ G_OBJECT_CLASS (ev_properties_view_parent_class)->dispose (object);
+}
+
+static void
ev_properties_view_class_init (EvPropertiesViewClass *properties_class)
{
+ GObjectClass *g_object_class = G_OBJECT_CLASS (properties_class);
+
+ g_object_class->dispose = ev_properties_view_dispose;
}
/* Returns a locale specific date and time representation */
@@ -304,10 +323,11 @@ ev_properties_view_set_info (EvPropertiesView *properties, const EvDocumentInfo
gint row = 0;
table = properties->table;
-
+
if (info->fields_mask & EV_DOCUMENT_INFO_TITLE) {
set_property (GTK_TABLE (table), TITLE_PROPERTY, info->title, &row);
}
+ set_property (GTK_TABLE (table), URI_PROPERTY, properties->uri, &row);
if (info->fields_mask & EV_DOCUMENT_INFO_SUBJECT) {
set_property (GTK_TABLE (table), SUBJECT_PROPERTY, info->subject, &row);
}
@@ -373,11 +393,12 @@ ev_properties_view_register_type (GTypeModule *module)
}
GtkWidget *
-ev_properties_view_new (void)
+ev_properties_view_new (const gchar *uri)
{
EvPropertiesView *properties;
properties = g_object_new (EV_TYPE_PROPERTIES, NULL);
+ properties->uri = g_strdup (uri);
return GTK_WIDGET (properties);
}
diff --git a/properties/ev-properties-view.h b/properties/ev-properties-view.h
index 41e6277..ec4dac7 100644
--- a/properties/ev-properties-view.h
+++ b/properties/ev-properties-view.h
@@ -40,7 +40,8 @@ typedef struct _EvPropertiesViewPrivate EvPropertiesViewPrivate;
GType ev_properties_view_get_type (void);
void ev_properties_view_register_type (GTypeModule *module);
-GtkWidget *ev_properties_view_new (void);
+
+GtkWidget *ev_properties_view_new (const gchar *uri);
void ev_properties_view_set_info (EvPropertiesView *properties,
const EvDocumentInfo *info);
diff --git a/shell/ev-properties-dialog.c b/shell/ev-properties-dialog.c
index 24bd3d6..f48b967 100644
--- a/shell/ev-properties-dialog.c
+++ b/shell/ev-properties-dialog.c
@@ -77,6 +77,7 @@ ev_properties_dialog_init (EvPropertiesDialog *properties)
void
ev_properties_dialog_set_document (EvPropertiesDialog *properties,
+ const gchar *uri,
EvDocument *document)
{
GtkWidget *label;
@@ -88,7 +89,7 @@ ev_properties_dialog_set_document (EvPropertiesDialog *properties,
if (properties->general_page == NULL) {
label = gtk_label_new (_("General"));
- properties->general_page = ev_properties_view_new ();
+ properties->general_page = ev_properties_view_new (uri);
gtk_notebook_append_page (GTK_NOTEBOOK (properties->notebook),
properties->general_page, label);
gtk_widget_show (properties->general_page);
diff --git a/shell/ev-properties-dialog.h b/shell/ev-properties-dialog.h
index f85e53a..6c14b20 100644
--- a/shell/ev-properties-dialog.h
+++ b/shell/ev-properties-dialog.h
@@ -39,6 +39,7 @@ typedef struct _EvPropertiesDialogPrivate EvPropertiesDialogPrivate;
GType ev_properties_dialog_get_type (void);
GtkWidget *ev_properties_dialog_new (void);
void ev_properties_dialog_set_document (EvPropertiesDialog *properties,
+ const gchar *uri,
EvDocument *document);
G_END_DECLS
diff --git a/shell/ev-window.c b/shell/ev-window.c
index c570de7..77474bf 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1205,6 +1205,7 @@ ev_window_setup_document (EvWindow *ev_window)
if (ev_window->priv->properties) {
ev_properties_dialog_set_document (EV_PROPERTIES_DIALOG (ev_window->priv->properties),
+ ev_window->priv->uri,
ev_window->priv->document);
}
@@ -2677,6 +2678,7 @@ ev_window_cmd_file_properties (GtkAction *action, EvWindow *ev_window)
if (ev_window->priv->properties == NULL) {
ev_window->priv->properties = ev_properties_dialog_new ();
ev_properties_dialog_set_document (EV_PROPERTIES_DIALOG (ev_window->priv->properties),
+ ev_window->priv->uri,
ev_window->priv->document);
g_object_add_weak_pointer (G_OBJECT (ev_window->priv->properties),
(gpointer) &(ev_window->priv->properties));