Commit 5a03f5fa authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

use the filename if no name and date is set for the catalog

parent 7ad43247
......@@ -171,8 +171,24 @@ catalog_ready_cb (GObject *object,
data->catalog = g_object_ref (object);
if (gth_catalog_get_name (data->catalog) != NULL)
if (gth_catalog_get_name (data->catalog) != NULL) {
gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("name_entry")), gth_catalog_get_name (data->catalog));
else {
char *basename;
char *name;
char *utf8_name;
basename = g_file_get_basename (data->file_data->file);
name = _g_uri_remove_extension (basename);
utf8_name = g_filename_to_utf8 (name, -1, NULL, NULL, NULL);
gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("name_entry")), utf8_name);
g_free (utf8_name);
g_free (name);
g_free (basename);
gth_time_selector_set_value (GTH_TIME_SELECTOR (data->time_selector), gth_catalog_get_date (data->catalog));
gth_hook_invoke ("dlg-catalog-properties", data->builder, data->file_data, data->catalog);
gtk_widget_show (data->dialog);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment