def propertiesbutton_callback(self, choice): if choice == 'download': self.request_status_box.show_all() self._cover_search_manager = self.viewmgr.current_view.get_default_manager( ) self._cover_search_manager.cover_man.search_covers( callback=self.update_request_status_bar) elif choice == 'random': self.play_random_album_menu_item_callback() elif choice == 'random favourite': self.play_random_album_menu_item_callback(True) elif choice == 'favourite': self.favourites = not self.favourites self.viewmgr.current_view.set_popup_menu(self.popup_menu) elif choice == 'browser prefs': if not self._browser_preferences: self._browser_preferences = Preferences() self._browser_preferences.display_preferences_dialog(self.plugin) elif choice == 'search prefs': try: if not self._search_preferences: from gi.repository import Peas peas = Peas.Engine.get_default() plugin_info = peas.get_plugin_info( 'coverart_search_providers') module_name = plugin_info.get_module_name() mod = __import__(module_name) sp = getattr(mod, "SearchPreferences") self._search_preferences = sp() self._search_preferences.plugin_info = plugin_info self._search_preferences.display_preferences_dialog( self._search_preferences) except: dialog = Gtk.MessageDialog( None, Gtk.DialogFlags.MODAL, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, _("Please install and activate the latest version of the Coverart Search Providers plugin" )) dialog.run() dialog.destroy() else: assert 1 == 2, ("unknown choice %s", choice)
def _translation_helper(self): ''' a method just to help out with translation strings it is not meant to be called by itself ''' # define .plugin text strings used for translation plugin = _('CoverArt Browser') desc = _('Browse and play your albums through their covers') # . TRANSLATORS: This is the icon-grid view that the user sees tile = _('Tiles') #. TRANSLATORS: This is the cover-flow view the user sees - they can swipe album covers from side-to-side artist = _('Flow') #. TRANSLATORS: percentage size that the image will be expanded scale = _('Scale by %:') # stop PyCharm removing the Preference import on optimisation pref = Preferences()