gth-edit-comment-page.c 16.9 KB
Newer Older
Paolo Bacchilega's avatar
Paolo Bacchilega committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/*
 *  GThumb
 *
 *  Copyright (C) 2009 Free Software Foundation, Inc.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
Paolo Bacchilega's avatar
Paolo Bacchilega committed
20 21 22 23 24 25
 */

#include <config.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "gth-edit-comment-page.h"
26
#include "gth-edit-metadata-dialog.h"
Paolo Bacchilega's avatar
Paolo Bacchilega committed
27 28 29 30 31 32 33 34 35 36


#define GTH_EDIT_COMMENT_PAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_EDIT_COMMENT_PAGE, GthEditCommentPagePrivate))
#define GET_WIDGET(name) _gtk_builder_get_widget (self->priv->builder, (name))


typedef enum {
	NO_DATE = 0,
	FOLLOWING_DATE,
	CURRENT_DATE,
37
	PHOTO_DATE,
Paolo Bacchilega's avatar
Paolo Bacchilega committed
38 39 40 41 42 43 44 45 46 47
	LAST_MODIFIED_DATE,
	CREATION_DATE,
	NO_CHANGE
} DateOption;


static gpointer gth_edit_comment_page_parent_class = NULL;


struct _GthEditCommentPagePrivate {
48 49 50 51 52
	GFileInfo  *info;
	GtkBuilder *builder;
	GtkWidget  *date_combobox;
	GtkWidget  *date_selector;
	GtkWidget  *tags_entry;
53
	GTimeVal    current_date;
Paolo Bacchilega's avatar
Paolo Bacchilega committed
54 55 56 57
};


void
58 59
gth_edit_comment_page_real_set_file_list (GthEditMetadataPage *base,
		 			  GList               *file_list)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
60
{
61 62 63 64 65 66
	GthEditCommentPage  *self;
	GtkTextBuffer       *buffer;
	GthMetadata         *metadata;
	GthStringList       *tags;
	GthMetadataProvider *provider;
	gboolean             no_provider;
67 68
	GthFileData         *file_data;
	const char          *mime_type;
Paolo Bacchilega's avatar
Paolo Bacchilega committed
69 70 71

	self = GTH_EDIT_COMMENT_PAGE (base);

72
	_g_object_unref (self->priv->info);
73
	self->priv->info = gth_file_data_list_get_common_info (file_list, "general::description,general::title,general::location,general::datetime,general::tags,general::rating");
Paolo Bacchilega's avatar
Paolo Bacchilega committed
74 75

	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (GET_WIDGET ("note_text")));
76
	metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "general::description");
Paolo Bacchilega's avatar
Paolo Bacchilega committed
77 78 79 80 81 82 83 84 85 86
	if (metadata != NULL) {
		GtkTextIter iter;

		gtk_text_buffer_set_text (buffer, gth_metadata_get_formatted (metadata), -1);
		gtk_text_buffer_get_iter_at_line (buffer, &iter, 0);
		gtk_text_buffer_place_cursor (buffer, &iter);
	}
	else
		gtk_text_buffer_set_text (buffer, "", -1);

87
	metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "general::title");
88 89 90 91 92
	if (metadata != NULL)
		gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("title_entry")), gth_metadata_get_formatted (metadata));
	else
		gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("title_entry")), "");

93
	metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "general::location");
Paolo Bacchilega's avatar
Paolo Bacchilega committed
94 95 96 97 98
	if (metadata != NULL)
		gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("place_entry")), gth_metadata_get_formatted (metadata));
	else
		gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("place_entry")), "");

99
	metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "general::datetime");
Paolo Bacchilega's avatar
Paolo Bacchilega committed
100 101
	if (metadata != NULL) {
		gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->date_combobox), FOLLOWING_DATE);
102
		gtk_widget_set_sensitive (self->priv->date_combobox, TRUE);
103
		gth_time_selector_set_exif_date (GTH_TIME_SELECTOR (self->priv->date_selector), gth_metadata_get_raw (metadata));
Paolo Bacchilega's avatar
Paolo Bacchilega committed
104 105
	}
	else {
106 107 108 109
		if (file_list->next == NULL)
			gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->date_combobox), NO_DATE);
		else
			gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->date_combobox), NO_CHANGE);
110
		gtk_widget_set_sensitive (self->priv->date_combobox, FALSE);
