Re: [Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-10-30 Thread Jon Tibble
Lots of cleanups
- remove unneeded TranslationContexts
- reduce the strings we create (improving maintainability) by passing variables 
and making use of existing if is None checks

i18n for Plugin.about()

FIX: The above patches uncovered the fact we were double loading the mediaitems 
through the hook_media_manager and through the initialise() functions.  This 
has been cleaned up by removing the relevant section in 
PluginManager.hook_media_manager().
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14237
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-10-30 Thread Jon Tibble
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)


Lots of cleanups
- remove unneeded TranslationContexts
- reduce the strings we create (improving maintainability) by passing variables 
and making use of existing if is None checks

i18n for Plugin.about()

FIX: The above patches uncovered the fact we were double loading the mediaitems 
through the hook_media_manager and through the initialise() functions.  This 
has been cleaned up by removing the relevant section in 
PluginManager.hook_media_manager().
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14237
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2009-10-29 01:48:43 +
+++ openlp/core/lib/mediamanageritem.py	2009-10-30 21:05:21 +
@@ -58,18 +58,13 @@
 When creating a descendant class from this class for your plugin,
 the following member variables should be set.
 
-``self.TranslationContext``
-This sets the translation context of all the text in the
-Media Manager item.
-
 ``self.PluginNameShort``
 The shortened (usually singular) name for the plugin e.g. *'Song'*
 for the Songs plugin.
 
 ``self.PluginNameVisible``
 The user visible name for a plugin which should use a suitable
-translation function.  This should normally be
-``self.trUtf8(self.PluginNameShort)``.
+translation function.
 
  ``self.ConfigSection``
 The section in the configuration where the items in the media
@@ -117,6 +112,7 @@
 if title is not None:
 self.title = title
 self.Toolbar = None
+self.ServiceItemIconName = None
 self.PageLayout = QtGui.QVBoxLayout(self)
 self.PageLayout.setSpacing(0)
 self.PageLayout.setContentsMargins(4, 0, 4, 0)
@@ -228,7 +224,8 @@
 if self.hasEditIcon:
 self.addToolbarButton(
 u'Edit %s' % self.PluginNameShort,
-u'%s %s' % (self.trUtf8(u'Edit the selected'), self.PluginNameVisible),
+u'%s %s' % (self.trUtf8(u'Edit the selected'),
+self.PluginNameVisible),
 u':%s_edit.png' % self.IconPath, self.onEditClick,
 u'%sEditItem' %  self.PluginNameShort)
 ## Delete Button ##
@@ -320,7 +317,7 @@
 
 def onFileClick(self):
 files = QtGui.QFileDialog.getOpenFileNames(
-self, self.trUtf8(self.OnNewPrompt),
+self, self.OnNewPrompt,
 self.parent.config.get_last_dir(), self.OnNewFileMasks)
 log.info(u'New files(s)%s', unicode(files))
 if len(files)  0:
@@ -382,8 +379,10 @@
 Common method for generating a service item
 
 service_item = ServiceItem(self.parent)
-service_item.addIcon(
-u':/media/media_' + self.PluginNameShort.lower() + u'.png')
+if self.ServiceItemIconName is not None:
+service_item.addIcon(self.ServiceItemIconName)
+else:
+service_item.addIcon(self.icon)
 if self.generateSlideData(service_item):
 self.ListView.clearSelection()
 return service_item

=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py	2009-10-21 16:11:58 +
+++ openlp/core/lib/plugin.py	2009-10-30 21:05:21 +
@@ -35,7 +35,7 @@
 Inactive = 1
 Disabled = 2
 
-class Plugin(object):
+class Plugin(QtCore.QObject):
 
 Base class for openlp plugins to inherit from.
 
@@ -91,7 +91,7 @@
 log = logging.getLogger(u'Plugin')
 log.info(u'loaded')
 
-def __init__(self, name=None, version=None, plugin_helpers=None):
+def __init__(self, name, version=None, plugin_helpers=None):
 
 This is the constructor for the plugin object. This provides an easy
 way for descendent plugins to populate common data. This method *must*
@@ -110,10 +110,8 @@
 ``plugin_helpers``
 Defaults to *None*. A list of helper objects.
 
