← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/fixes into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp.

    Requested reviews:
    OpenLP Core (openlp-core)


Clean up the version handling and make easier to change details.
Edit version.txt as part of the merge process between the bzr merge and bzr commit steps.
-- 
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14284
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw	2009-10-30 21:45:38 +0000
+++ openlp.pyw	2009-11-01 16:55:19 +0000
@@ -71,7 +71,18 @@
         """
         Run the OpenLP application.
         """
-        applicationVersion = u'1.9.0'
+        #Load and store current Application Version
+        filepath = os.path.split(os.path.abspath(__file__))[0]
+        filepath = os.path.abspath(os.path.join(filepath, u'version.txt'))
+        try:
+            fversion = open(filepath, 'r')
+            for line in fversion:
+                bits = unicode(line).split(u'-')
+                applicationVersion = {u'Full':unicode(line).rstrip(),
+                    u'version':bits[0], u'build':bits[1]}
+        except:
+                applicationVersion = {u'Full':u'1.9.0-000',
+                    u'version':u'1.9.0', u'build':u'000'}
         #set the default string encoding
         try:
             sys.setappdefaultencoding(u'utf-8')
@@ -81,7 +92,7 @@
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'process_events'), self.processEvents)
         self.setApplicationName(u'OpenLP')
-        self.setApplicationVersion(applicationVersion)
+        self.setApplicationVersion(applicationVersion[u'version'])
         if os.name == u'nt':
             self.setStyleSheet(application_stylesheet)
         show_splash = str_to_bool(ConfigHelper.get_registry().get_value(
@@ -100,7 +111,7 @@
             log.info(u'Screen %d found with resolution %s',
                 screen, self.desktop().availableGeometry(screen))
         # start the main app window
-        self.mainWindow = MainWindow(screens)
+        self.mainWindow = MainWindow(screens, applicationVersion)
         self.mainWindow.show()
         if show_splash:
             # now kill the splashscreen

=== modified file 'openlp/core/ui/about.py'
--- openlp/core/ui/about.py	2009-10-24 16:40:36 +0000
+++ openlp/core/ui/about.py	2009-11-01 16:55:19 +0000
@@ -31,11 +31,12 @@
     The About dialog
     """
 
-    def __init__(self, parent=None):
+    def __init__(self, parent, applicationVersion):
         """
         Do some initialisation stuff
         """
         QtGui.QDialog.__init__(self, parent)
+        self.applicationVersion = applicationVersion
         self.setupUi(self)
 
     def setupUi(self, AboutForm):
@@ -94,6 +95,12 @@
         self.License3Label.setWordWrap(True)
         self.License3Label.setObjectName(u'License3Label')
         self.LicenseTabLayout.addWidget(self.License3Label)
+        self.License4Label = QtGui.QLabel(self.LicenseTab)
+        self.License4Label.setAlignment(
+            QtCore.Qt.AlignJustify | QtCore.Qt.AlignVCenter)
+        self.License4Label.setWordWrap(True)
+        self.License4Label.setObjectName(u'License4Label')
+        self.LicenseTabLayout.addWidget(self.License4Label)
         self.LicenseSpacer = QtGui.QSpacerItem(20, 40,
             QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
         self.LicenseTabLayout.addItem(self.LicenseSpacer)
@@ -163,6 +170,9 @@
             u'but WITHOUT ANY WARRANTY; without even the implied warranty of '
             u'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU '
             u'General Public License for more details.'))
+        self.License4Label.setText(unicode(self.trUtf8(
+            u'Software version %s, Build %s')) %
+            (self.applicationVersion[u'version'], self.applicationVersion[u'build']))
         self.AboutNotebook.setTabText(
             self.AboutNotebook.indexOf(self.LicenseTab), self.trUtf8(u'License'))
         self.CreditsTextEdit.setPlainText(self.trUtf8(
@@ -190,4 +200,3 @@
         import webbrowser
         url = "http://www.openlp.org/en/documentation/introduction/contributing.html";
         webbrowser.open_new(url)
-

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2009-10-31 08:45:24 +0000
+++ openlp/core/ui/mainwindow.py	2009-11-01 16:55:19 +0000
@@ -408,19 +408,20 @@
     log = logging.getLogger(u'MainWindow')
     log.info(u'MainWindow loaded')
 
-    def __init__(self, screens):
+    def __init__(self, screens, applicationVersion):
         """
         This constructor sets up the interface, the various managers, and the
         plugins.
         """
         QtGui.QMainWindow.__init__(self)
         self.screenList = screens
+        self.applicationVersion = applicationVersion
         self.serviceNotSaved = False
         self.settingsmanager = SettingsManager(screens)
         self.generalConfig = PluginConfig(u'General')
         self.mainDisplay = MainDisplay(self, screens)
         self.alertForm = AlertForm(self)
-        self.aboutForm = AboutForm(self)
+        self.aboutForm = AboutForm(self, applicationVersion)
         self.settingsForm = SettingsForm(self.screenList, self, self)
         # Set up the path with plugins
         pluginpath = os.path.split(os.path.abspath(__file__))[0]
@@ -525,18 +526,16 @@
         self.settingsForm.postSetUp()
 
     def versionCheck(self):
-        applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-640')
+        applicationVersion = self.applicationVersion[u'Full']
         version = check_latest_version(self.generalConfig, applicationVersion)
         if applicationVersion != version:
             version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated '
-                u'to version %s\nWould you like to get it?'))
+                u'to version %s\n\nYou can obtain the latest version from http://openlp.org'))
             QtGui.QMessageBox.question(None,
                 self.trUtf8(u'OpenLP Version Updated'),
                 version_text % (applicationVersion, version),
                 QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
                 QtGui.QMessageBox.Ok)
-            self.generalConfig.set_config(u'Application version', version)
-
 
     def getMonitorNumber(self):
         """
@@ -577,6 +576,7 @@
         """
         Show the About form
         """
+        self.aboutForm.applicationVersion = self.applicationVersion
         self.aboutForm.exec_()
 
     def onToolsAlertItemClicked(self):

=== removed file 'openlp/plugins/media/lib/filelistdata.py'
--- openlp/plugins/media/lib/filelistdata.py	2009-09-12 17:24:16 +0000
+++ openlp/plugins/media/lib/filelistdata.py	1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
-
-###############################################################################
-# OpenLP - Open Source Lyrics Projection                                      #
-# --------------------------------------------------------------------------- #
-# Copyright (c) 2008-2009 Raoul Snyman                                        #
-# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten      #
-# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
-# --------------------------------------------------------------------------- #
-# This program is free software; you can redistribute it and/or modify it     #
-# under the terms of the GNU General Public License as published by the Free  #
-# Software Foundation; version 2 of the License.                              #
-#                                                                             #
-# This program is distributed in the hope that it will be useful, but WITHOUT #
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       #
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    #
-# more details.                                                               #
-#                                                                             #
-# You should have received a copy of the GNU General Public License along     #
-# with this program; if not, write to the Free Software Foundation, Inc., 59  #
-# Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
-###############################################################################
-
-import os
-import logging
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
-
-class FileListData(QAbstractListModel):
-    """
-    An abstract list of strings and the preview icon to go with them
-    """
-    global log
-    log=logging.getLogger(u'FileListData')
-    log.info(u'started')
-
-    def __init__(self):
-        QAbstractListModel.__init__(self)
-        self.items = [] # will be a list of (full filename shortname) tuples
-
-    def rowCount(self, parent):
-        return len(self.items)
-
-    def insertRow(self, row, filename):
-        self.beginInsertRows(QModelIndex(),row,row)
-        log.info(u'insert row %d:%s'%(row,filename))
-        # get short filename to display next to image
-        (prefix, shortfilename) = os.path.split(unicode(filename))
-        log.info(u'shortfilename=%s'%(shortfilename))
-        # create a preview image
-        self.items.insert(row, (filename, shortfilename))
-        self.endInsertRows()
-
-    def removeRow(self, row):
-        self.beginRemoveRows(QModelIndex(), row,row)
-        self.items.pop(row)
-        self.endRemoveRows()
-
-    def addRow(self, filename):
-        self.insertRow(len(self.items), filename)
-
-    def data(self, index, role):
-        row = index.row()
-        if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!
-            return QVariant()
-        if role == Qt.DisplayRole:
-            retval= self.items[row][1]
-#        elif role == Qt.DecorationRole:
-#            retval= self.items[row][1]
-        elif role == Qt.ToolTipRole:
-            retval= self.items[row][0]
-        else:
-            retval= QVariant()
-#         log.info(u'Returning"+ unicode(retval))
-        if type(retval) is not type(QVariant):
-            return QVariant(retval)
-        else:
-            return retval
-
-    def getFileList(self):
-        filelist = [item[0] for item in self.items];
-        return filelist
-
-    def getFilename(self, index):
-        row = index.row()
-        return self.items[row][0]
-
-    def getValue(self, index):
-        row = index.row()
-        return self.items[row][0]

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2009-10-31 20:27:08 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2009-11-01 16:55:19 +0000
@@ -289,7 +289,6 @@
         song = self.parent.songmanager.get_song(item_id)
         service_item.theme = song.theme_name
         service_item.editEnabled = True
-        service_item.fromPlugin = True
         service_item.editId = item_id
         service_item.verse_order = song.verse_order
         if song.lyrics.startswith(u'<?xml version='):

=== added file 'version.txt'
--- version.txt	1970-01-01 00:00:00 +0000
+++ version.txt	2009-11-01 16:55:19 +0000
@@ -0,0 +1,1 @@
+1.9.0-641


Follow ups