111
		gth_time_selector_set_exif_date (GTH_TIME_SELECTOR (self->priv->date_selector), "");
Paolo Bacchilega's avatar
Paolo Bacchilega committed
112 113
	}

114
	tags = (GthStringList *) g_file_info_get_attribute_object (self->priv->info, "general::tags");
115 116 117
	if (tags != NULL) {
		char *value;

118
		value = gth_string_list_join (tags, ",");
119
		gth_tags_entry_set_text (GTH_TAGS_ENTRY (self->priv->tags_entry), value);
120 121 122 123

		g_free (value);
	}
	else
124
		gth_tags_entry_set_text (GTH_TAGS_ENTRY (self->priv->tags_entry), NULL);
125

126
	metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "general::rating");
127 128 129 130 131 132 133 134 135
	if (metadata != NULL) {
		int v;

		sscanf (gth_metadata_get_raw (metadata), "%d", &v);
		gtk_spin_button_set_value (GTK_SPIN_BUTTON (GET_WIDGET ("rating_spinbutton")), v);
	}
	else
		gtk_spin_button_set_value (GTK_SPIN_BUTTON (GET_WIDGET ("rating_spinbutton")), 0);

Paolo Bacchilega's avatar
Paolo Bacchilega committed
136
	gtk_widget_grab_focus (GET_WIDGET ("note_text"));
137 138 139

	no_provider = TRUE;

140 141 142 143 144 145 146 147 148 149
	if (file_list->next == NULL) {
		GthFileData *first = file_list->data;
		file_data = gth_file_data_new (first->file, first->info);
	}
	else
		file_data = gth_file_data_new (NULL, ((GthFileData *) file_list->data)->info);

	mime_type = gth_file_data_get_mime_type (file_data);

  	provider = gth_main_get_metadata_writer ("general::description", mime_type);
150 151 152 153 154
	gtk_widget_set_sensitive (GET_WIDGET ("note_text"), provider != NULL);
	if (no_provider && (provider != NULL))
		no_provider = FALSE;
	_g_object_unref (provider);

155
	provider = gth_main_get_metadata_writer ("general::location", mime_type);
156 157 158 159 160
	gtk_widget_set_sensitive (GET_WIDGET ("place_entry"), provider != NULL);
	if (no_provider && (provider != NULL))
		no_provider = FALSE;
	_g_object_unref (provider);

161
	provider = gth_main_get_metadata_writer ("general::datetime", mime_type);
162
	gtk_widget_set_sensitive (self->priv->date_combobox, provider != NULL);
163 164
	if (provider == NULL)
		gtk_widget_set_sensitive (self->priv->date_selector, FALSE);
165 166 167 168
	if (no_provider && (provider != NULL))
		no_provider = FALSE;
	_g_object_unref (provider);

169
	provider = gth_main_get_metadata_writer ("general::tags", mime_type);
170 171 172 173 174
	gtk_widget_set_sensitive (self->priv->tags_entry, provider != NULL);
	if (no_provider && (provider != NULL))
		no_provider = FALSE;
	_g_object_unref (provider);

175
	provider = gth_main_get_metadata_writer ("general::rating", mime_type);
176 177 178 179 180
	gtk_widget_set_sensitive (GET_WIDGET ("rating_spinbutton"), provider != NULL);
	if (no_provider && (provider != NULL))
		no_provider = FALSE;
	_g_object_unref (provider);

181 182 183 184
	if (no_provider)
		gtk_widget_hide (GTK_WIDGET (self));
	else
		gtk_widget_show (GTK_WIDGET (self));
185 186

	g_object_unref (file_data);
Paolo Bacchilega's avatar
Paolo Bacchilega committed
187 188 189
}


