def on_btn_remove_clicked(self, widget, *args): """ Clear the selected files in the tree. Also remove them from the core """ self.log.info("Clearing the selected files in the tree/core") # Get selected filenames selected_mp3_files = self.mp3_tree.get_selected_mp3_files() # If some of them are pending to update, ask the user what to do selected_pending_to_update = self.mp3_tree.pending_files_to_update(selected_mp3_files) remove_them = False if len(selected_pending_to_update) > 0: user_answer = message.question(_("Cleaning mp3 files"), _("Some selected <i>mp3</i> files are pending to update. Clean selected files anyway?"), self.GMusicTagger) if user_answer: remove_them = True else: remove_them = True # Finally if all agree, remove the selected files if remove_them: self.mp3_tree.remove_selected_iters() # Refresh the row APIC self.flush_active_row_mp3_apic()
def on_GMusicTagger_delete_event(self, widget, *args): """ Check if one or more files are pending to be updated. Then, ask to the user for cancel or continue exiting the program """ stop_exit = False if self.mp3_tree.is_any_pending_to_update(): self.log.warning("Some files still pending for update. Continue?") user_answer = message.question(_("Exiting..."), _("Some files are pending to update. Continue exiting?"), self.GMusicTagger) if not user_answer: stop_exit = True return stop_exit
def on_btn_fill_clicked(self, widget, *args): """ Apply the selected generic tag frames to the selected files on the tree """ self.log.debug("Apply generic tag button clicked") apply_generic_tag = message.question(_("Apply generic tag"), _("The generic tag is going to be applied on all the <i>mp3</i> files selected. Are you sure?"), self.GMusicTagger) if apply_generic_tag: self.log.info("Applying the selected generic tag frames") generic_tag_values = self.get_generic_tag_frame_values() self.mp3_tree.apply_generic_tag_on_selected(generic_tag_values)