Commit f6b54c36 authored by Sumaid Syed's avatar Sumaid Syed Committed by Carlos Soriano

nautilus-batch-rename-dialog-menu.ui: Convert .ui files that use GMenu to a separate file

The UI file nautilus-batch-rename-dialog.ui uses GMenu.

Glade currently does not support <menu> sections but
UI files with <menu> sections need to be edited.

Seperate Menu files into a different file
nautilus-batch-rename-dialog-menu.ui.

Closes #566
parent a847bf57
Pipeline #53130 passed with stages
in 7 minutes and 37 seconds
......@@ -2043,6 +2043,8 @@ nautilus_batch_rename_dialog_finalize (GObject *object)
g_clear_object (&dialog->conflict_cancellable);
}
g_clear_object (&dialog->numbering_order_menu);
g_clear_object (&dialog->add_tag_menu);
g_list_free (dialog->original_name_listbox_rows);
g_list_free (dialog->arrow_listbox_rows);
g_list_free (dialog->result_listbox_rows);
......@@ -2120,12 +2122,10 @@ nautilus_batch_rename_dialog_class_init (NautilusBatchRenameDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_order_popover);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_order_button);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_revealer);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_order_menu);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, conflict_box);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, conflict_label);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, conflict_up);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, conflict_down);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, add_tag_menu);
gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_label);
gtk_widget_class_bind_template_callback (widget_class, file_names_widget_on_activate);
......@@ -2232,6 +2232,7 @@ nautilus_batch_rename_dialog_init (NautilusBatchRenameDialog *self)
{
TagData *tag_data;
guint i;
g_autoptr (GtkBuilder) builder = NULL;
gtk_widget_init_template (GTK_WIDGET (self));
......@@ -2251,6 +2252,10 @@ nautilus_batch_rename_dialog_init (NautilusBatchRenameDialog *self)
self->mode = NAUTILUS_BATCH_RENAME_DIALOG_FORMAT;
builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/ui/nautilus-batch-rename-dialog-menu.ui");
self->numbering_order_menu = g_object_ref_sink (G_MENU (gtk_builder_get_object (builder, "numbering_order_menu")));
self->add_tag_menu = g_object_ref_sink (G_MENU (gtk_builder_get_object (builder, "add_tag_menu")));
gtk_popover_bind_model (GTK_POPOVER (self->numbering_order_popover),
G_MENU_MODEL (self->numbering_order_menu),
NULL);
......
......@@ -19,6 +19,7 @@
<file>ui/nautilus-starred-is-empty.ui</file>
<file>gtk/help-overlay.ui</file>
<file>ui/nautilus-batch-rename-dialog.ui</file>
<file>ui/nautilus-batch-rename-dialog-menu.ui</file>
<file alias="gtk/ui/nautilusgtkplacesview.ui">../gtk/nautilusgtkplacesview.ui</file>
<file alias="gtk/ui/nautilusgtkplacesviewrow.ui">../gtk/nautilusgtkplacesviewrow.ui</file>
<file alias="icons/thumbnail_frame.png">../../icons/thumbnail_frame.png</file>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<menu id="add_tag_menu">
<section>
<attribute name="label" translatable="yes">Automatic Numbers</attribute>
<item>
<attribute name="label" translatable="yes">1, 2, 3, 4</attribute>
<attribute name="action">dialog.add-numbering-no-zero-pad-tag</attribute>
</item>
<item>
<attribute name="label" translatable="yes">01, 02, 03, 04</attribute>
<attribute name="action">dialog.add-numbering-one-zero-pad-tag</attribute>
</item>
<item>
<attribute name="label" translatable="yes">001, 002, 003, 004</attribute>
<attribute name="action">dialog.add-numbering-two-zero-pad-tag</attribute>
</item>
</section>
<section>
<attribute name="label" translatable="yes">Metadata</attribute>
<item>
<attribute name="label" translatable="yes">Creation Date</attribute>
<attribute name="action">dialog.add-creation-date-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Camera Model</attribute>
<attribute name="action">dialog.add-equipment-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Season Number</attribute>
<attribute name="action">dialog.add-season-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Episode Number</attribute>
<attribute name="action">dialog.add-episode-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Track Number</attribute>
<attribute name="action">dialog.add-track-number-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Artist Name</attribute>
<attribute name="action">dialog.add-artist-name-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Title</attribute>
<attribute name="action">dialog.add-title-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Album Name</attribute>
<attribute name="action">dialog.add-album-name-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Original File Name</attribute>
<attribute name="action">dialog.add-original-file-name-tag</attribute>
</item>
</section>
</menu>
<menu id="numbering_order_menu">
<section>
<item>
<attribute name="label" translatable="yes">Original Name (Ascending)</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">name-ascending</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Original Name (Descending)</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">name-descending</attribute>
</item>
<item>
<attribute name="label" translatable="yes">First Modified</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">first-modified</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Last Modified</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">last-modified</attribute>
</item>
</section>
</menu>
</interface>
......@@ -407,72 +407,6 @@
</object>
</child>
</template>
<menu id="add_tag_menu">
<section>
<attribute name="label" translatable="yes">Automatic Numbers</attribute>
<item>
<attribute name="label" translatable="yes">1, 2, 3, 4</attribute>
<attribute name="action">dialog.add-numbering-no-zero-pad-tag</attribute>
</item>
<item>
<attribute name="label" translatable="yes">01, 02, 03, 04</attribute>
<attribute name="action">dialog.add-numbering-one-zero-pad-tag</attribute>
</item>
<item>
<attribute name="label" translatable="yes">001, 002, 003, 004</attribute>
<attribute name="action">dialog.add-numbering-two-zero-pad-tag</attribute>
</item>
</section>
<section>
<attribute name="label" translatable="yes">Metadata</attribute>
<item>
<attribute name="label" translatable="yes">Creation Date</attribute>
<attribute name="action">dialog.add-creation-date-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Camera Model</attribute>
<attribute name="action">dialog.add-equipment-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Season Number</attribute>
<attribute name="action">dialog.add-season-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Episode Number</attribute>
<attribute name="action">dialog.add-episode-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Track Number</attribute>
<attribute name="action">dialog.add-track-number-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Artist Name</attribute>
<attribute name="action">dialog.add-artist-name-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Title</attribute>
<attribute name="action">dialog.add-title-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Album Name</attribute>
<attribute name="action">dialog.add-album-name-tag</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Original File Name</attribute>
<attribute name="action">dialog.add-original-file-name-tag</attribute>
</item>
</section>
</menu>
<object class="GtkPopover" id="add_popover">
<property name="position">bottom</property>
<property name="relative-to">add_button</property>
......@@ -482,30 +416,6 @@
<property name="visible">True</property>
<property name="icon_name">object-select-symbolic</property>
</object>
<menu id="numbering_order_menu">
<section>
<item>
<attribute name="label" translatable="yes">Original Name (Ascending)</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">name-ascending</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Original Name (Descending)</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">name-descending</attribute>
</item>
<item>
<attribute name="label" translatable="yes">First Modified</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">first-modified</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Last Modified</attribute>
<attribute name="action">dialog.numbering-order-changed</attribute>
<attribute name="target">last-modified</attribute>
</item>
</section>
</menu>
<object class="GtkPopover" id="numbering_order_popover">
<property name="position">bottom</property>
<property name="relative-to">numbering_order_button</property>
......
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