190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
static char *
get_date_from_option (GthEditCommentPage *self,
		      DateOption          option,
		      GFileInfo          *info)
{
	GTimeVal     timeval;
	GthDateTime *date_time;
	char        *exif_date;
	GthMetadata *metadata;

	_g_time_val_reset (&timeval);

	switch (option) {
	case NO_DATE:
		return g_strdup ("");

	case FOLLOWING_DATE:
		date_time = gth_datetime_new ();
		gth_time_selector_get_value (GTH_TIME_SELECTOR (self->priv->date_selector), date_time);
		exif_date = gth_datetime_to_exif_date (date_time);
		_g_time_val_from_exif_date (exif_date, &timeval);
		g_free (exif_date);
		gth_datetime_free (date_time);
		break;

	case CURRENT_DATE:
		g_get_current_time (&self->priv->current_date);
		timeval = self->priv->current_date;
		break;

	case PHOTO_DATE:
		metadata = (GthMetadata *) g_file_info_get_attribute_object (info, "Embedded::Photo::DateTimeOriginal");
		if (metadata != NULL)
			_g_time_val_from_exif_date (gth_metadata_get_raw (metadata), &timeval);
		else
			return g_strdup ("");
		break;

	case LAST_MODIFIED_DATE:
		timeval.tv_sec = g_file_info_get_attribute_uint64 (info, "time::modified");
		timeval.tv_usec = g_file_info_get_attribute_uint32 (info, "time::modified-usec");
		break;

	case CREATION_DATE:
		timeval.tv_sec = g_file_info_get_attribute_uint64 (info, "time::created");
		timeval.tv_usec = g_file_info_get_attribute_uint32 (info, "time::created-usec");
		break;

	case NO_CHANGE:
		metadata = (GthMetadata *) g_file_info_get_attribute_object (info, "general::datetime");
		if (metadata != NULL)
			_g_time_val_from_exif_date (gth_metadata_get_raw (metadata), &timeval);
		else
			return g_strdup ("");
		break;
	}

	return _g_time_val_to_exif_date (&timeval);
}


Paolo Bacchilega's avatar
Paolo Bacchilega committed
251 252
void
gth_edit_comment_page_real_update_info (GthEditMetadataPage *base,
253 254
					GFileInfo           *info,
					gboolean             only_modified_fields)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
255
{
256
	GthEditCommentPage  *self;
257
	GthFileData         *file_data;
258 259 260 261
	GtkTextBuffer       *buffer;
	GtkTextIter          start;
	GtkTextIter          end;
	char                *text;
262
	GthMetadata         *metadata;
263 264 265 266
	int                  i;
	char               **tagv;
	GList               *tags;
	GthStringList       *string_list;
267
	char                *s;
Paolo Bacchilega's avatar
Paolo Bacchilega committed
268 269 270

	self = GTH_EDIT_COMMENT_PAGE (base);

271 272
	file_data = gth_file_data_new (NULL, self->priv->info);

273 274
	/* caption */

275 276 277 278 279 280 281 282 283
	if (! only_modified_fields || ! gth_file_data_attribute_equal (file_data, "general::title", gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("title_entry"))))) {
		metadata = g_object_new (GTH_TYPE_METADATA,
					 "id", "general::title",
					 "raw", gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("title_entry"))),
					 "formatted", gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("title_entry"))),
					 NULL);
		g_file_info_set_attribute_object (info, "general::title", G_OBJECT (metadata));
		g_object_unref (metadata);
	}
284

285 286
	/* comment */

Paolo Bacchilega's avatar
Paolo Bacchilega committed
287 288 289
	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (GET_WIDGET ("note_text")));
	gtk_text_buffer_get_bounds (buffer, &start, &end);
	text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
290 291 292 293 294 295 296 297 298
	if (! only_modified_fields || ! gth_file_data_attribute_equal (file_data, "general::description", text)) {
		metadata = g_object_new (GTH_TYPE_METADATA,
					 "id", "general::description",
					 "raw", text,
					 "formatted", text,
					 NULL);
		g_file_info_set_attribute_object (info, "general::description", G_OBJECT (metadata));
		g_object_unref (metadata);
	}
Paolo Bacchilega's avatar
Paolo Bacchilega committed
299 300
	g_free (text);

301 302
	/* location */

303 304 305 306 307 308 309 310 311
	if (! only_modified_fields || ! gth_file_data_attribute_equal (file_data, "general::location", gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("place_entry"))))) {
		metadata = g_object_new (GTH_TYPE_METADATA,
					 "id", "general::location",
					 "raw", gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("place_entry"))),
					 "formatted", gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("place_entry"))),
					 NULL);
		g_file_info_set_attribute_object (info, "general::location", G_OBJECT (metadata));
		g_object_unref (metadata);
	}
312 313 314

	/* date */

