Some things from my months old todo list:

- enabling nested docks for more flexible container arrangements
- show the next slide content
- some old UTF8 problems

bzr-revno: 1106
This commit is contained in:
Meinert Jordan 2010-10-29 21:23:43 +02:00 committed by Raoul Snyman
commit b673d905d7
3 changed files with 29 additions and 7 deletions

View File

@ -73,6 +73,7 @@ class Ui_MainWindow(object):
MainWindow.setSizePolicy(sizePolicy) MainWindow.setSizePolicy(sizePolicy)
MainIcon = build_icon(u':/icon/openlp-logo-16x16.png') MainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
MainWindow.setWindowIcon(MainIcon) MainWindow.setWindowIcon(MainIcon)
self.setDockNestingEnabled(True)
# Set up the main container, which contains all the other form widgets # Set up the main container, which contains all the other form widgets
self.MainContent = QtGui.QWidget(MainWindow) self.MainContent = QtGui.QWidget(MainWindow)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,

View File

@ -434,8 +434,12 @@ class SlideController(QtGui.QWidget):
request = unicode(self.sender().text()) request = unicode(self.sender().text())
slideno = self.slideList[request] slideno = self.slideList[request]
if slideno > self.PreviewListWidget.rowCount(): if slideno > self.PreviewListWidget.rowCount():
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) self.PreviewListWidget.selectRow(
self.PreviewListWidget.rowCount() - 1)
else: else:
if slideno + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(slideno + 1, 0))
self.PreviewListWidget.selectRow(slideno) self.PreviewListWidget.selectRow(slideno)
self.onSlideSelected() self.onSlideSelected()
@ -527,6 +531,9 @@ class SlideController(QtGui.QWidget):
log.debug(u'addServiceManagerItem live = %s' % self.isLive) log.debug(u'addServiceManagerItem live = %s' % self.isLive)
# If service item is the same as the current on only change slide # If service item is the same as the current on only change slide
if item.__eq__(self.serviceItem): if item.__eq__(self.serviceItem):
if slideno + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(slideno + 1, 0))
self.PreviewListWidget.selectRow(slideno) self.PreviewListWidget.selectRow(slideno)
self.onSlideSelected() self.onSlideSelected()
return return
@ -608,8 +615,12 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.setColumnWidth(0, self.PreviewListWidget.setColumnWidth(0,
self.PreviewListWidget.viewport().size().width()) self.PreviewListWidget.viewport().size().width())
if slideno > self.PreviewListWidget.rowCount(): if slideno > self.PreviewListWidget.rowCount():
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) self.PreviewListWidget.selectRow(
self.PreviewListWidget.rowCount() - 1)
else: else:
if slideno + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(slideno + 1, 0))
self.PreviewListWidget.selectRow(slideno) self.PreviewListWidget.selectRow(slideno)
self.enableToolBar(serviceItem) self.enableToolBar(serviceItem)
# Pass to display for viewing # Pass to display for viewing
@ -668,6 +679,9 @@ class SlideController(QtGui.QWidget):
[self.serviceItem, self.isLive, index]) [self.serviceItem, self.isLive, index])
self.updatePreview() self.updatePreview()
else: else:
if index + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(index + 1, 0))
self.PreviewListWidget.selectRow(index) self.PreviewListWidget.selectRow(index)
self.onSlideSelected() self.onSlideSelected()
@ -799,6 +813,9 @@ class SlideController(QtGui.QWidget):
""" """
The slide has been changed. Update the slidecontroller accordingly The slide has been changed. Update the slidecontroller accordingly
""" """
if row + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(row + 1, 0))
self.PreviewListWidget.selectRow(row) self.PreviewListWidget.selectRow(row)
self.updatePreview() self.updatePreview()
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix, Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
@ -844,6 +861,9 @@ class SlideController(QtGui.QWidget):
else: else:
Receiver.send_message('servicemanager_next_item') Receiver.send_message('servicemanager_next_item')
return return
if row + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(row + 1, 0))
self.PreviewListWidget.selectRow(row) self.PreviewListWidget.selectRow(row)
self.onSlideSelected() self.onSlideSelected()
@ -867,6 +887,9 @@ class SlideController(QtGui.QWidget):
row = self.PreviewListWidget.rowCount() - 1 row = self.PreviewListWidget.rowCount() - 1
else: else:
row = 0 row = 0
if row + 1 < self.PreviewListWidget.rowCount():
self.PreviewListWidget.scrollToItem(
self.PreviewListWidget.item(row + 1, 0))
self.PreviewListWidget.selectRow(row) self.PreviewListWidget.selectRow(row)
self.onSlideSelected() self.onSlideSelected()

View File

@ -162,12 +162,10 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
sxml.add_verse_to_lyrics(u'custom', unicode(count), sxml.add_verse_to_lyrics(u'custom', unicode(count),
unicode(self.slideListView.item(i).text())) unicode(self.slideListView.item(i).text()))
count += 1 count += 1
self.customSlide.title = unicode(self.titleEdit.displayText(), u'utf-8') self.customSlide.title = unicode(self.titleEdit.text())
self.customSlide.text = unicode(sxml.extract_xml(), u'utf-8') self.customSlide.text = unicode(sxml.extract_xml(), u'utf-8')
self.customSlide.credits = unicode(self.creditEdit.displayText(), self.customSlide.credits = unicode(self.creditEdit.text())
u'utf-8') self.customSlide.theme_name = unicode(self.themeComboBox.currentText())
self.customSlide.theme_name = unicode(self.themeComboBox.currentText(),
u'utf-8')
return self.manager.save_object(self.customSlide) return self.manager.save_object(self.customSlide)
def onUpButtonPressed(self): def onUpButtonPressed(self):