-if name is not None:
-self.name = name
-else:
-self.name = u'Plugin'
+QtCore.QObject.__init__(self)
+self.name = name
 if version is not None:
 self.version = version
 self.icon = None
@@ -129,7 +127,7 @@
 self.settings = plugin_helpers[u'settings']
 self.mediadock = plugin_helpers[u'toolbox']
 QtCore.QObject.connect(Receiver.get_receiver(),
-QtCore.SIGNAL(u'%s_add_service_item'% self.name),
+QtCore.SIGNAL(u'%s_add_service_item' % self.name),
 self.process_add_service_event)
 
 def check_pre_conditions(self):

=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py	2009-10-17 19:13:11 +
+++ openlp/core/lib/pluginmanager.py	2009-10-30 

Re: [Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-10-30 Thread Raoul Snyman
Review: Approve
Looks fine to me.
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14237
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-10-30 Thread Tim Bentley
Review: Approve
Approved
Lots of improvements.
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14237
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp updated

2009-10-30 Thread noreply
The proposal to merge lp:~meths/openlp/trivialfixes into lp:openlp has been 
updated.

Status: Needs review = Merged
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14237
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~trb143/openlp/fixes into lp:openlp

2009-10-30 Thread Tim Bentley
Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)


Fixes 
Amend theme file handing works better
Renderer cleans up on change of images better
Save  Preview is now optional - this makes ServiceItem editing work better
Error Message for new ServiceItem with unsaved one.
Move message for Splash screen till later.

-- 
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14242
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw	2009-10-18 18:15:20 +
+++ openlp.pyw	2009-10-30 21:55:19 +
@@ -105,6 +105,7 @@
 if show_splash:
 # now kill the splashscreen
 self.splash.finish(self.mainWindow)
+self.mainWindow.versionCheck()
 return self.exec_()
 
 def main():

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2009-10-23 17:09:09 +
+++ openlp/core/lib/renderer.py	2009-10-30 21:55:19 +
@@ -72,9 +72,11 @@
 self._theme = theme
 self.bg_frame = None
 self.bg_image = None
+self._bg_image_filename = None
 self.theme_name = theme.theme_name
 self._set_theme_font()
 if theme.background_type == u'image':
+print theme.background_filename
 if theme.background_filename is not None:
 self.set_bg_image(theme.background_filename)
 
@@ -110,8 +112,8 @@
 painter.begin(self.bg_image)
 self.background_offsetx = (width - realwidth) / 2
 self.background_offsety = (height - realheight) / 2
-painter.drawImage(self.background_offsetx, self.background_offsety,
-preview)
+painter.drawImage(self.background_offsetx,
+self.background_offsety, preview)
 painter.end()
 
 def set_frame_dest(self, frame_width, frame_height, preview=False):

=== modified file 'openlp/core/ui/amendthemeform.py'
--- openlp/core/ui/amendthemeform.py	2009-10-29 23:27:45 +
+++ openlp/core/ui/amendthemeform.py	2009-10-30 21:55:19 +
@@ -431,7 +431,6 @@
 QtGui.QColor(self.theme.background_endColor), self).name()
 self.Color2PushButton.setStyleSheet(
 u'background-color: %s' % unicode(self.theme.background_endColor))
-
 self.previewTheme(self.theme)
 #
 #Other Tab
@@ -486,12 +485,14 @@
 self.BackgroundComboBox.setCurrentIndex(0)
 else:
 self.BackgroundComboBox.setCurrentIndex(1)
+self.ImageLineEdit.setText(u'')
 if theme.background_type == u'solid':
 self.BackgroundTypeComboBox.setCurrentIndex(0)
 elif theme.background_type == u'gradient':
 self.BackgroundTypeComboBox.setCurrentIndex(1)
 else:
 self.BackgroundTypeComboBox.setCurrentIndex(2)
+self.ImageLineEdit.setText(self.theme.background_filename)
 if self.theme.background_direction == u'horizontal':
 self.GradientComboBox.setCurrentIndex(0)
 elif self.theme.background_direction == u'vertical':