315 316 317 318 319 320 321
	switch (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox))) {
	case NO_CHANGE:
		break;
	case NO_DATE:
		g_file_info_remove_attribute (info, "general::datetime");
		break;
	default:
322
		{
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343
			char *exif_date;

			if (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)) == CURRENT_DATE)
				exif_date = _g_time_val_to_exif_date (&self->priv->current_date);
			else
				exif_date = get_date_from_option (self, gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)), info);
			if (! only_modified_fields
			    || ! gth_file_data_attribute_equal (file_data, "general::datetime", exif_date))
			{
				metadata = g_object_new (GTH_TYPE_METADATA,
							 "id", "general::datetime",
							 "raw", exif_date,
							 "formatted", exif_date,
							 NULL);
				g_file_info_set_attribute_object (info, "general::datetime", G_OBJECT (metadata));
				g_object_unref (metadata);
			}

			g_free (exif_date);

			break;
344
		}
345
	}
346 347

	/* tags */
348

349
	tagv = gth_tags_entry_get_tags (GTH_TAGS_ENTRY (self->priv->tags_entry), TRUE);
350
	tags = NULL;
351 352
	for (i = 0; tagv[i] != NULL; i++)
		tags = g_list_prepend (tags, tagv[i]);
353
	tags = g_list_reverse (tags);
354 355 356 357
	if (tags != NULL)
		string_list = gth_string_list_new (tags);
	else
		string_list = NULL;
358 359 360 361 362 363
	if (! only_modified_fields || ! gth_file_data_attribute_equal_string_list (file_data, "general::tags", string_list)) {
		if (string_list != NULL)
			g_file_info_set_attribute_object (info, "general::tags", G_OBJECT (string_list));
		else
			g_file_info_remove_attribute (info, "general::tags");
	}
364

365 366
	/* rating */

367
	s = g_strdup_printf ("%d", gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (GET_WIDGET ("rating_spinbutton"))));
368
	if (! only_modified_fields || ! gth_file_data_attribute_equal_int (file_data, "general::rating", s)) {
369 370 371 372 373 374 375 376 377 378 379
		if (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (GET_WIDGET ("rating_spinbutton"))) > 0) {
			metadata = g_object_new (GTH_TYPE_METADATA,
						 "id", "general::rating",
						 "raw", s,
						 "formatted", s,
						 NULL);
			g_file_info_set_attribute_object (info, "general::rating", G_OBJECT (metadata));
			g_object_unref (metadata);
		}
		else
			g_file_info_remove_attribute (info, "general::rating");
380 381
	}

382
	g_free (s);
383
	_g_object_unref (string_list);
384
	g_strfreev (tagv);
385
	g_list_free (tags);
386
	g_object_unref (file_data);
Paolo Bacchilega's avatar
Paolo Bacchilega committed
387 388 389 390 391 392
}


const char *
gth_edit_comment_page_real_get_name (GthEditMetadataPage *self)
{
393
	return _("General");
Paolo Bacchilega's avatar
Paolo Bacchilega committed
394 395 396 397 398 399 400 401 402 403
}


static void
gth_edit_comment_page_finalize (GObject *object)
{
	GthEditCommentPage *self;

	self = GTH_EDIT_COMMENT_PAGE (object);

404
	_g_object_unref (self->priv->info);
Paolo Bacchilega's avatar
Paolo Bacchilega committed
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
	g_object_unref (self->priv->builder);

	G_OBJECT_CLASS (gth_edit_comment_page_parent_class)->finalize (object);
}


static void
gth_edit_comment_page_class_init (GthEditCommentPageClass *klass)
{
	gth_edit_comment_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GthEditCommentPagePrivate));

	G_OBJECT_CLASS (klass)->finalize = gth_edit_comment_page_finalize;
}


static void
date_combobox_changed_cb (GtkComboBox *widget,
			  gpointer     user_data)
{
	GthEditCommentPage *self = user_data;
	char               *value;

428
	value = get_date_from_option (self, gtk_combo_box_get_active (widget), self->priv->info);
429
	gth_time_selector_set_exif_date (GTH_TIME_SELECTOR (self->priv->date_selector), value);
430
	gtk_widget_set_sensitive (self->priv->date_selector, ! g_str_equal (value, ""));
Paolo Bacchilega's avatar
Paolo Bacchilega committed
431 432 433 434 435

	g_free (value);
}


436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
static void
tags_entry_list_collapsed_cb (GthTagsEntry *widget,
			      gpointer     user_data)
{
	GtkWidget *toplevel;
	int        width;

	/* collapse the dialog height */

	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (widget));
	if (! gtk_widget_is_toplevel (toplevel))
		return;

	gtk_window_get_size (GTK_WINDOW (toplevel), &width, NULL);
	gtk_window_resize (GTK_WINDOW (toplevel), width, 1);
}


