diff --git a/gds-render-gui.c b/gds-render-gui.c index 9e84868..1078eda 100644 --- a/gds-render-gui.c +++ b/gds-render-gui.c @@ -298,6 +298,7 @@ static void on_convert_clicked(gpointer button, gpointer user) renderer_settings_dialog_set_database_unit_scale(settings, cell_to_render->parent_library->unit_in_meters); renderer_settings_dialog_set_cell_height(settings, height); renderer_settings_dialog_set_cell_width(settings, width); + g_object_set(G_OBJECT(settings), "cell-name", cell_to_render->name, NULL); res = gtk_dialog_run(GTK_DIALOG(settings)); if (res == GTK_RESPONSE_OK) { diff --git a/tree-renderer/lib-cell-renderer.c b/tree-renderer/lib-cell-renderer.c index c8e078a..bb7bf02 100644 --- a/tree-renderer/lib-cell-renderer.c +++ b/tree-renderer/lib-cell-renderer.c @@ -118,11 +118,12 @@ static void lib_cell_renderer_get_property(GObject *object, } } -static GParamSpec *properties [PROP_COUNT]; +static GParamSpec *properties[PROP_COUNT]; void lib_cell_renderer_class_init(LibCellRendererClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS(klass); + oclass->constructed = lib_cell_renderer_constructed; oclass->set_property = lib_cell_renderer_set_property; oclass->get_property = lib_cell_renderer_get_property; diff --git a/widgets/conv-settings-dialog.c b/widgets/conv-settings-dialog.c index 7048c6c..7884cb2 100644 --- a/widgets/conv-settings-dialog.c +++ b/widgets/conv-settings-dialog.c @@ -54,10 +54,60 @@ struct _RendererSettingsDialog { G_DEFINE_TYPE(RendererSettingsDialog, renderer_settings_dialog, GTK_TYPE_DIALOG) +enum { + PROP_CELL_NAME = 1, + PROP_COUNT +}; + +static GParamSpec *properties[PROP_COUNT]; + +static void renderer_settings_dialog_set_property(GObject *object, guint property_id, + const GValue *value, GParamSpec *pspec) +{ + const gchar *title = NULL; + + switch (property_id) { + case PROP_CELL_NAME: + title = g_value_get_string(value); + if (title) + gtk_window_set_title(GTK_WINDOW(object), title); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); + break; + } +} + +static void renderer_settings_dialog_get_property(GObject *object, guint property_id, + GValue *value, GParamSpec *pspec) +{ + const gchar *title; + + switch (property_id) { + case PROP_CELL_NAME: + title = gtk_window_get_title(GTK_WINDOW(object)); + g_value_set_string(value, title); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); + break; + } +} + static void renderer_settings_dialog_class_init(RendererSettingsDialogClass *klass) { - /* No special code needed. Child cells are destroyed automatically due to reference counter */ - return; + GObjectClass *oclass = G_OBJECT_CLASS(klass); + + /* Override virtual functions */ + oclass->set_property = renderer_settings_dialog_set_property; + oclass->get_property = renderer_settings_dialog_get_property; + + properties[PROP_CELL_NAME] = g_param_spec_string("cell-name", + "cell-name", + "Cell name to be displayed in header bar", + "", + G_PARAM_READWRITE); + g_object_class_install_properties(oclass, PROP_COUNT, properties); } static void show_tex_options(RendererSettingsDialog *self)