Merge lp:~meths/openlp/userinterface into lp:openlp

Proposed by Jon Tibble
Status: Merged
Merged at revision: not available
Proposed branch: lp:~meths/openlp/userinterface
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~meths/openlp/userinterface
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+11885@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jon Tibble (meths) wrote :

Reduce dead space in the UI (not including NACKd button resizing)

Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
Revision history for this message
Tim Bentley (trb143) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-07-13 20:08:43 +0000
+++ .bzrignore 2009-09-15 18:56:56 +0000
@@ -1,6 +1,5 @@
1*.pyc1*.pyc
2*.*~2*.*~
3*.log
4\#*\#3\#*\#
5*.eric4project4*.eric4project
6*.ropeproject5*.ropeproject
@@ -10,3 +9,4 @@
10openlp.org 2.0.e4*9openlp.org 2.0.e4*
11documentation/build/html10documentation/build/html
12documentation/build/doctrees11documentation/build/doctrees
12*.log*
1313
=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py 2009-09-12 17:24:16 +0000
+++ openlp/core/lib/toolbar.py 2009-09-15 18:56:56 +0000
@@ -39,11 +39,13 @@
39 QtGui.QToolBar.__init__(self, None)39 QtGui.QToolBar.__init__(self, None)
40 # useful to be able to reuse button icons...40 # useful to be able to reuse button icons...
41 self.icons = {}41 self.icons = {}
42 self.setIconSize(QtCore.QSize(20, 20))
42 self.actions = {}43 self.actions = {}
43 self.log = logging.getLogger(u'OpenLPToolbar')44 self.log = logging.getLogger(u'OpenLPToolbar')
44 self.log.debug(u'Init done')45 self.log.debug(u'Init done')
4546
46 def addToolbarButton(self, title, icon, tooltip=None, slot=None, objectname=None):47 def addToolbarButton(self, title, icon, tooltip=None, slot=None,
48 objectname=None):
47 """49 """
48 A method to help developers easily add a button to the toolbar.50 A method to help developers easily add a button to the toolbar.
4951
@@ -73,8 +75,8 @@
73 ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,75 ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
74 QtGui.QIcon.Off)76 QtGui.QIcon.Off)
75 else:77 else:
76 ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),78 ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(
77 QtGui.QIcon.Normal, QtGui.QIcon.Off)79 QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off)
78 if ButtonIcon is not None:80 if ButtonIcon is not None:
79 if slot is not None:81 if slot is not None:
80 ToolbarButton = self.addAction(ButtonIcon, title, slot)82 ToolbarButton = self.addAction(ButtonIcon, title, slot)
8183
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-09-15 19:06:40 +0000
+++ openlp/core/ui/slidecontroller.py 2009-09-15 20:06:39 +0000
@@ -157,13 +157,13 @@
157 self.DelaySpinBox.setSuffix(translate(u'SlideController', u's'))157 self.DelaySpinBox.setSuffix(translate(u'SlideController', u's'))
158158
159 self.ControllerLayout.addWidget(self.Toolbar)159 self.ControllerLayout.addWidget(self.Toolbar)
160 sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,160 #sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
161 QtGui.QSizePolicy.Fixed)161 # QtGui.QSizePolicy.Fixed)
162 sizeToolbarPolicy.setHorizontalStretch(0)162 #sizeToolbarPolicy.setHorizontalStretch(0)
163 sizeToolbarPolicy.setVerticalStretch(0)163 #sizeToolbarPolicy.setVerticalStretch(0)
164 sizeToolbarPolicy.setHeightForWidth(164 #sizeToolbarPolicy.setHeightForWidth(
165 self.Toolbar.sizePolicy().hasHeightForWidth())165 # self.Toolbar.sizePolicy().hasHeightForWidth())
166 self.Toolbar.setSizePolicy(sizeToolbarPolicy)166 #self.Toolbar.setSizePolicy(sizeToolbarPolicy)
167 # Screen preview area167 # Screen preview area
168 self.PreviewFrame = QtGui.QFrame(self.Splitter)168 self.PreviewFrame = QtGui.QFrame(self.Splitter)
169 self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))169 self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
170170
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-09-12 17:24:16 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-09-16 10:50:13 +0000
@@ -59,42 +59,43 @@
59 self.addToolbar()59 self.addToolbar()
60 # Create buttons for the toolbar60 # Create buttons for the toolbar
61 ## New Bible Button ##61 ## New Bible Button ##
62 self.addToolbarButton(62 self.addToolbarButton(translate(u'BibleMediaItem', u'New Bible'),
63 translate(u'BibleMediaItem',u'New Bible'),63 translate(u'BibleMediaItem', u'Register a new Bible'),
64 translate(u'BibleMediaItem',u'Register a new Bible'),
65 u':/themes/theme_import.png', self.onBibleNewClick, u'BibleNewItem')64 u':/themes/theme_import.png', self.onBibleNewClick, u'BibleNewItem')
66 ## Separator Line ##65 ## Separator Line ##
67 self.addToolbarSeparator()66 self.addToolbarSeparator()
68 ## Preview Bible Button ##67 ## Preview Bible Button ##
69 self.addToolbarButton(68 self.addToolbarButton(translate(u'BibleMediaItem', u'Preview Bible'),
70 translate(u'BibleMediaItem',u'Preview Bible'),69 translate(u'BibleMediaItem', u'Preview the selected Bible Verse'),
71 translate(u'BibleMediaItem',u'Preview the selected Bible Verse'),70 u':/system/system_preview.png', self.onPreviewClick,
72 u':/system/system_preview.png', self.onPreviewClick, u'BiblePreviewItem')71 u'BiblePreviewItem')
73 ## Live Bible Button ##72 ## Live Bible Button ##
74 self.addToolbarButton(73 self.addToolbarButton(translate(u'BibleMediaItem',u'Go Live'),
75 translate(u'BibleMediaItem',u'Go Live'),74 translate(u'BibleMediaItem',
76 translate(u'BibleMediaItem',u'Send the selected Bible Verse(s) live'),75 u'Send the selected Bible Verse(s) live'),
77 u':/system/system_live.png', self.onLiveClick, u'BibleLiveItem')76 u':/system/system_live.png', self.onLiveClick, u'BibleLiveItem')
78 ## Add Bible Button ##77 ## Add Bible Button ##
79 self.addToolbarButton(78 self.addToolbarButton(
80 translate(u'BibleMediaItem',u'Add Bible Verse(s) To Service'),79 translate(u'BibleMediaItem', u'Add Bible Verse(s) To Service'),
81 translate(u'BibleMediaItem',u'Add the selected Bible(s) to the service'),80 translate(u'BibleMediaItem',
82 u':/system/system_add.png',81 u'Add the selected Bible(s) to the service'),
83 self.onAddClick, u'BibleAddItem')82 u':/system/system_add.png', self.onAddClick, u'BibleAddItem')
84 # Create the tab widget83 # Create the tab widget
85 self.SearchTabWidget = QtGui.QTabWidget(self)84 self.SearchTabWidget = QtGui.QTabWidget(self)
86 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)85 sizePolicy = QtGui.QSizePolicy(
86 QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
87 sizePolicy.setHorizontalStretch(0)87 sizePolicy.setHorizontalStretch(0)
88 sizePolicy.setVerticalStretch(0)88 sizePolicy.setVerticalStretch(0)
89 sizePolicy.setHeightForWidth(self.SearchTabWidget.sizePolicy().hasHeightForWidth())89 sizePolicy.setHeightForWidth(
90 self.SearchTabWidget.sizePolicy().hasHeightForWidth())
90 self.SearchTabWidget.setSizePolicy(sizePolicy)91 self.SearchTabWidget.setSizePolicy(sizePolicy)
91 self.SearchTabWidget.setObjectName(u'SearchTabWidget')92 self.SearchTabWidget.setObjectName(u'SearchTabWidget')
92 # Add the Quick Search tab93 # Add the Quick Search tab
93 self.QuickTab = QtGui.QWidget()94 self.QuickTab = QtGui.QWidget()
94 self.QuickTab.setObjectName(u'QuickTab')95 self.QuickTab.setObjectName(u'QuickTab')
95 self.QuickLayout = QtGui.QGridLayout(self.QuickTab)96 self.QuickLayout = QtGui.QGridLayout(self.QuickTab)
96 self.QuickLayout.setMargin(8)97 self.QuickLayout.setMargin(5)
97 self.QuickLayout.setSpacing(8)98 self.QuickLayout.setSpacing(4)
98 self.QuickLayout.setObjectName(u'QuickLayout')99 self.QuickLayout.setObjectName(u'QuickLayout')
99 self.QuickVersionLabel = QtGui.QLabel(self.QuickTab)100 self.QuickVersionLabel = QtGui.QLabel(self.QuickTab)
100 self.QuickVersionLabel.setObjectName(u'QuickVersionLabel')101 self.QuickVersionLabel.setObjectName(u'QuickVersionLabel')
@@ -137,8 +138,8 @@
137 self.AdvancedTab = QtGui.QWidget()138 self.AdvancedTab = QtGui.QWidget()
138 self.AdvancedTab.setObjectName(u'AdvancedTab')139 self.AdvancedTab.setObjectName(u'AdvancedTab')
139 self.AdvancedLayout = QtGui.QGridLayout(self.AdvancedTab)140 self.AdvancedLayout = QtGui.QGridLayout(self.AdvancedTab)
140 self.AdvancedLayout.setMargin(8)141 self.AdvancedLayout.setMargin(5)
141 self.AdvancedLayout.setSpacing(8)142 self.AdvancedLayout.setSpacing(4)
142 self.AdvancedLayout.setObjectName(u'AdvancedLayout')143 self.AdvancedLayout.setObjectName(u'AdvancedLayout')
143 self.AdvancedVersionLabel = QtGui.QLabel(self.AdvancedTab)144 self.AdvancedVersionLabel = QtGui.QLabel(self.AdvancedTab)
144 self.AdvancedVersionLabel.setObjectName(u'AdvancedVersionLabel')145 self.AdvancedVersionLabel.setObjectName(u'AdvancedVersionLabel')
@@ -180,8 +181,10 @@
180 self.AdvancedClearLabel.setObjectName(u'QuickSearchLabel')181 self.AdvancedClearLabel.setObjectName(u'QuickSearchLabel')
181 self.AdvancedLayout.addWidget(self.AdvancedClearLabel, 5, 0, 1, 1)182 self.AdvancedLayout.addWidget(self.AdvancedClearLabel, 5, 0, 1, 1)
182 self.ClearAdvancedSearchComboBox = QtGui.QComboBox(self.QuickTab)183 self.ClearAdvancedSearchComboBox = QtGui.QComboBox(self.QuickTab)
183 self.ClearAdvancedSearchComboBox.setObjectName(u'ClearAdvancedSearchComboBox')184 self.ClearAdvancedSearchComboBox.setObjectName(
184 self.AdvancedLayout.addWidget(self.ClearAdvancedSearchComboBox, 5, 2, 1, 1)185 u'ClearAdvancedSearchComboBox')
186 self.AdvancedLayout.addWidget(
187 self.ClearAdvancedSearchComboBox, 5, 2, 1, 1)
185 self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab)188 self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab)
186 self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton')189 self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton')
187 self.AdvancedLayout.addWidget(self.AdvancedSearchButton, 5, 3, 1, 1)190 self.AdvancedLayout.addWidget(self.AdvancedSearchButton, 5, 3, 1, 1)
@@ -190,7 +193,8 @@
190 self.PageLayout.addWidget(self.SearchTabWidget)193 self.PageLayout.addWidget(self.SearchTabWidget)
191 self.ListView = BibleListView()194 self.ListView = BibleListView()
192 self.ListView.setAlternatingRowColors(True)195 self.ListView.setAlternatingRowColors(True)
193 self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)196 self.ListView.setSelectionMode(
197 QtGui.QAbstractItemView.ExtendedSelection)
194 self.ListView.setDragEnabled(True)198 self.ListView.setDragEnabled(True)
195 self.PageLayout.addWidget(self.ListView)199 self.PageLayout.addWidget(self.ListView)
196 # Combo Boxes200 # Combo Boxes
@@ -215,7 +219,8 @@
215 self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)219 self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
216 self.ListView.addAction(contextMenuAction(220 self.ListView.addAction(contextMenuAction(
217 self.ListView, u':/system/system_preview.png',221 self.ListView, u':/system/system_preview.png',
218 translate(u'BibleMediaItem',u'&Preview Verse'), self.onPreviewClick))222 translate(u'BibleMediaItem',u'&Preview Verse'),
223 self.onPreviewClick))
219 self.ListView.addAction(contextMenuAction(224 self.ListView.addAction(contextMenuAction(
220 self.ListView, u':/system/system_live.png',225 self.ListView, u':/system/system_live.png',
221 translate(u'BibleMediaItem',u'&Show Live'), self.onLiveClick))226 translate(u'BibleMediaItem',u'&Show Live'), self.onLiveClick))
@@ -225,25 +230,37 @@
225230
226 def retranslateUi(self):231 def retranslateUi(self):
227 log.debug(u'retranslateUi')232 log.debug(u'retranslateUi')
228 self.QuickVersionLabel.setText(translate(u'BibleMediaItem', u'Version:'))233 self.QuickVersionLabel.setText(
229 self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Search Type:'))234 translate(u'BibleMediaItem', u'Version:'))
235 self.QuickSearchLabel.setText(
236 translate(u'BibleMediaItem', u'Search Type:'))
230 self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Find:'))237 self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Find:'))
231 self.QuickSearchButton.setText(translate(u'BibleMediaItem', u'Search'))238 self.QuickSearchButton.setText(translate(u'BibleMediaItem', u'Search'))
232 self.QuickClearLabel.setText(translate(u'BibleMediaItem', u'Results:'))239 self.QuickClearLabel.setText(translate(u'BibleMediaItem', u'Results:'))
233 self.AdvancedVersionLabel.setText(translate(u'BibleMediaItem', u'Version:'))240 self.AdvancedVersionLabel.setText(
241 translate(u'BibleMediaItem', u'Version:'))
234 self.AdvancedBookLabel.setText(translate(u'BibleMediaItem', u'Book:'))242 self.AdvancedBookLabel.setText(translate(u'BibleMediaItem', u'Book:'))
235 self.AdvancedChapterLabel.setText(translate(u'BibleMediaItem', u'Chapter:'))243 self.AdvancedChapterLabel.setText(
244 translate(u'BibleMediaItem', u'Chapter:'))
236 self.AdvancedVerseLabel.setText(translate(u'BibleMediaItem', u'Verse:'))245 self.AdvancedVerseLabel.setText(translate(u'BibleMediaItem', u'Verse:'))
237 self.AdvancedFromLabel.setText(translate(u'BibleMediaItem', u'From:'))246 self.AdvancedFromLabel.setText(translate(u'BibleMediaItem', u'From:'))
238 self.AdvancedToLabel.setText(translate(u'BibleMediaItem', u'To:'))247 self.AdvancedToLabel.setText(translate(u'BibleMediaItem', u'To:'))
239 self.AdvancedClearLabel.setText(translate(u'BibleMediaItem', u'Results:'))248 self.AdvancedClearLabel.setText(
240 self.AdvancedSearchButton.setText(translate(u'BibleMediaItem', u'Search'))249 translate(u'BibleMediaItem', u'Results:'))
241 self.QuickSearchComboBox.addItem(translate(u'BibleMediaItem', u'Verse Search'))250 self.AdvancedSearchButton.setText(
242 self.QuickSearchComboBox.addItem(translate(u'BibleMediaItem', u'Text Search'))251 translate(u'BibleMediaItem', u'Search'))
243 self.ClearQuickSearchComboBox.addItem(translate(u'BibleMediaItem', u'Clear'))252 self.QuickSearchComboBox.addItem(
244 self.ClearQuickSearchComboBox.addItem(translate(u'BibleMediaItem', u'Keep'))253 translate(u'BibleMediaItem', u'Verse Search'))
245 self.ClearAdvancedSearchComboBox.addItem(translate(u'BibleMediaItem', u'Clear'))254 self.QuickSearchComboBox.addItem(
246 self.ClearAdvancedSearchComboBox.addItem(translate(u'BibleMediaItem', u'Keep'))255 translate(u'BibleMediaItem', u'Text Search'))
256 self.ClearQuickSearchComboBox.addItem(
257 translate(u'BibleMediaItem', u'Clear'))
258 self.ClearQuickSearchComboBox.addItem(
259 translate(u'BibleMediaItem', u'Keep'))
260 self.ClearAdvancedSearchComboBox.addItem(
261 translate(u'BibleMediaItem', u'Clear'))
262 self.ClearAdvancedSearchComboBox.addItem(
263 translate(u'BibleMediaItem', u'Keep'))
247264
248 def initialise(self):265 def initialise(self):
249 log.debug(u'initialise')266 log.debug(u'initialise')
@@ -279,14 +296,17 @@
279 self.initialiseBible(bible)296 self.initialiseBible(bible)
280297
281 def onAdvancedVersionComboBox(self):298 def onAdvancedVersionComboBox(self):
282 self.initialiseBible(unicode(self.AdvancedVersionComboBox.currentText()))299 self.initialiseBible(
300 unicode(self.AdvancedVersionComboBox.currentText()))
283301
284 def onAdvancedBookComboBox(self):302 def onAdvancedBookComboBox(self):
285 self.initialiseChapterVerse(unicode(self.AdvancedVersionComboBox.currentText()),303 self.initialiseChapterVerse(
304 unicode(self.AdvancedVersionComboBox.currentText()),
286 unicode(self.AdvancedBookComboBox.currentText()))305 unicode(self.AdvancedBookComboBox.currentText()))
287306
288 def onBibleNewClick(self):307 def onBibleNewClick(self):
289 self.bibleimportform = BibleImportForm(self.parent.config, self.parent.biblemanager, self)308 self.bibleimportform = BibleImportForm(
309 self.parent.config, self.parent.biblemanager, self)
290 self.bibleimportform.exec_()310 self.bibleimportform.exec_()
291 self.reloadBibles()311 self.reloadBibles()
292312
@@ -301,8 +321,9 @@
301 bible = unicode(self.AdvancedVersionComboBox.currentText())321 bible = unicode(self.AdvancedVersionComboBox.currentText())
302 book = unicode(self.AdvancedBookComboBox.currentText())322 book = unicode(self.AdvancedBookComboBox.currentText())
303 # get the verse count for new chapter323 # get the verse count for new chapter
304 vse = self.parent.biblemanager.get_book_verse_count(bible, book, int(t2))[0]324 verses = self.parent.biblemanager.get_book_verse_count(
305 self.adjustComboBox(1, vse, self.AdvancedToVerse)325 bible, book, int(t2))[0]
326 self.adjustComboBox(1, verses, self.AdvancedToVerse)
306327
307 def onAdvancedSearchButton(self):328 def onAdvancedSearchButton(self):
308 log.debug(u'Advanced Search Button pressed')329 log.debug(u'Advanced Search Button pressed')
@@ -312,8 +333,8 @@
312 chapter_to = int(self.AdvancedToChapter.currentText())333 chapter_to = int(self.AdvancedToChapter.currentText())
313 verse_from = int(self.AdvancedFromVerse.currentText())334 verse_from = int(self.AdvancedFromVerse.currentText())
314 verse_to = int(self.AdvancedToVerse.currentText())335 verse_to = int(self.AdvancedToVerse.currentText())
315 self.search_results = self.parent.biblemanager.get_verse_text(bible, book,336 self.search_results = self.parent.biblemanager.get_verse_text(
316 chapter_from, chapter_to, verse_from, verse_to)337 bible, book, chapter_from, chapter_to, verse_from, verse_to)
317 if self.ClearAdvancedSearchComboBox.currentIndex() == 0:338 if self.ClearAdvancedSearchComboBox.currentIndex() == 0:
318 self.ListView.clear()339 self.ListView.clear()
319 self.displayResults(bible)340 self.displayResults(bible)
320341
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-09-08 19:58:05 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-09-16 10:50:13 +0000
@@ -50,7 +50,8 @@
50 self.ConfigSection = u'song'50 self.ConfigSection = u'song'
51 MediaManagerItem.__init__(self, parent, icon, title)51 MediaManagerItem.__init__(self, parent, icon, title)
52 self.edit_song_form = EditSongForm(self.parent.songmanager, self)52 self.edit_song_form = EditSongForm(self.parent.songmanager, self)
53 self.song_maintenance_form = SongMaintenanceForm(self.parent.songmanager, self)53 self.song_maintenance_form = SongMaintenanceForm(
54 self.parent.songmanager, self)
5455
55 def setupUi(self):56 def setupUi(self):
56 # Add a toolbar57 # Add a toolbar
@@ -73,30 +74,39 @@
73 ## Preview Song Button ##74 ## Preview Song Button ##
74 self.addToolbarButton(translate(u'SongMediaItem', u'Preview Song'),75 self.addToolbarButton(translate(u'SongMediaItem', u'Preview Song'),
75 translate(u'SongMediaItem', u'Preview the selected song'),76 translate(u'SongMediaItem', u'Preview the selected song'),
76 ':/system/system_preview.png', self.onPreviewClick, 'SongPreviewItem')77 ':/system/system_preview.png', self.onPreviewClick,
78 'SongPreviewItem')
77 ## Live Song Button ##79 ## Live Song Button ##
78 self.addToolbarButton(translate(u'SongMediaItem', u'Go Live'),80 self.addToolbarButton(translate(u'SongMediaItem', u'Go Live'),
79 translate(u'SongMediaItem', u'Send the selected song live'),81 translate(u'SongMediaItem', u'Send the selected song live'),
80 ':/system/system_live.png', self.onLiveClick, 'SongLiveItem')82 ':/system/system_live.png', self.onLiveClick, 'SongLiveItem')
81 ## Add Song Button ##83 ## Add Song Button ##
82 self.addToolbarButton(translate(u'SongMediaItem', u'Add Song To Service'),84 self.addToolbarButton(
83 translate(u'SongMediaItem', u'Add the selected song(s) to the service'),85 translate(u'SongMediaItem', u'Add Song To Service'),
86 translate(u'SongMediaItem',
87 u'Add the selected song(s) to the service'),
84 ':/system/system_add.png', self.onAddClick, 'SongAddItem')88 ':/system/system_add.png', self.onAddClick, 'SongAddItem')
85 self.addToolbarSeparator()89 self.addToolbarSeparator()
86 ## Song Maintenance Button ##90 ## Song Maintenance Button ##
87 self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'),91 self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'),
88 translate(u'SongMediaItem', u'Maintain the lists of authors, topics and books'),92 translate(u'SongMediaItem',
89 ':/songs/song_maintenance.png', self.onSongMaintenanceClick, 'SongMaintenanceItem')93 u'Maintain the lists of authors, topics and books'),
94 ':/songs/song_maintenance.png', self.onSongMaintenanceClick,
95 'SongMaintenanceItem')
90 ## Add the SongListView widget ##96 ## Add the SongListView widget ##
91 # Create the tab widget97 # Create the tab widget
92 self.SongWidget = QtGui.QWidget(self)98 self.SongWidget = QtGui.QWidget(self)
93 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)99 sizePolicy = QtGui.QSizePolicy(
100 QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
94 sizePolicy.setHorizontalStretch(0)101 sizePolicy.setHorizontalStretch(0)
95 sizePolicy.setVerticalStretch(0)102 sizePolicy.setVerticalStretch(0)
96 sizePolicy.setHeightForWidth(self.SongWidget.sizePolicy().hasHeightForWidth())103 sizePolicy.setHeightForWidth(
104 self.SongWidget.sizePolicy().hasHeightForWidth())
97 self.SongWidget.setSizePolicy(sizePolicy)105 self.SongWidget.setSizePolicy(sizePolicy)
98 self.SongWidget.setObjectName(u'SongWidget')106 self.SongWidget.setObjectName(u'SongWidget')
99 self.SearchLayout = QtGui.QGridLayout(self.SongWidget)107 self.SearchLayout = QtGui.QGridLayout(self.SongWidget)
108 self.SearchLayout.setMargin(5)
109 self.SearchLayout.setSpacing(4)
100 self.SearchLayout.setObjectName(u'SearchLayout')110 self.SearchLayout.setObjectName(u'SearchLayout')
101 self.SearchTypeComboBox = QtGui.QComboBox(self.SongWidget)111 self.SearchTypeComboBox = QtGui.QComboBox(self.SongWidget)
102 self.SearchTypeComboBox.setObjectName(u'SearchTypeComboBox')112 self.SearchTypeComboBox.setObjectName(u'SearchTypeComboBox')
@@ -130,7 +140,8 @@
130 QtCore.QObject.connect(self.ClearTextButton,140 QtCore.QObject.connect(self.ClearTextButton,
131 QtCore.SIGNAL(u'pressed()'), self.onClearTextButtonClick)141 QtCore.SIGNAL(u'pressed()'), self.onClearTextButtonClick)
132 QtCore.QObject.connect(self.SearchTextEdit,142 QtCore.QObject.connect(self.SearchTextEdit,
133 QtCore.SIGNAL(u'textChanged(const QString&)'), self.onSearchTextEditChanged)143 QtCore.SIGNAL(u'textChanged(const QString&)'),
144 self.onSearchTextEditChanged)
134 QtCore.QObject.connect(self.ListView,145 QtCore.QObject.connect(self.ListView,
135 QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick)146 QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick)
136 QtCore.QObject.connect(Receiver.get_receiver(),147 QtCore.QObject.connect(Receiver.get_receiver(),
@@ -143,18 +154,20 @@
143 self.onSongEditClick))154 self.onSongEditClick))
144 self.ListView.addAction(contextMenuSeparator(self.ListView))155 self.ListView.addAction(contextMenuSeparator(self.ListView))
145 self.ListView.addAction(contextMenuAction(self.ListView,156 self.ListView.addAction(contextMenuAction(self.ListView,
146 ':/system/system_preview.png', translate(u'SongMediaItem', u'&Preview Song'),157 ':/system/system_preview.png',
147 self.onPreviewClick))158 translate(u'SongMediaItem', u'&Preview Song'), self.onPreviewClick))
148 self.ListView.addAction(contextMenuAction(self.ListView,159 self.ListView.addAction(contextMenuAction(self.ListView,
149 ':/system/system_live.png', translate(u'SongMediaItem', u'&Show Live'),160 ':/system/system_live.png',
150 self.onLiveClick))161 translate(u'SongMediaItem', u'&Show Live'), self.onLiveClick))
151 self.ListView.addAction(contextMenuAction(self.ListView,162 self.ListView.addAction(contextMenuAction(self.ListView,
152 ':/system/system_add.png', translate(u'SongMediaItem', u'&Add to Service'),163 ':/system/system_add.png',
153 self.onAddClick))164 translate(u'SongMediaItem', u'&Add to Service'), self.onAddClick))
154165
155 def retranslateUi(self):166 def retranslateUi(self):
156 self.SearchTypeLabel.setText(translate(u'SongMediaItem', u'Search Type:'))167 self.SearchTypeLabel.setText(
157 self.SearchTextLabel.setText(translate(u'SongMediaItem', u'Search Text:'))168 translate(u'SongMediaItem', u'Search Type:'))
169 self.SearchTextLabel.setText(
170 translate(u'SongMediaItem', u'Search Text:'))
158 self.ClearTextButton.setText(translate(u'SongMediaItem', u'Clear'))171 self.ClearTextButton.setText(translate(u'SongMediaItem', u'Clear'))
159 self.SearchTextButton.setText(translate(u'SongMediaItem', u'Search'))172 self.SearchTextButton.setText(translate(u'SongMediaItem', u'Search'))
160173
@@ -169,15 +182,18 @@
169 search_type = self.SearchTypeComboBox.currentIndex()182 search_type = self.SearchTypeComboBox.currentIndex()
170 if search_type == 0:183 if search_type == 0:
171 log.debug(u'Titles Search')184 log.debug(u'Titles Search')
172 search_results = self.parent.songmanager.search_song_title(search_keywords)185 search_results = self.parent.songmanager.search_song_title(
186 search_keywords)
173 self.displayResultsSong(search_results)187 self.displayResultsSong(search_results)
174 elif search_type == 1:188 elif search_type == 1:
175 log.debug(u'Lyrics Search')189 log.debug(u'Lyrics Search')
176 search_results = self.parent.songmanager.search_song_lyrics(search_keywords)190 search_results = self.parent.songmanager.search_song_lyrics(
191 search_keywords)
177 self.displayResultsSong(search_results)192 self.displayResultsSong(search_results)
178 elif search_type == 2:193 elif search_type == 2:
179 log.debug(u'Authors Search')194 log.debug(u'Authors Search')
180 search_results = self.parent.songmanager.get_song_from_author(search_keywords)195 search_results = self.parent.songmanager.get_song_from_author(
196 search_keywords)
181 self.displayResultsAuthor(search_results)197 self.displayResultsAuthor(search_results)
182198
183 def displayResultsSong(self, searchresults):199 def displayResultsSong(self, searchresults):
@@ -190,7 +206,8 @@
190 if author_list != u'':206 if author_list != u'':
191 author_list = author_list + u', '207 author_list = author_list + u', '
192 author_list = author_list + author.display_name208 author_list = author_list + author.display_name
193 song_detail = unicode(u'%s (%s)' % (unicode(song.title), unicode(author_list)))209 song_detail = unicode(u'%s (%s)' % \
210 (unicode(song.title), unicode(author_list)))
194 song_name = QtGui.QListWidgetItem(song_detail)211 song_name = QtGui.QListWidgetItem(song_detail)
195 song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))212 song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
196 self.ListView.addItem(song_name)213 self.ListView.addItem(song_name)
@@ -200,7 +217,8 @@
200 self.ListView.clear()217 self.ListView.clear()
201 for author in searchresults:218 for author in searchresults:
202 for song in author.songs:219 for song in author.songs:
203 song_detail = unicode(u'%s (%s)' % (unicode(author.display_name), unicode(song.title)))220 song_detail = unicode(u'%s (%s)' % \
221 (unicode(author.display_name), unicode(song.title)))
204 song_name = QtGui.QListWidgetItem(song_detail)222 song_name = QtGui.QListWidgetItem(song_detail)
205 song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))223 song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
206 self.ListView.addItem(song_name)224 self.ListView.addItem(song_name)
@@ -291,7 +309,8 @@
291 raw_footer.append(song.title)309 raw_footer.append(song.title)
292 raw_footer.append(author_list)310 raw_footer.append(author_list)
293 raw_footer.append(song.copyright )311 raw_footer.append(song.copyright )
294 raw_footer.append(unicode(translate(u'SongMediaItem', u'CCL Licence: ') + ccl ))312 raw_footer.append(unicode(
313 translate(u'SongMediaItem', u'CCL Licence: ') + ccl ))
295 service_item.raw_footer = raw_footer314 service_item.raw_footer = raw_footer
296 return True315 return True
297316