From f158044d5e9fa8ad5c36ecbbe92d06a535eb7b98 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 24 Mar 2010 19:05:45 +0000 Subject: [PATCH] Fix row counts and bad code before superfly spots it --- openlp/core/ui/slidecontroller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 34a29372a..3a02e2e40 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -460,17 +460,17 @@ class SlideController(QtGui.QWidget): self.serviceItem = serviceItem self.PreviewListWidget.clear() self.PreviewListWidget.setRowCount(0) - self.PreviewListWidget.setColumnWidth(1, self.labelWidth) + self.PreviewListWidget.setColumnWidth(0, self.labelWidth) self.PreviewListWidget.setColumnWidth(1, width - self.labelWidth) if self.isLive: self.SongMenu.menu().clear() + row = 0 for framenumber, frame in enumerate(self.serviceItem.get_frames()): self.PreviewListWidget.setRowCount( self.PreviewListWidget.rowCount() + 1) rowitem = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem() slide_height = 0 - row = u'' #It is a based Text Render if self.serviceItem.is_text(): if self.isLive and frame[u'verseTag'] is not None: @@ -484,12 +484,12 @@ class SlideController(QtGui.QWidget): else: tag = bits[0] row = bits[0][0:1] - try: - test = self.slideList[tag] - except: + if tag not in self.slideList: self.slideList[tag] = framenumber self.SongMenu.menu().addAction(self.trUtf8(u'%s'%tag), self.onSongBarHandler) + else: + row += 1 item.setText(frame[u'text']) else: label = QtGui.QLabel() @@ -501,7 +501,7 @@ class SlideController(QtGui.QWidget): label.setPixmap(QtGui.QPixmap.fromImage(pixmap)) self.PreviewListWidget.setCellWidget(framenumber, 1, label) slide_height = width * self.parent.RenderManager.screen_ratio - rowitem.setText(row) + rowitem.setText(unicode(row)) self.PreviewListWidget.setItem(framenumber, 0, rowitem) self.PreviewListWidget.setItem(framenumber, 1, item) if slide_height != 0: