コード例 #1
0
 def initialise(self):
     """
     Initialise variables when they cannot be initialised in the constructor.
     """
     self.song_maintenance_form = SongMaintenanceForm(self.plugin.manager, self)
     self.edit_song_form = EditSongForm(self, self.main_window, self.plugin.manager)
     self.open_lyrics = OpenLyrics(self.plugin.manager)
     self.search_text_edit.set_search_types([
         (SongSearch.Entire, ':/songs/song_search_all.png',
             translate('SongsPlugin.MediaItem', 'Entire Song'),
             translate('SongsPlugin.MediaItem', 'Search Entire Song...')),
         (SongSearch.Titles, ':/songs/song_search_title.png',
             translate('SongsPlugin.MediaItem', 'Titles'),
             translate('SongsPlugin.MediaItem', 'Search Titles...')),
         (SongSearch.Lyrics, ':/songs/song_search_lyrics.png',
             translate('SongsPlugin.MediaItem', 'Lyrics'),
             translate('SongsPlugin.MediaItem', 'Search Lyrics...')),
         (SongSearch.Authors, ':/songs/song_search_author.png', SongStrings.Authors,
             translate('SongsPlugin.MediaItem', 'Search Authors...')),
         (SongSearch.Topics, ':/songs/song_search_topic.png', SongStrings.Topics,
             translate('SongsPlugin.MediaItem', 'Search Topics...')),
         (SongSearch.Books, ':/songs/song_book_edit.png', SongStrings.SongBooks,
             translate('SongsPlugin.MediaItem', 'Search Songbooks...')),
         (SongSearch.Themes, ':/slides/slide_theme.png', UiStrings().Themes, UiStrings().SearchThemes),
         (SongSearch.Copyright, ':/songs/song_search_copy.png',
             translate('SongsPlugin.MediaItem', 'Copyright'),
             translate('SongsPlugin.MediaItem', 'Search Copyright...')),
         (SongSearch.CCLInumber, ':/songs/song_search_ccli.png',
             translate('SongsPlugin.MediaItem', 'CCLI number'),
             translate('SongsPlugin.MediaItem', 'Search CCLI number...'))
     ])
     self.search_text_edit.set_current_search_type(
         Settings().value('{section}/last search type'.format(section=self.settings_section)))
     self.config_update()
コード例 #2
0
 def initialise(self):
     """
     Initialise variables when they cannot be initialised in the constructor.
     """
     self.song_maintenance_form = SongMaintenanceForm(self.plugin.manager, self)
     self.edit_song_form = EditSongForm(self, self.main_window, self.plugin.manager)
     self.open_lyrics = OpenLyrics(self.plugin.manager)
     self.search_text_edit.set_search_types([
         (SongSearch.Entire, UiIcons().music,
             translate('SongsPlugin.MediaItem', 'Entire Song'),
             translate('SongsPlugin.MediaItem', 'Search Entire Song...')),
         (SongSearch.Titles, UiIcons().search_text,
             translate('SongsPlugin.MediaItem', 'Titles'),
             translate('SongsPlugin.MediaItem', 'Search Titles...')),
         (SongSearch.Lyrics, UiIcons().search_lyrcs,
             translate('SongsPlugin.MediaItem', 'Lyrics'),
             translate('SongsPlugin.MediaItem', 'Search Lyrics...')),
         (SongSearch.Authors, UiIcons().user, SongStrings.Authors,
             translate('SongsPlugin.MediaItem', 'Search Authors...')),
         (SongSearch.Topics, UiIcons().theme, SongStrings.Topics,
             translate('SongsPlugin.MediaItem', 'Search Topics...')),
         (SongSearch.Books, UiIcons().address, SongStrings.SongBooks,
             translate('SongsPlugin.MediaItem', 'Search Songbooks...')),
         (SongSearch.Themes, UiIcons().theme, UiStrings().Themes, UiStrings().SearchThemes),
         (SongSearch.Copyright, UiIcons().copyright,
             translate('SongsPlugin.MediaItem', 'Copyright'),
             translate('SongsPlugin.MediaItem', 'Search Copyright...')),
         (SongSearch.CCLInumber, UiIcons().search_ccli,
             translate('SongsPlugin.MediaItem', 'CCLI number'),
             translate('SongsPlugin.MediaItem', 'Search CCLI number...'))
     ])
     self.config_update()
コード例 #3
0
 def setUp(self):
     """
     Create the UI
     """
     Registry.create()
     self.setup_application()
     self.main_window = QtWidgets.QMainWindow()
     Registry().register('main_window', self.main_window)
     Registry().register('theme_manager', MagicMock())
     self.form = EditSongForm(MagicMock(), self.main_window, MagicMock())
コード例 #4
0
ファイル: test_editsongform.py プロジェクト: ipic/projecao
 def setUp(self):
     """
     Set up the components need for all tests.
     """
     Registry.create()
     Registry().register('service_list', MagicMock())
     Registry().register('main_window', MagicMock())
     with patch('openlp.plugins.songs.forms.editsongform.EditSongForm.__init__', return_value=None):
         self.edit_song_form = EditSongForm(None, MagicMock(), MagicMock())
     self.setup_application()
     self.build_settings()
     QtCore.QLocale.setDefault(QtCore.QLocale('en_GB'))
コード例 #5
0
 def setUp(self):
     """
     Create the UI
     """
     Registry.create()
     self.setup_application()
     self.main_window = QtWidgets.QMainWindow()
     Registry().register('main_window', self.main_window)
     Registry().register('theme_manager', MagicMock())
     self.build_settings()
     Settings().extend_default_settings(__default_settings__)
     Registry().register('settings', Settings())
     self.form = EditSongForm(MagicMock(), self.main_window, MagicMock())