Paolo Bacchilega's avatar
Paolo Bacchilega committed
454 455 456 457
static void
gth_edit_comment_page_init (GthEditCommentPage *self)
{
	self->priv = GTH_EDIT_COMMENT_PAGE_GET_PRIVATE (self);
458
	self->priv->info = NULL;
Paolo Bacchilega's avatar
Paolo Bacchilega committed
459 460 461

	gtk_container_set_border_width (GTK_CONTAINER (self), 12);

462
	self->priv->builder = _gtk_builder_new_from_file ("edit-comment-page.ui", "edit_metadata");
463 464
	gtk_box_pack_start (GTK_BOX (self), _gtk_builder_get_widget (self->priv->builder, "content"), TRUE, TRUE, 0);

465 466
	self->priv->date_combobox = gtk_combo_box_text_new ();
	_gtk_combo_box_append_texts (GTK_COMBO_BOX_TEXT (self->priv->date_combobox),
467 468 469 470 471 472 473 474 475 476 477 478
				     _("No date"),
				     _("The following date"),
				     _("Current date"),
				     _("Date photo was taken"),
				     _("Last modified date"),
				     _("File creation date"),
				     _("Do not modify"),
				     NULL);
	gtk_widget_show (self->priv->date_combobox);
	gtk_box_pack_start (GTK_BOX (GET_WIDGET ("date_combobox_container")), self->priv->date_combobox, TRUE, TRUE, 0);

	g_signal_connect (self->priv->date_combobox,
479 480 481
			  "changed",
			  G_CALLBACK (date_combobox_changed_cb),
			  self);
Paolo Bacchilega's avatar
Paolo Bacchilega committed
482

483 484 485
	self->priv->date_selector = gth_time_selector_new ();
	gtk_widget_show (self->priv->date_selector);
	gtk_box_pack_start (GTK_BOX (GET_WIDGET ("date_selector_container")), self->priv->date_selector, FALSE, FALSE, 0);
486
	gtk_label_set_mnemonic_widget (GTK_LABEL (GET_WIDGET ("date_label")), self->priv->date_combobox);
487

488 489 490
	self->priv->tags_entry = gth_tags_entry_new ();
	gtk_widget_show (self->priv->tags_entry);
	gtk_box_pack_start (GTK_BOX (GET_WIDGET ("tags_entry_container")), self->priv->tags_entry, FALSE, FALSE, 0);
491
	gtk_label_set_mnemonic_widget (GTK_LABEL (GET_WIDGET ("tags_label")), self->priv->tags_entry);
492 493 494 495 496

	g_signal_connect (self->priv->tags_entry,
			  "list-collapsed",
			  G_CALLBACK (tags_entry_list_collapsed_cb),
			  self);
Paolo Bacchilega's avatar
Paolo Bacchilega committed
497 498 499 500 501 502
}


static void
gth_edit_comment_page_gth_edit_comment_page_interface_init (GthEditMetadataPageIface *iface)
{
503
	iface->set_file_list = gth_edit_comment_page_real_set_file_list;
Paolo Bacchilega's avatar
Paolo Bacchilega committed
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540
	iface->update_info = gth_edit_comment_page_real_update_info;
	iface->get_name = gth_edit_comment_page_real_get_name;
}


GType
gth_edit_comment_page_get_type (void)
{
	static GType type = 0;

	if (type == 0) {
		static const GTypeInfo g_define_type_info = {
			sizeof (GthEditCommentPageClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) gth_edit_comment_page_class_init,
			(GClassFinalizeFunc) NULL,
			NULL,
			sizeof (GthEditCommentPage),
			0,
			(GInstanceInitFunc) gth_edit_comment_page_init,
			NULL
		};
		static const GInterfaceInfo gth_edit_comment_page_info = {
			(GInterfaceInitFunc) gth_edit_comment_page_gth_edit_comment_page_interface_init,
			(GInterfaceFinalizeFunc) NULL,
			NULL
		};
		type = g_type_register_static (GTK_TYPE_VBOX,
					       "GthEditCommentPage",
					       &g_define_type_info,
					       0);
		g_type_add_interface_static (type, GTH_TYPE_EDIT_METADATA_PAGE, &gth_edit_comment_page_info);
	}

	return type;
}