def on_btn_update_clicked(self, widget, *args): """ Retrieve the selected tracks on the tree and update the mp3 tag of each one. Also rename the file if the column 'file' has been changed. """ self.lock_app() total_updated = self.mp3_tree.update_selected_iters() self.unlock_app() # Show finish notification if total_updated and self.config['misc']['show-notifications']: notifier.show_notification(_("Update complete"), "%03d %s" % (total_updated, _("MP3 files updated...")))
def drag_data_received_data(self, treeview, context, x, y, selection, info, etime): """ Drop data received. Handle it """ self.log.info("Drag data received") model = treeview.get_model() drop_info = treeview.get_dest_row_at_pos(x, y) dropped_mp3files = uriparser.get_mp3_files_from_uri_data(selection.data) if len(dropped_mp3files) > 0: # Append the new files in the tree self.lock_app() total_added = self.mp3_tree.add_iters(dropped_mp3files) self.unlock_app() # Show finish notification if total_added and self.config['misc']['show-notifications']: notifier.show_notification(_("Load complete"), "%03d %s" %(total_added, _("MP3 files added...")))
def on_btn_add_clicked(self, widget, *args): """ Open a FileChooserDialog and gets the selected Mp3 files from it """ self.log.info("Showing the open files dialog") # Opens the mp3 files selection dialog selected_mp3files = filechooser.selectMp3Files(self.GMusicTagger, self.config['music']['start-folder']) if len(selected_mp3files) > 0: # Append the new files in the tree self.lock_app() total_added = self.mp3_tree.add_iters(selected_mp3files) self.unlock_app() # Show finish notification if total_added and self.config['misc']['show-notifications']: notifier.show_notification(_("Load complete"), "%03d %s" %(total_added, _("MP3 files added...")))