diff options
author | Corey Berla <corey@berla.me> | 2022-08-21 19:47:02 -0700 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-09-01 00:02:26 +0000 |
commit | 3b0ca028ea015f4aa62f9e46d17ff53e158ae8ef (patch) | |
tree | 86566df9de5865fae784fd5dafa8081920f4d183 | |
parent | a678ab18c8b6c9e5e304724a8d9c4c4108555fa6 (diff) | |
download | nautilus-3b0ca028ea015f4aa62f9e46d17ff53e158ae8ef.tar.gz |
batch-rename-dialog: Fix default sort order
The list should be sorted by name-ascending, that state is set
when the action is created. The sort is set when the action state
is changed, and since the action state isn't changed after creation, the
sort never happens. This leads to an inconsistent state where
the list is not sorted, but the button label indicates that the list
is sorted.
Change the numbering-order state to name-ascending after the actions
are created (even though that state is already set) in order to force
list sorting.
Also remove, the default label on the sort button in order
to prevent this issue in the future (the label gets set anyways when
the state is changed).
-rw-r--r-- | src/nautilus-batch-rename-dialog.c | 5 | ||||
-rw-r--r-- | src/resources/ui/nautilus-batch-rename-dialog.ui | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c index 5eeceedcf..df6a5f8c9 100644 --- a/src/nautilus-batch-rename-dialog.c +++ b/src/nautilus-batch-rename-dialog.c @@ -1576,6 +1576,11 @@ nautilus_batch_rename_dialog_initialize_actions (NautilusBatchRenameDialog *dial check_metadata_for_selection (dialog, dialog->selection, dialog->metadata_cancellable); + + /* Make sure that the state is initialized to name-ascending */ + action = g_action_map_lookup_action (G_ACTION_MAP (dialog->action_group), + "numbering-order-changed"); + g_action_change_state (action, g_variant_new_string ("name-ascending")); } static void diff --git a/src/resources/ui/nautilus-batch-rename-dialog.ui b/src/resources/ui/nautilus-batch-rename-dialog.ui index 0b4793400..01db45181 100644 --- a/src/resources/ui/nautilus-batch-rename-dialog.ui +++ b/src/resources/ui/nautilus-batch-rename-dialog.ui @@ -216,7 +216,6 @@ <child> <object class="GtkMenuButton" id="numbering_order_button"> <property name="menu-model">numbering_order_menu</property> - <property name="label" translatable="yes">Original Name (Ascending)</property> <property name="always-show-arrow">True</property> </object> </child> |