diff options
author | Alexandru Pandelea <alexandru.pandelea@gmail.com> | 2016-06-17 15:05:53 +0300 |
---|---|---|
committer | Alexandru Pandelea <alexandru.pandelea@gmail.com> | 2016-07-02 14:57:16 +0300 |
commit | 8f93701b28b0b6c1bae2ca90475796c51aab9e3d (patch) | |
tree | ea26c0864f74880c90757c9f6b4b73360fb7efc5 | |
parent | 03876fd9ce83e5530b13fe6421a73c2b02d5fe12 (diff) | |
download | nautilus-8f93701b28b0b6c1bae2ca90475796c51aab9e3d.tar.gz |
Override constructor
The constructor was overriden to set the use-header-bar property.
This was needed because the init function was called before the constructor,
so the property was set in the ui file, then unset by the constructor.
This was also needed because this property is construct only.
https://bugzilla.gnome.org/show_bug.cgi?id=768311
-rw-r--r-- | src/nautilus-batch-rename.c | 19 | ||||
-rw-r--r-- | src/resources/ui/nautilus-batch-rename-dialog.ui | 2 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/nautilus-batch-rename.c b/src/nautilus-batch-rename.c index 44daf7c6a..c8289ceda 100644 --- a/src/nautilus-batch-rename.c +++ b/src/nautilus-batch-rename.c @@ -420,11 +420,30 @@ file_names_widget_on_activate (NautilusBatchRename *dialog) g_list_free (new_names); } +static GObject* +nautilus_batch_rename_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_params) +{ + GObject *object; + + object = (* G_OBJECT_CLASS (nautilus_batch_rename_parent_class)->constructor) (type, + n_construct_properties, + construct_params); + + g_object_set (object,"use-header-bar",1, NULL); + + return object; +} + static void nautilus_batch_rename_class_init (NautilusBatchRenameClass *klass) { GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + GObjectClass *oclass = G_OBJECT_CLASS (klass); + + oclass->constructor = nautilus_batch_rename_constructor; dialog_class->close = batch_rename_dialog_on_closed; diff --git a/src/resources/ui/nautilus-batch-rename-dialog.ui b/src/resources/ui/nautilus-batch-rename-dialog.ui index ca8290d5b..5a6004328 100644 --- a/src/resources/ui/nautilus-batch-rename-dialog.ui +++ b/src/resources/ui/nautilus-batch-rename-dialog.ui @@ -6,8 +6,6 @@ <property name="window_position">center-on-parent</property> <property name="destroy_with_parent">True</property> <property name="title">Batch rename</property> - <property name="use-header-bar">1</property> - <child type="action"> <object class="GtkButton" id="cancel_button"> <property name="label" translatable="yes">_Cancel</property> |