=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py	2009-10-30 17:44:16 +
+++ openlp/core/ui/generaltab.py	2009-10-30 21:55:19 +
@@ -76,6 +76,18 @@
 self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox')
 self.StartupLayout.addWidget(self.ShowSplashCheckBox)
 self.GeneralLeftLayout.addWidget(self.StartupGroupBox)
+
+self.SettingsGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
+self.SettingsGroupBox.setObjectName(u'SettingsGroupBox')
+self.SettingsLayout = QtGui.QVBoxLayout(self.SettingsGroupBox)
+self.SettingsLayout.setSpacing(8)
+self.SettingsLayout.setMargin(8)
+self.SettingsLayout.setObjectName(u'SettingsLayout')
+self.SaveCheckOOSCheckBox = QtGui.QCheckBox(self.SettingsGroupBox)
+self.SaveCheckOOSCheckBox.setObjectName(u'SaveCheckOOSCheckBox')
+self.SettingsLayout.addWidget(self.SaveCheckOOSCheckBox)
+self.GeneralLeftLayout.addWidget(self.SettingsGroupBox)
+
 self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
 QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
 self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
@@ -124,6 +136,8 @@
 QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged)
 QtCore.QObject.connect(self.ShowSplashCheckBox,
 QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged)
+QtCore.QObject.connect(self.SaveCheckOOSCheckBox,
+QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckOOSCheckBox)
 QtCore.QObject.connect(self.NumberEdit,
 QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
 QtCore.QObject.connect(self.UsernameEdit,
@@ -138,6 +152,8 @@
 self.WarningCheckBox.setText(self.trUtf8(u'Show blank screen warning'))

[Openlp-core] [Merge] lp:~trb143/openlp/fixes into lp:openlp updated

2009-10-30 Thread Tim Bentley
The proposal to merge lp:~trb143/openlp/fixes into lp:openlp has been updated.

Status: Needs review = Superseded
-- 
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14242
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~trb143/openlp/fixes into lp:openlp updated

2009-10-30 Thread noreply
The proposal to merge lp:~trb143/openlp/fixes into lp:openlp has been updated.

Status: Needs review = Merged
-- 
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14243
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~raoul-snyman/openlp/converter into lp:openlp

2009-10-30 Thread Raoul Snyman
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/converter into 
lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)

-- 
https://code.launchpad.net/~raoul-snyman/openlp/converter/+merge/14244
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp-1to2-converter.py'
--- openlp-1to2-converter.py	2009-10-25 21:36:04 +
+++ openlp-1to2-converter.py	2009-10-30 22:35:18 +
@@ -94,7 +94,7 @@
 ))
 ]
 
-def clean_string(dirty):
+def prepare_string(dirty):
 return dirty_chars.sub(u'', dirty.replace(u'\r\n', ' ').replace(u'\n', ' '))
 
 def display_sql(sql, params):
@@ -193,12 +193,12 @@
 xml_verse += (xml_verse_template % (line + 1, verse))
 verse_order += '%d ' % (line + 1)
 xml_lyrics = xml_lyrics_template % xml_verse
-search_title = clean_string(clean_title)
-search_lyrics = clean_string(clean_lyrics)
+search_title = prepare_string(clean_title)
+search_lyrics = prepare_string(clean_lyrics)
 sql_insert = u'INSERT INTO songs '\
 '(id, song_book_id, title, lyrics, verse_order, copyright, search_title, search_lyrics) '\
 'VALUES (NULL, 0, ?, ?, ?, ?, ?, ?)'
-sql_params = (clean_title, xml_lyrics, verse_order, clean_copyright, clean_title, clean_lyrics)
+sql_params = (clean_title, xml_lyrics, verse_order, clean_copyright, search_title, search_lyrics)
 if debug:
 print '...', display_sql(sql_insert, (sql_params[0], u'%s...' % clean_lyrics[:7], sql_params[2], sql_params[3], sql_params[4], u'%s...' % search_lyrics[:7]))
 elif verbose:

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~raoul-snyman/openlp/converter into lp:openlp

2009-10-30 Thread Jon Tibble
Review: Approve

-- 
https://code.launchpad.net/~raoul-snyman/openlp/converter/+merge/14244
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp