ClientGUIMenus.AppendMenuLabel(duplicates_menu,'cannot show the best quality file of this file\'s group here, it is not in this domain','The king of this group has probably been deleted from this domain.')
else:
ClientGUIMenus.AppendMenuItem(duplicates_menu,'show the best quality file of this file\'s group','Load up a new search with this file\'s best quality duplicate.',ClientGUIMedia.ShowDuplicatesInNewPage,job_location_context,focused_hash,HC.DUPLICATE_KING)
ClientGUIMenus.AppendMenuItem(duplicates_menu,label,'Show these duplicates in a new page.',ClientGUIMedia.ShowDuplicatesInNewPage,job_location_context,focused_hash,duplicate_type)
ClientGUIMenus.AppendMenuLabel(duplicates_action_submenu,'could not fetch info to check for available file actions (db currently locked)')
else:
ifnotfocus_is_definitely_king:
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,'set this file as the best quality of its group','Set the focused media to be the King of its group.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_FOCUSED_KING))
label='set this file as better than the '+HydrusData.ToHumanInt(num_selected-1)+' other selected'
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,label,'Set the focused media to be better than the other selected files.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_FOCUSED_BETTER))
num_pairs=num_selected*(num_selected-1)/2# com // ations -- n!/2(n-2)!
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,'set all selected as same quality duplicates','Set all the selected files as same quality duplicates.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_SAME_QUALITY))
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,'set all selected as alternates','Set all the selected files as alternates.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_ALTERNATE))
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,'set a relationship with custom metadata merge options','Choose which duplicates status to set to this selection and customise non-default duplicate metadata merge options.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_CUSTOM))
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,'set selected collections as groups of alternates','Set files in the selection which are collected together as alternates.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_ALTERNATE_COLLECTIONS))
ClientGUIMenus.AppendMenuItem(duplicates_edit_action_submenu,'for '+HC.duplicate_type_string_lookup[duplicate_type],'Edit what happens when you set this status.',ClientGUIMedia.EditDuplicateContentMergeOptions,win,duplicate_type)
ClientGUIMenus.AppendMenuItem(duplicates_edit_action_submenu,'for '+HC.duplicate_type_string_lookup[HC.DUPLICATE_ALTERNATE]+' (advanced!)','Edit what happens when you set this status.',ClientGUIMedia.EditDuplicateContentMergeOptions,win,HC.DUPLICATE_ALTERNATE)
ClientGUIMenus.AppendMenuItem(duplicates_action_submenu,'set all possible pair combinations as \'potential\' duplicates for the duplicates filter.','Queue all these files up in the duplicates filter.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_SET_POTENTIAL))
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'schedule this file to be searched for potentials again','Queue this file for another potentials search. Will not remove any existing potentials.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_RESET_FOCUSED_POTENTIAL_SEARCH))
iffocus_has_potentials:
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'remove this file\'s potential relationships','Clear out this file\'s potential relationships.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_REMOVE_FOCUSED_POTENTIALS))
iffocus_is_in_duplicate_group:
ifnotfocus_is_definitely_king:
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'remove this file from its duplicate group','Extract this file from its duplicate group and reset its search status.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_REMOVE_FOCUSED_FROM_DUPLICATE_GROUP))
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'dissolve this file\'s duplicate group completely','Completely eliminate this file\'s duplicate group and reset all files\' search status.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_DISSOLVE_FOCUSED_DUPLICATE_GROUP))
iffocus_is_in_alternate_group:
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'remove this file from its alternate group','Extract this file\'s duplicate group from its alternate group and reset the duplicate group\'s search status.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_REMOVE_FOCUSED_FROM_ALTERNATE_GROUP))
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'dissolve this file\'s alternate group completely','Completely eliminate this file\'s alternate group and all duplicate group members. This resets search status for all involved files.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_DISSOLVE_FOCUSED_ALTERNATE_GROUP))
iffocus_has_fps:
ClientGUIMenus.AppendMenuItem(duplicates_single_dissolution_menu,'delete all false-positive relationships this file\'s alternate group has with other groups','Clear out all false-positive relationships this file\'s alternates group has with other groups and resets search status.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_CLEAR_FOCUSED_FALSE_POSITIVES))
ClientGUIMenus.AppendMenu(duplicates_action_submenu,duplicates_single_dissolution_menu,'remove/reset for this file')
ClientGUIMenus.AppendMenuItem(duplicates_multiple_dissolution_menu,'schedule these files to be searched for potentials again','Queue these files for another potentials search. Will not remove any existing potentials.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_RESET_POTENTIAL_SEARCH))
ClientGUIMenus.AppendMenuItem(duplicates_multiple_dissolution_menu,'remove these files\' potential relationships','Clear out these files\' potential relationships.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_REMOVE_POTENTIALS))
ClientGUIMenus.AppendMenuItem(duplicates_multiple_dissolution_menu,'dissolve these files\' duplicate groups completely','Completely eliminate these files\' duplicate groups and reset all files\' search status.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_DISSOLVE_DUPLICATE_GROUP))
ClientGUIMenus.AppendMenuItem(duplicates_multiple_dissolution_menu,'dissolve these files\' alternate groups completely','Completely eliminate these files\' alternate groups and all duplicate group members. This resets search status for all involved files.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_DISSOLVE_ALTERNATE_GROUP))
ClientGUIMenus.AppendMenuItem(duplicates_multiple_dissolution_menu,'delete all false-positive relationships these files\' alternate groups have with other groups','Clear out all false-positive relationships these files\' alternates groups has with other groups and resets search status.',win.ProcessApplicationCommand,CAC.ApplicationCommand.STATICCreateSimpleCommand(CAC.SIMPLE_DUPLICATE_MEDIA_CLEAR_FALSE_POSITIVES))
ClientGUIMenus.AppendMenu(duplicates_action_submenu,duplicates_multiple_dissolution_menu,'remove/reset for all selected')
multiple_or_unmatching_focus_url_classes=len(focus_unmatched_urls)>0andlen(focus_labels_and_urls)>1# if there are unmatched urls and more than one thing total
label='open files\''+url_class.GetName()+' urls in your web browser'
ClientGUIMenus.AppendMenuItem(urls_visit_menu,label,'Open this url class in your web browser for all files.',ClientGUIMedia.OpenMediaURLClassURLs,selected_media,url_class)
label='copy files\''+url_class.GetName()+' urls'
ClientGUIMenus.AppendMenuItem(urls_copy_menu,label,'Copy this url class for all files.',ClientGUIMedia.CopyMediaURLClassURLs,selected_media,url_class)
# now everything
ifmultiple_or_unmatching_selection_url_classes:
label='open all files\' urls'
ClientGUIMenus.AppendMenuItem(urls_visit_menu,label,'Open urls in your web browser for all files.',ClientGUIMedia.OpenMediaURLs,selected_media)
label='copy all files\' urls'
ClientGUIMenus.AppendMenuItem(urls_copy_menu,label,'Copy urls for all files.',ClientGUIMedia.CopyMediaURLs,selected_media)
ClientGUIMenus.AppendMenuItem(submenu,'clear','Clear all the recorded file viewing stats for the selected files.',ClientGUIMedia.DoClearFileViewingStats,win,flat_medias)