This commit is contained in:
M2j 2010-06-09 20:33:47 +02:00
commit 8733ceac70
79 changed files with 1976 additions and 1473 deletions

View File

@ -120,7 +120,7 @@ class OpenLPToolbar(QtGui.QToolBar):
try: try:
if self.icons[title]: if self.icons[title]:
return self.icons[title] return self.icons[title]
except NameError: except KeyError:
log.exception(u'getIconFromTitle - no icon for %s' % title) log.exception(u'getIconFromTitle - no icon for %s' % title)
return QtGui.QIcon() return QtGui.QIcon()

View File

@ -114,450 +114,451 @@ class Ui_AboutDialog(object):
QtCore.QMetaObject.connectSlotsByName(AboutDialog) QtCore.QMetaObject.connectSlotsByName(AboutDialog)
def retranslateUi(self, AboutDialog): def retranslateUi(self, AboutDialog):
AboutDialog.setWindowTitle(translate('AboutForm', 'About OpenLP')) AboutDialog.setWindowTitle(translate(u'AboutForm', u'About OpenLP'))
self.AboutTextEdit.setPlainText(translate('AboutForm', self.AboutTextEdit.setPlainText(translate(u'AboutForm',
'OpenLP <version><revision> - Open Source Lyrics ' u'OpenLP <version><revision> - Open Source Lyrics '
'Projection\n' u'Projection\n'
'\n' u'\n'
'OpenLP is free church presentation software, or lyrics ' u'OpenLP is free church presentation software, or lyrics '
'projection software, used to display slides of songs, Bible ' u'projection software, used to display slides of songs, Bible '
'verses, videos, images, and even presentations (if ' u'verses, videos, images, and even presentations (if '
'OpenOffice.org, PowerPoint or PowerPoint Viewer is installed) ' u'OpenOffice.org, PowerPoint or PowerPoint Viewer is installed) '
'for church worship using a computer and a data projector.\n' u'for church worship using a computer and a data projector.\n'
'\n' u'\n'
'Find out more about OpenLP: http://openlp.org/\n' u'Find out more about OpenLP: http://openlp.org/\n'
'\n' u'\n'
'OpenLP is written and maintained by volunteers. If you would ' u'OpenLP is written and maintained by volunteers. If you would '
'like to see more free Christian software being written, please ' u'like to see more free Christian software being written, please '
'consider contributing by using the button below.' u'consider contributing by using the button below.'
)) ))
self.AboutNotebook.setTabText( self.AboutNotebook.setTabText(
self.AboutNotebook.indexOf(self.AboutTab), self.AboutNotebook.indexOf(self.AboutTab),
translate('AboutForm', 'About')) translate(u'AboutForm', u'About'))
self.CreditsTextEdit.setPlainText(translate('AboutForm', self.CreditsTextEdit.setPlainText(translate(u'AboutForm',
'Project Lead\n' u'Project Lead\n'
' Raoul "superfly" Snyman\n' u' Raoul "superfly" Snyman\n'
'\n' u'\n'
'Developers\n' u'Developers\n'
' Tim "TRB143" Bentley\n' u' Tim "TRB143" Bentley\n'
' Jonathan "gushie" Corwin\n' u' Jonathan "gushie" Corwin\n'
' Michael "cocooncrash" Gorven\n' u' Michael "cocooncrash" Gorven\n'
' Scott "sguerrieri" Guerrieri\n' u' Scott "sguerrieri" Guerrieri\n'
' Raoul "superfly" Snyman\n' u' Raoul "superfly" Snyman\n'
' Martin "mijiti" Thompson\n' u' Martin "mijiti" Thompson\n'
' Jon "Meths" Tibble\n' u' Jon "Meths" Tibble\n'
'\n' u'\n'
'Contributors\n' u'Contributors\n'
' Meinert "m2j" Jordan\n' u' Meinert "m2j" Jordan\n'
' Christian "crichter" Richter\n' u' Christian "crichter" Richter\n'
' Maikel Stuivenberg\n' u' Maikel Stuivenberg\n'
' Carsten "catini" Tingaard\n' u' Carsten "catini" Tingaard\n'
'\n' u'\n'
'Testers\n' u'Testers\n'
' Philip "Phill" Ridout\n' u' Philip "Phill" Ridout\n'
' Wesley "wrst" Stout (lead)\n' u' Wesley "wrst" Stout (lead)\n'
'\n' u'\n'
'Packagers\n' u'Packagers\n'
' Thomas "tabthorpe" Abthorpe (FreeBSD)\n' u' Thomas "tabthorpe" Abthorpe (FreeBSD)\n'
' Tim "TRB143" Bentley (Fedora)\n' u' Tim "TRB143" Bentley (Fedora)\n'
' Michael "cocooncrash" Gorven (Ubuntu)\n' u' Michael "cocooncrash" Gorven (Ubuntu)\n'
' Matthias "matthub" Hub (Mac OS X)\n' u' Matthias "matthub" Hub (Mac OS X)\n'
' Raoul "superfly" Snyman (Windows)\n' u' Raoul "superfly" Snyman (Windows)\n'
)) ))
self.AboutNotebook.setTabText( self.AboutNotebook.setTabText(
self.AboutNotebook.indexOf(self.CreditsTab), self.AboutNotebook.indexOf(self.CreditsTab),
translate('AboutForm', 'Credits')) translate(u'AboutForm', u'Credits'))
self.LicenseTextEdit.setPlainText(translate('AboutForm', self.LicenseTextEdit.setPlainText(translate(u'AboutForm',
'Copyright \xa9 2004-2010 Raoul Snyman\n' u'Copyright \xa9 2004-2010 Raoul Snyman\n'
'Portions copyright \xa9 2004-2010 ' u'Portions copyright \xa9 2004-2010 '
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' u'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, '
'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon ' u'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon '
'Tibble, Carsten Tinggaard\n' u'Tibble, Carsten Tinggaard\n'
'\n' u'\n'
'This program is free software; you can redistribute it and/or ' u'This program is free software; you can redistribute it and/or '
'modify it under the terms of the GNU General Public License as ' u'modify it under the terms of the GNU General Public License as '
'published by the Free Software Foundation; version 2 of the ' u'published by the Free Software Foundation; version 2 of the '
'License.\n' u'License.\n'
'\n' u'\n'
'This program is distributed in the hope that it will be useful, ' u'This program is distributed in the hope that it will be useful, '
'but WITHOUT ANY WARRANTY; without even the implied warranty of ' u'but WITHOUT ANY WARRANTY; without even the implied warranty of '
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below ' u'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below '
'for more details.\n' u'for more details.\n'
'\n' u'\n'
'\n' u'\n'
'GNU GENERAL PUBLIC LICENSE\n' u'GNU GENERAL PUBLIC LICENSE\n'
'Version 2, June 1991\n' u'Version 2, June 1991\n'
'\n' u'\n'
'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 ' u'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 '
'Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ' u'Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. '
'Everyone is permitted to copy and distribute verbatim copies of ' u'Everyone is permitted to copy and distribute verbatim copies of '
'this license document, but changing it is not allowed.\n' u'this license document, but changing it is not allowed.\n'
'\n' u'\n'
'Preamble\n' u'Preamble\n'
'\n' u'\n'
'The licenses for most software are designed to take away your ' u'The licenses for most software are designed to take away your '
'freedom to share and change it. By contrast, the GNU General ' u'freedom to share and change it. By contrast, the GNU General '
'Public License is intended to guarantee your freedom to share ' u'Public License is intended to guarantee your freedom to share '
'and change free software--to make sure the software is free for ' u'and change free software--to make sure the software is free for '
'all its users. This General Public License applies to most of ' u'all its users. This General Public License applies to most of '
'the Free Software Foundation\'s software and to any other ' u'the Free Software Foundation\'s software and to any other '
'program whose authors commit to using it. (Some other Free ' u'program whose authors commit to using it. (Some other Free '
'Software Foundation software is covered by the GNU Lesser ' u'Software Foundation software is covered by the GNU Lesser '
'General Public License instead.) You can apply it to your ' u'General Public License instead.) You can apply it to your '
'programs, too.\n' u'programs, too.\n'
'\n' u'\n'
'When we speak of free software, we are referring to freedom, not ' u'When we speak of free software, we are referring to freedom, not '
'price. Our General Public Licenses are designed to make sure ' u'price. Our General Public Licenses are designed to make sure '
'that you have the freedom to distribute copies of free software ' u'that you have the freedom to distribute copies of free software '
'(and charge for this service if you wish), that you receive ' u'(and charge for this service if you wish), that you receive '
'source code or can get it if you want it, that you can change ' u'source code or can get it if you want it, that you can change '
'the software or use pieces of it in new free programs; and that ' u'the software or use pieces of it in new free programs; and that '
'you know you can do these things.\n' u'you know you can do these things.\n'
'\n' u'\n'
'To protect your rights, we need to make restrictions that forbid ' u'To protect your rights, we need to make restrictions that forbid '
'anyone to deny you these rights or to ask you to surrender the ' u'anyone to deny you these rights or to ask you to surrender the '
'rights. These restrictions translate to certain responsibilities ' u'rights. These restrictions translate to certain responsibilities '
'for you if you distribute copies of the software, or if you ' u'for you if you distribute copies of the software, or if you '
'modify it.\n' u'modify it.\n'
'\n' u'\n'
'For example, if you distribute copies of such a program, whether ' u'For example, if you distribute copies of such a program, whether '
'gratis or for a fee, you must give the recipients all the rights ' u'gratis or for a fee, you must give the recipients all the rights '
'that you have. You must make sure that they, too, receive or ' u'that you have. You must make sure that they, too, receive or '
'can get the source code. And you must show them these terms so ' u'can get the source code. And you must show them these terms so '
'they know their rights.\n' u'they know their rights.\n'
'\n' u'\n'
'We protect your rights with two steps: (1) copyright the ' u'We protect your rights with two steps: (1) copyright the '
'software, and (2) offer you this license which gives you legal ' u'software, and (2) offer you this license which gives you legal '
'permission to copy, distribute and/or modify the software.\n' u'permission to copy, distribute and/or modify the software.\n'
'\n' u'\n'
'Also, for each author\'s protection and ours, we want to make ' u'Also, for each author\'s protection and ours, we want to make '
'certain that everyone understands that there is no warranty for ' u'certain that everyone understands that there is no warranty for '
'this free software. If the software is modified by someone else ' u'this free software. If the software is modified by someone else '
'and passed on, we want its recipients to know that what they ' u'and passed on, we want its recipients to know that what they '
'have is not the original, so that any problems introduced by ' u'have is not the original, so that any problems introduced by '
'others will not reflect on the original authors\' reputations.\n' u'others will not reflect on the original authors\' reputations.\n'
'\n' u'\n'
'Finally, any free program is threatened constantly by software ' u'Finally, any free program is threatened constantly by software '
'patents. We wish to avoid the danger that redistributors of a ' u'patents. We wish to avoid the danger that redistributors of a '
'free program will individually obtain patent licenses, in effect ' u'free program will individually obtain patent licenses, in effect '
'making the program proprietary. To prevent this, we have made ' u'making the program proprietary. To prevent this, we have made '
'it clear that any patent must be licensed for everyone\'s free ' u'it clear that any patent must be licensed for everyone\'s free '
'use or not licensed at all.\n' u'use or not licensed at all.\n'
'\n' u'\n'
'The precise terms and conditions for copying, distribution and ' u'The precise terms and conditions for copying, distribution and '
'modification follow.\n' u'modification follow.\n'
'\n' u'\n'
'GNU GENERAL PUBLIC LICENSE\n' u'GNU GENERAL PUBLIC LICENSE\n'
'TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n' u'TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n'
'\n' u'\n'
'0. This License applies to any program or other work which ' u'0. This License applies to any program or other work which '
'contains a notice placed by the copyright holder saying it may ' u'contains a notice placed by the copyright holder saying it may '
'be distributed under the terms of this General Public License. ' u'be distributed under the terms of this General Public License. '
'The "Program", below, refers to any such program or work, and a ' u'The "Program", below, refers to any such program or work, and a '
'"work based on the Program" means either the Program or any ' u'"work based on the Program" means either the Program or any '
'derivative work under copyright law: that is to say, a work ' u'derivative work under copyright law: that is to say, a work '
'containing the Program or a portion of it, either verbatim or ' u'containing the Program or a portion of it, either verbatim or '
'with modifications and/or translated into another language. ' u'with modifications and/or translated into another language. '
'(Hereinafter, translation is included without limitation in the ' u'(Hereinafter, translation is included without limitation in the '
'term "modification".) Each licensee is addressed as "you".\n' u'term "modification".) Each licensee is addressed as "you".\n'
'\n' u'\n'
'Activities other than copying, distribution and modification are ' u'Activities other than copying, distribution and modification are '
'not covered by this License; they are outside its scope. The ' u'not covered by this License; they are outside its scope. The '
'act of running the Program is not restricted, and the output ' u'act of running the Program is not restricted, and the output '
'from the Program is covered only if its contents constitute a ' u'from the Program is covered only if its contents constitute a '
'work based on the Program (independent of having been made by ' u'work based on the Program (independent of having been made by '
'running the Program). Whether that is true depends on what the ' u'running the Program). Whether that is true depends on what the '
'Program does.\n' u'Program does.\n'
'\n' u'\n'
'1. You may copy and distribute verbatim copies of the Program\'s ' u'1. You may copy and distribute verbatim copies of the Program\'s '
'source code as you receive it, in any medium, provided that you ' u'source code as you receive it, in any medium, provided that you '
'conspicuously and appropriately publish on each copy an ' u'conspicuously and appropriately publish on each copy an '
'appropriate copyright notice and disclaimer of warranty; keep ' u'appropriate copyright notice and disclaimer of warranty; keep '
'intact all the notices that refer to this License and to the ' u'intact all the notices that refer to this License and to the '
'absence of any warranty; and give any other recipients of the ' u'absence of any warranty; and give any other recipients of the '
'Program a copy of this License along with the Program.\n' u'Program a copy of this License along with the Program.\n'
'\n' u'\n'
'You may charge a fee for the physical act of transferring a ' u'You may charge a fee for the physical act of transferring a '
'copy, and you may at your option offer warranty protection in ' u'copy, and you may at your option offer warranty protection in '
'exchange for a fee.\n' u'exchange for a fee.\n'
'\n' u'\n'
'2. You may modify your copy or copies of the Program or any ' u'2. You may modify your copy or copies of the Program or any '
'portion of it, thus forming a work based on the Program, and ' u'portion of it, thus forming a work based on the Program, and '
'copy and distribute such modifications or work under the terms ' u'copy and distribute such modifications or work under the terms '
'of Section 1 above, provided that you also meet all of these ' u'of Section 1 above, provided that you also meet all of these '
'conditions:\n' u'conditions:\n'
'\n' u'\n'
'a) You must cause the modified files to carry prominent notices ' u'a) You must cause the modified files to carry prominent notices '
'stating that you changed the files and the date of any change.\n' u'stating that you changed the files and the date of any change.\n'
'\n' u'\n'
'b) You must cause any work that you distribute or publish, that ' u'b) You must cause any work that you distribute or publish, that '
'in whole or in part contains or is derived from the Program or ' u'in whole or in part contains or is derived from the Program or '
'any part thereof, to be licensed as a whole at no charge to all ' u'any part thereof, to be licensed as a whole at no charge to all '
'third parties under the terms of this License.\n' u'third parties under the terms of this License.\n'
'\n' u'\n'
'c) If the modified program normally reads commands interactively ' u'c) If the modified program normally reads commands interactively '
'when run, you must cause it, when started running for such ' u'when run, you must cause it, when started running for such '
'interactive use in the most ordinary way, to print or display an ' u'interactive use in the most ordinary way, to print or display an '
'announcement including an appropriate copyright notice and a ' u'announcement including an appropriate copyright notice and a '
'notice that there is no warranty (or else, saying that you ' u'notice that there is no warranty (or else, saying that you '
'provide a warranty) and that users may redistribute the program ' u'provide a warranty) and that users may redistribute the program '
'under these conditions, and telling the user how to view a copy ' u'under these conditions, and telling the user how to view a copy '
'of this License. (Exception: if the Program itself is ' u'of this License. (Exception: if the Program itself is '
'interactive but does not normally print such an announcement, ' u'interactive but does not normally print such an announcement, '
'your work based on the Program is not required to print an ' u'your work based on the Program is not required to print an '
'announcement.)\n' u'announcement.)\n'
'\n' u'\n'
'These requirements apply to the modified work as a whole. If ' u'These requirements apply to the modified work as a whole. If '
'identifiable sections of that work are not derived from the ' u'identifiable sections of that work are not derived from the '
'Program, and can be reasonably considered independent and ' u'Program, and can be reasonably considered independent and '
'separate works in themselves, then this License, and its terms, ' u'separate works in themselves, then this License, and its terms, '
'do not apply to those sections when you distribute them as ' u'do not apply to those sections when you distribute them as '
'separate works. But when you distribute the same sections as ' u'separate works. But when you distribute the same sections as '
'part of a whole which is a work based on the Program, the ' u'part of a whole which is a work based on the Program, the '
'distribution of the whole must be on the terms of this License, ' u'distribution of the whole must be on the terms of this License, '
'whose permissions for other licensees extend to the entire ' u'whose permissions for other licensees extend to the entire '
'whole, and thus to each and every part regardless of who wrote ' u'whole, and thus to each and every part regardless of who wrote '
'it.\n' u'it.\n'
'\n' u'\n'
'Thus, it is not the intent of this section to claim rights or ' u'Thus, it is not the intent of this section to claim rights or '
'contest your rights to work written entirely by you; rather, the ' u'contest your rights to work written entirely by you; rather, the '
'intent is to exercise the right to control the distribution of ' u'intent is to exercise the right to control the distribution of '
'derivative or collective works based on the Program.\n' u'derivative or collective works based on the Program.\n'
'\n' u'\n'
'In addition, mere aggregation of another work not based on the ' u'In addition, mere aggregation of another work not based on the '
'Program with the Program (or with a work based on the Program) ' u'Program with the Program (or with a work based on the Program) '
'on a volume of a storage or distribution medium does not bring ' u'on a volume of a storage or distribution medium does not bring '
'the other work under the scope of this License.\n' u'the other work under the scope of this License.\n'
'\n' u'\n'
'3. You may copy and distribute the Program (or a work based on ' u'3. You may copy and distribute the Program (or a work based on '
'it, under Section 2) in object code or executable form under the ' u'it, under Section 2) in object code or executable form under the '
'terms of Sections 1 and 2 above provided that you also do one of ' u'terms of Sections 1 and 2 above provided that you also do one of '
'the following:\n' u'the following:\n'
'\n' u'\n'
'a) Accompany it with the complete corresponding machine-readable ' u'a) Accompany it with the complete corresponding machine-readable '
'source code, which must be distributed under the terms of ' u'source code, which must be distributed under the terms of '
'Sections 1 and 2 above on a medium customarily used for software ' u'Sections 1 and 2 above on a medium customarily used for software '
'interchange; or,\n' u'interchange; or,\n'
'\n' u'\n'
'b) Accompany it with a written offer, valid for at least three ' u'b) Accompany it with a written offer, valid for at least three '
'years, to give any third party, for a charge no more than your ' u'years, to give any third party, for a charge no more than your '
'cost of physically performing source distribution, a complete ' u'cost of physically performing source distribution, a complete '
'machine-readable copy of the corresponding source code, to be ' u'machine-readable copy of the corresponding source code, to be '
'distributed under the terms of Sections 1 and 2 above on a ' u'distributed under the terms of Sections 1 and 2 above on a '
'medium customarily used for software interchange; or,\n' u'medium customarily used for software interchange; or,\n'
'\n' u'\n'
'c) Accompany it with the information you received as to the ' u'c) Accompany it with the information you received as to the '
'offer to distribute corresponding source code. (This ' u'offer to distribute corresponding source code. (This '
'alternative is allowed only for noncommercial distribution and ' u'alternative is allowed only for noncommercial distribution and '
'only if you received the program in object code or executable ' u'only if you received the program in object code or executable '
'form with such an offer, in accord with Subsection b above.)\n' u'form with such an offer, in accord with Subsection b above.)\n'
'\n' u'\n'
'The source code for a work means the preferred form of the work ' u'The source code for a work means the preferred form of the work '
'for making modifications to it. For an executable work, ' u'for making modifications to it. For an executable work, '
'complete source code means all the source code for all modules ' u'complete source code means all the source code for all modules '
'it contains, plus any associated interface definition files, ' u'it contains, plus any associated interface definition files, '
'plus the scripts used to control compilation and installation of ' u'plus the scripts used to control compilation and installation of '
'the executable. However, as a special exception, the source ' u'the executable. However, as a special exception, the source '
'code distributed need not include anything that is normally ' u'code distributed need not include anything that is normally '
'distributed (in either source or binary form) with the major ' u'distributed (in either source or binary form) with the major '
'components (compiler, kernel, and so on) of the operating system ' u'components (compiler, kernel, and so on) of the operating system '
'on which the executable runs, unless that component itself ' u'on which the executable runs, unless that component itself '
'accompanies the executable.\n' u'accompanies the executable.\n'
'\n' u'\n'
'If distribution of executable or object code is made by offering ' u'If distribution of executable or object code is made by offering '
'access to copy from a designated place, then offering equivalent ' u'access to copy from a designated place, then offering equivalent '
'access to copy the source code from the same place counts as ' u'access to copy the source code from the same place counts as '
'distribution of the source code, even though third parties are ' u'distribution of the source code, even though third parties are '
'not compelled to copy the source along with the object code.\n' u'not compelled to copy the source along with the object code.\n'
'\n' u'\n'
'4. You may not copy, modify, sublicense, or distribute the ' u'4. You may not copy, modify, sublicense, or distribute the '
'Program except as expressly provided under this License. Any ' u'Program except as expressly provided under this License. Any '
'attempt otherwise to copy, modify, sublicense or distribute the ' u'attempt otherwise to copy, modify, sublicense or distribute the '
'Program is void, and will automatically terminate your rights ' u'Program is void, and will automatically terminate your rights '
'under this License. However, parties who have received copies, ' u'under this License. However, parties who have received copies, '
'or rights, from you under this License will not have their ' u'or rights, from you under this License will not have their '
'licenses terminated so long as such parties remain in full ' u'licenses terminated so long as such parties remain in full '
'compliance.\n' u'compliance.\n'
'\n' u'\n'
'5. You are not required to accept this License, since you have ' u'5. You are not required to accept this License, since you have '
'not signed it. However, nothing else grants you permission to ' u'not signed it. However, nothing else grants you permission to '
'modify or distribute the Program or its derivative works. These ' u'modify or distribute the Program or its derivative works. These '
'actions are prohibited by law if you do not accept this ' u'actions are prohibited by law if you do not accept this '
'License. Therefore, by modifying or distributing the Program ' u'License. Therefore, by modifying or distributing the Program '
'(or any work based on the Program), you indicate your acceptance ' u'(or any work based on the Program), you indicate your acceptance '
'of this License to do so, and all its terms and conditions for ' u'of this License to do so, and all its terms and conditions for '
'copying, distributing or modifying the Program or works based on ' u'copying, distributing or modifying the Program or works based on '
'it.\n' u'it.\n'
'\n' u'\n'
'6. Each time you redistribute the Program (or any work based on ' u'6. Each time you redistribute the Program (or any work based on '
'the Program), the recipient automatically receives a license ' u'the Program), the recipient automatically receives a license '
'from the original licensor to copy, distribute or modify the ' u'from the original licensor to copy, distribute or modify the '
'Program subject to these terms and conditions. You may not ' u'Program subject to these terms and conditions. You may not '
'impose any further restrictions on the recipients\' exercise of ' u'impose any further restrictions on the recipients\' exercise of '
'the rights granted herein. You are not responsible for enforcing ' u'the rights granted herein. You are not responsible for enforcing '
'compliance by third parties to this License.\n' u'compliance by third parties to this License.\n'
'\n' u'\n'
'7. If, as a consequence of a court judgment or allegation of ' u'7. If, as a consequence of a court judgment or allegation of '
'patent infringement or for any other reason (not limited to ' u'patent infringement or for any other reason (not limited to '
'patent issues), conditions are imposed on you (whether by court ' u'patent issues), conditions are imposed on you (whether by court '
'order, agreement or otherwise) that contradict the conditions of ' u'order, agreement or otherwise) that contradict the conditions of '
'this License, they do not excuse you from the conditions of this ' u'this License, they do not excuse you from the conditions of this '
'License. If you cannot distribute so as to satisfy ' u'License. If you cannot distribute so as to satisfy '
'simultaneously your obligations under this License and any other ' u'simultaneously your obligations under this License and any other '
'pertinent obligations, then as a consequence you may not ' u'pertinent obligations, then as a consequence you may not '
'distribute the Program at all. For example, if a patent license ' u'distribute the Program at all. For example, if a patent license '
'would not permit royalty-free redistribution of the Program by ' u'would not permit royalty-free redistribution of the Program by '
'all those who receive copies directly or indirectly through you, ' u'all those who receive copies directly or indirectly through you, '
'then the only way you could satisfy both it and this License ' u'then the only way you could satisfy both it and this License '
'would be to refrain entirely from distribution of the Program.\n' u'would be to refrain entirely from distribution of the Program.\n'
'\n' u'\n'
'If any portion of this section is held invalid or unenforceable ' u'If any portion of this section is held invalid or unenforceable '
'under any particular circumstance, the balance of the section is ' u'under any particular circumstance, the balance of the section is '
'intended to apply and the section as a whole is intended to ' u'intended to apply and the section as a whole is intended to '
'apply in other circumstances.\n' u'apply in other circumstances.\n'
'\n' u'\n'
'It is not the purpose of this section to induce you to infringe ' u'It is not the purpose of this section to induce you to infringe '
'any patents or other property right claims or to contest ' u'any patents or other property right claims or to contest '
'validity of any such claims; this section has the sole purpose ' u'validity of any such claims; this section has the sole purpose '
'of protecting the integrity of the free software distribution ' u'of protecting the integrity of the free software distribution '
'system, which is implemented by public license practices. Many ' u'system, which is implemented by public license practices. Many '
'people have made generous contributions to the wide range of ' u'people have made generous contributions to the wide range of '
'software distributed through that system in reliance on ' u'software distributed through that system in reliance on '
'consistent application of that system; it is up to the ' u'consistent application of that system; it is up to the '
'author/donor to decide if he or she is willing to distribute ' u'author/donor to decide if he or she is willing to distribute '
'software through any other system and a licensee cannot impose ' u'software through any other system and a licensee cannot impose '
'that choice.\n' u'that choice.\n'
'\n' u'\n'
'This section is intended to make thoroughly clear what is ' u'This section is intended to make thoroughly clear what is '
'believed to be a consequence of the rest of this License.\n' u'believed to be a consequence of the rest of this License.\n'
'\n' u'\n'
'8. If the distribution and/or use of the Program is restricted ' u'8. If the distribution and/or use of the Program is restricted '
'in certain countries either by patents or by copyrighted ' u'in certain countries either by patents or by copyrighted '
'interfaces, the original copyright holder who places the Program ' u'interfaces, the original copyright holder who places the Program '
'under this License may add an explicit geographical distribution ' u'under this License may add an explicit geographical distribution '
'limitation excluding those countries, so that distribution is ' u'limitation excluding those countries, so that distribution is '
'permitted only in or among countries not thus excluded. In such ' u'permitted only in or among countries not thus excluded. In such '
'case, this License incorporates the limitation as if written in ' u'case, this License incorporates the limitation as if written in '
'the body of this License.\n' u'the body of this License.\n'
'\n' u'\n'
'9. The Free Software Foundation may publish revised and/or new ' u'9. The Free Software Foundation may publish revised and/or new '
'versions of the General Public License from time to time. Such ' u'versions of the General Public License from time to time. Such '
'new versions will be similar in spirit to the present version, ' u'new versions will be similar in spirit to the present version, '
'but may differ in detail to address new problems or concerns.\n' u'but may differ in detail to address new problems or concerns.\n'
'\n' u'\n'
'Each version is given a distinguishing version number. If the ' u'Each version is given a distinguishing version number. If the '
'Program specifies a version number of this License which applies ' u'Program specifies a version number of this License which applies '
'to it and \"any later version\', you have the option of ' u'to it and \"any later version\', you have the option of '
'following the terms and conditions either of that version or of ' u'following the terms and conditions either of that version or of '
'any later version published by the Free Software Foundation. If ' u'any later version published by the Free Software Foundation. If '
'the Program does not specify a version number of this License, ' u'the Program does not specify a version number of this License, '
'you may choose any version ever published by the Free Software ' u'you may choose any version ever published by the Free Software '
'Foundation.\n' u'Foundation.\n'
'\n' u'\n'
'10. If you wish to incorporate parts of the Program into other ' u'10. If you wish to incorporate parts of the Program into other '
'free programs whose distribution conditions are different, write ' u'free programs whose distribution conditions are different, write '
'to the author to ask for permission. For software which is ' u'to the author to ask for permission. For software which is '
'copyrighted by the Free Software Foundation, write to the Free ' u'copyrighted by the Free Software Foundation, write to the Free '
'Software Foundation; we sometimes make exceptions for this. Our ' u'Software Foundation; we sometimes make exceptions for this. Our '
'decision will be guided by the two goals of preserving the free ' u'decision will be guided by the two goals of preserving the free '
'status of all derivatives of our free software and of promoting ' u'status of all derivatives of our free software and of promoting '
'the sharing and reuse of software generally.\n' u'the sharing and reuse of software generally.\n'
'\n' u'\n'
'NO WARRANTY\n' u'NO WARRANTY\n'
'\n' u'\n'
'11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO ' u'11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO '
'WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE ' u'WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE '
'LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT ' u'LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT '
'HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT ' u'HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT '
'WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, ' u'WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, '
'BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ' u'BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY '
'AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE ' u'AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE '
'QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ' u'QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE '
'PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY ' u'PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY '
'SERVICING, REPAIR OR CORRECTION.\n' u'SERVICING, REPAIR OR CORRECTION.\n'
'\n' u'\n'
'12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO ' u'12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO '
'IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY ' u'IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY '
'MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE ' u'MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE '
'LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, ' u'LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, '
'INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR ' u'INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR '
'INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS ' u'INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS '
'OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ' u'OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY '
'YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ' u'YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH '
'ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ' u'ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN '
'ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n' u'ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n'
'\n' u'\n'
'END OF TERMS AND CONDITIONS\n' u'END OF TERMS AND CONDITIONS\n'
'\n' u'\n'
'How to Apply These Terms to Your New Programs\n' u'How to Apply These Terms to Your New Programs\n'
'\n' u'\n'
'If you develop a new program, and you want it to be of the ' u'If you develop a new program, and you want it to be of the '
'greatest possible use to the public, the best way to achieve ' u'greatest possible use to the public, the best way to achieve '
'this is to make it free software which everyone can redistribute ' u'this is to make it free software which everyone can redistribute '
'and change under these terms.\n' u'and change under these terms.\n'
'\n' u'\n'
'To do so, attach the following notices to the program. It is ' u'To do so, attach the following notices to the program. It is '
'safest to attach them to the start of each source file to most ' u'safest to attach them to the start of each source file to most '
'effectively convey the exclusion of warranty; and each file ' u'effectively convey the exclusion of warranty; and each file '
'should have at least the "copyright" line and a pointer to where ' u'should have at least the "copyright" line and a pointer to where '
'the full notice is found.\n' u'the full notice is found.\n'
'\n' u'\n'
'<one line to give the program\'s name and a brief idea of what ' u'<one line to give the program\'s name and a brief idea of what '
'it does.>\n' u'it does.>\n'
'Copyright (C) <year> <name of author>\n' u'Copyright (C) <year> <name of author>\n'
'\n' u'\n'
'This program is free software; you can redistribute it and/or ' u'This program is free software; you can redistribute it and/or '
'modify it under the terms of the GNU General Public License as ' u'modify it under the terms of the GNU General Public License as '
'published by the Free Software Foundation; either version 2 of ' u'published by the Free Software Foundation; either version 2 of '
'the License, or (at your option) any later version.\n' u'the License, or (at your option) any later version.\n'
'\n' u'\n'
'This program is distributed in the hope that it will be useful, ' u'This program is distributed in the hope that it will be useful, '
'but WITHOUT ANY WARRANTY; without even the implied warranty of ' u'but WITHOUT ANY WARRANTY; without even the implied warranty of '
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' u'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '
'GNU General Public License for more details.\n' u'GNU General Public License for more details.\n'
'\n' u'\n'
'You should have received a copy of the GNU General Public ' u'You should have received a copy of the GNU General Public '
'License along with this program; if not, write to the Free ' u'License along with this program; if not, write to the Free '
'Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ' u'Software Foundation, Inc., 51 Franklin Street, Fifth Floor, '
'Boston, MA 02110-1301 USA.\n' u'Boston, MA 02110-1301 USA.\n'
'\n' u'\n'
'Also add information on how to contact you by electronic and ' u'Also add information on how to contact you by electronic and '
'paper mail.\n' u'paper mail.\n'
'\n' u'\n'
'If the program is interactive, make it output a short notice ' u'If the program is interactive, make it output a short notice '
'like this when it starts in an interactive mode:\n' u'like this when it starts in an interactive mode:\n'
'\n' u'\n'
'Gnomovision version 69, Copyright (C) year name of author\n' u'Gnomovision version 69, Copyright (C) year name of author\n'
'Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type ' u'Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type '
'"show w".\n' u'"show w".\n'
'This is free software, and you are welcome to redistribute it ' u'This is free software, and you are welcome to redistribute it '
'under certain conditions; type "show c" for details.\n' u'under certain conditions; type "show c" for details.\n'
'\n' u'\n'
'The hypothetical commands "show w" and "show c" should show ' u'The hypothetical commands "show w" and "show c" should show '
'the appropriate parts of the General Public License. Of course, ' u'the appropriate parts of the General Public License. Of course, '
'the commands you use may be called something other than "show ' u'the commands you use may be called something other than "show '
'w" and "show c"; they could even be mouse-clicks or menu items--' u'w" and "show c"; they could even be mouse-clicks or menu items--'
'whatever suits your program.\n' u'whatever suits your program.\n'
'\n' u'\n'
'You should also get your employer (if you work as a programmer) ' u'You should also get your employer (if you work as a programmer) '
'or your school, if any, to sign a "copyright disclaimer" for the ' u'or your school, if any, to sign a "copyright disclaimer" for the '
'program, if necessary. Here is a sample; alter the names:\n' u'program, if necessary. Here is a sample; alter the names:\n'
'\n' u'\n'
'Yoyodyne, Inc., hereby disclaims all copyright interest in the ' u'Yoyodyne, Inc., hereby disclaims all copyright interest in the '
'program "Gnomovision" (which makes passes at compilers) written ' u'program "Gnomovision" (which makes passes at compilers) written '
'by James Hacker.\n' u'by James Hacker.\n'
'\n' u'\n'
'<signature of Ty Coon>, 1 April 1989\n' u'<signature of Ty Coon>, 1 April 1989\n'
'Ty Coon, President of Vice\n' u'Ty Coon, President of Vice\n'
'\n' u'\n'
'This General Public License does not permit incorporating your ' u'This General Public License does not permit incorporating your '
'program into proprietary programs. If your program is a ' u'program into proprietary programs. If your program is a '
'subroutine library, you may consider it more useful to permit ' u'subroutine library, you may consider it more useful to permit '
'linking proprietary applications with the library. If this is ' u'linking proprietary applications with the library. If this is '
'what you want to do, use the GNU Lesser General Public License ' u'what you want to do, use the GNU Lesser General Public License '
'instead of this License.')) u'instead of this License.'))
self.AboutNotebook.setTabText( self.AboutNotebook.setTabText(
self.AboutNotebook.indexOf(self.LicenseTab), self.AboutNotebook.indexOf(self.LicenseTab),
translate('AboutForm', 'License')) translate(u'AboutForm', u'License'))
self.ContributeButton.setText(translate('AboutForm', 'Contribute')) self.ContributeButton.setText(translate(u'AboutForm', u'Contribute'))
self.CloseButton.setText(translate('AboutForm', 'Close')) self.CloseButton.setText(translate(u'AboutForm', u'Close'))

View File

@ -26,6 +26,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from aboutdialog import Ui_AboutDialog from aboutdialog import Ui_AboutDialog
from openlp.core.lib import translate
class AboutForm(QtGui.QDialog, Ui_AboutDialog): class AboutForm(QtGui.QDialog, Ui_AboutDialog):
""" """
@ -43,7 +44,7 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog):
about_text = about_text.replace(u'<version>', about_text = about_text.replace(u'<version>',
self.applicationVersion[u'version']) self.applicationVersion[u'version'])
if self.applicationVersion[u'build']: if self.applicationVersion[u'build']:
build_text = u' %s %s' % (self.trUtf8('build'), build_text = u' %s %s' % (translate(u'AboutForm', u'build'),
self.applicationVersion[u'build']) self.applicationVersion[u'build'])
else: else:
build_text = u'' build_text = u''

View File

@ -671,8 +671,8 @@ class Ui_AmendThemeDialog(object):
self.ThemePreviewLayout.addItem(spacerItem8) self.ThemePreviewLayout.addItem(spacerItem8)
self.AmendThemeLayout.addWidget(self.PreviewGroupBox) self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
self.ThemeButtonBox.setStandardButtons( self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) QtGui.QDialogButtonBox.Ok)
self.ThemeButtonBox.setObjectName(u'ThemeButtonBox') self.ThemeButtonBox.setObjectName(u'ThemeButtonBox')
self.AmendThemeLayout.addWidget(self.ThemeButtonBox) self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
@ -750,144 +750,158 @@ class Ui_AmendThemeDialog(object):
def retranslateUi(self, AmendThemeDialog): def retranslateUi(self, AmendThemeDialog):
AmendThemeDialog.setWindowTitle( AmendThemeDialog.setWindowTitle(
translate('AmendThemeForm', 'Theme Maintenance')) translate(u'AmendThemeForm', u'Theme Maintenance'))
self.ThemeNameLabel.setText(translate('AmendThemeForm', 'Theme Name:')) self.ThemeNameLabel.setText(
self.BackgroundLabel.setText(translate('AmendThemeForm', 'Background:')) translate(u'AmendThemeForm', u'Theme Name:'))
self.BackgroundLabel.setText(
translate(u'AmendThemeForm', u'Background:'))
self.BackgroundComboBox.setItemText(0, self.BackgroundComboBox.setItemText(0,
translate('AmendThemeForm', 'Opaque')) translate(u'AmendThemeForm', u'Opaque'))
self.BackgroundComboBox.setItemText(1, self.BackgroundComboBox.setItemText(1,
translate('AmendThemeForm', 'Transparent')) translate(u'AmendThemeForm', u'Transparent'))
self.BackgroundTypeLabel.setText( self.BackgroundTypeLabel.setText(
translate('AmendThemeForm', 'Background Type:')) translate(u'AmendThemeForm', u'Background Type:'))
self.BackgroundTypeComboBox.setItemText(0, self.BackgroundTypeComboBox.setItemText(0,
translate('AmendThemeForm', 'Solid Color')) translate(u'AmendThemeForm', u'Solid Color'))
self.BackgroundTypeComboBox.setItemText(1, self.BackgroundTypeComboBox.setItemText(1,
translate('AmendThemeForm', 'Gradient')) translate(u'AmendThemeForm', u'Gradient'))
self.BackgroundTypeComboBox.setItemText(2, self.BackgroundTypeComboBox.setItemText(2,
translate('AmendThemeForm', 'Image')) translate(u'AmendThemeForm', u'Image'))
self.Color1Label.setText(translate('AmendThemeForm', '<Color1>')) self.Color1Label.setText(translate(u'AmendThemeForm', u'<Color1>'))
self.Color2Label.setText(translate('AmendThemeForm', '<Color2>')) self.Color2Label.setText(translate(u'AmendThemeForm', u'<Color2>'))
self.ImageLabel.setText(translate('AmendThemeForm', 'Image:')) self.ImageLabel.setText(translate(u'AmendThemeForm', u'Image:'))
self.GradientLabel.setText(translate('AmendThemeForm', 'Gradient :')) self.GradientLabel.setText(translate(u'AmendThemeForm', u'Gradient :'))
self.GradientComboBox.setItemText(0, self.GradientComboBox.setItemText(0,
translate('AmendThemeForm', 'Horizontal')) translate(u'AmendThemeForm', u'Horizontal'))
self.GradientComboBox.setItemText(1, self.GradientComboBox.setItemText(1,
translate('AmendThemeForm', 'Vertical')) translate(u'AmendThemeForm', u'Vertical'))
self.GradientComboBox.setItemText(2, self.GradientComboBox.setItemText(2,
translate('AmendThemeForm', 'Circular')) translate(u'AmendThemeForm', u'Circular'))
self.ThemeTabWidget.setTabText( self.ThemeTabWidget.setTabText(
self.ThemeTabWidget.indexOf(self.BackgroundTab), self.ThemeTabWidget.indexOf(self.BackgroundTab),
translate('AmendThemeForm', 'Background')) translate(u'AmendThemeForm', u'Background'))
self.FontMainGroupBox.setTitle(translate('AmendThemeForm', 'Main Font')) self.FontMainGroupBox.setTitle(
self.FontMainlabel.setText(translate('AmendThemeForm', 'Font:')) translate(u'AmendThemeForm', u'Main Font'))
self.FontMainlabel.setText(translate(u'AmendThemeForm', u'Font:'))
self.FontMainColorLabel.setText( self.FontMainColorLabel.setText(
translate('AmendThemeForm', 'Font Color:')) translate(u'AmendThemeForm', u'Font Color:'))
self.FontMainSize.setText(translate('AmendThemeForm', 'Size:')) self.FontMainSize.setText(translate(u'AmendThemeForm', u'Size:'))
self.FontMainSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt')) self.FontMainSizeSpinBox.setSuffix(translate(u'AmendThemeForm', u'pt'))
self.FontMainWrapIndentationLabel.setText( self.FontMainWrapIndentationLabel.setText(
translate('AmendThemeForm', 'Wrap Indentation')) translate(u'AmendThemeForm', u'Wrap Indentation'))
self.FontMainWrapLineAdjustmentLabel.setText( self.FontMainWrapLineAdjustmentLabel.setText(
translate('AmendThemeForm', 'Adjust Line Spacing')) translate(u'AmendThemeForm', u'Adjust Line Spacing'))
self.FontMainWeightComboBox.setItemText(0, self.FontMainWeightComboBox.setItemText(0,
translate('AmendThemeForm', 'Normal')) translate(u'AmendThemeForm', u'Normal'))
self.FontMainWeightComboBox.setItemText(1, self.FontMainWeightComboBox.setItemText(1,
translate('AmendThemeForm', 'Bold')) translate(u'AmendThemeForm', u'Bold'))
self.FontMainWeightComboBox.setItemText(2, self.FontMainWeightComboBox.setItemText(2,
translate('AmendThemeForm', 'Italics')) translate(u'AmendThemeForm', u'Italics'))
self.FontMainWeightComboBox.setItemText(3, self.FontMainWeightComboBox.setItemText(3,
translate('AmendThemeForm', 'Bold/Italics')) translate(u'AmendThemeForm', u'Bold/Italics'))
self.FontMainWeightLabel.setText( self.FontMainWeightLabel.setText(
translate('AmendThemeForm', 'Font Weight:')) translate(u'AmendThemeForm', u'Font Weight:'))
self.MainLocationGroupBox.setTitle( self.MainLocationGroupBox.setTitle(
translate('AmendThemeForm', 'Display Location')) translate(u'AmendThemeForm', u'Display Location'))
self.DefaultLocationLabel.setText( self.DefaultLocationLabel.setText(
translate('AmendThemeForm', 'Use Default Location:')) translate(u'AmendThemeForm', u'Use Default Location:'))
self.FontMainXLabel.setText(translate('AmendThemeForm', 'X Position:')) self.FontMainXLabel.setText(
self.FontMainYLabel.setText(translate('AmendThemeForm', 'Y Position:')) translate(u'AmendThemeForm', u'X Position:'))
self.FontMainWidthLabel.setText(translate('AmendThemeForm', 'Width:')) self.FontMainYLabel.setText(
self.FontMainHeightLabel.setText(translate('AmendThemeForm', 'Height:')) translate(u'AmendThemeForm', u'Y Position:'))
self.FontMainXSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.FontMainWidthLabel.setText(
self.FontMainYSpinBox.setSuffix(translate('AmendThemeForm', 'px')) translate(u'AmendThemeForm', u'Width:'))
self.FontMainWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.FontMainHeightLabel.setText(
self.FontMainHeightSpinBox.setSuffix(translate('AmendThemeForm', 'px')) translate(u'AmendThemeForm', u'Height:'))
self.FontMainXSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.FontMainYSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.FontMainWidthSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.FontMainHeightSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.ThemeTabWidget.setTabText( self.ThemeTabWidget.setTabText(
self.ThemeTabWidget.indexOf(self.FontMainTab), self.ThemeTabWidget.indexOf(self.FontMainTab),
translate('AmendThemeForm', 'Font Main')) translate(u'AmendThemeForm', u'Font Main'))
self.FooterFontGroupBox.setTitle( self.FooterFontGroupBox.setTitle(
translate('AmendThemeForm', 'Footer Font')) translate(u'AmendThemeForm', u'Footer Font'))
self.FontFooterLabel.setText(translate('AmendThemeForm', 'Font:')) self.FontFooterLabel.setText(translate(u'AmendThemeForm', u'Font:'))
self.FontFooterColorLabel.setText( self.FontFooterColorLabel.setText(
translate('AmendThemeForm', 'Font Color:')) translate(u'AmendThemeForm', u'Font Color:'))
self.FontFooterSizeLabel.setText(translate('AmendThemeForm', 'Size:')) self.FontFooterSizeLabel.setText(translate(u'AmendThemeForm', u'Size:'))
self.FontFooterSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt')) self.FontFooterSizeSpinBox.setSuffix(
translate(u'AmendThemeForm', u'pt'))
self.FontFooterWeightComboBox.setItemText(0, self.FontFooterWeightComboBox.setItemText(0,
translate('AmendThemeForm', 'Normal')) translate(u'AmendThemeForm', u'Normal'))
self.FontFooterWeightComboBox.setItemText(1, self.FontFooterWeightComboBox.setItemText(1,
translate('AmendThemeForm', 'Bold')) translate(u'AmendThemeForm', u'Bold'))
self.FontFooterWeightComboBox.setItemText(2, self.FontFooterWeightComboBox.setItemText(2,
translate('AmendThemeForm', 'Italics')) translate(u'AmendThemeForm', u'Italics'))
self.FontFooterWeightComboBox.setItemText(3, self.FontFooterWeightComboBox.setItemText(3,
translate('AmendThemeForm', 'Bold/Italics')) translate(u'AmendThemeForm', u'Bold/Italics'))
self.FontFooterWeightLabel.setText( self.FontFooterWeightLabel.setText(
translate('AmendThemeForm', 'Font Weight:')) translate(u'AmendThemeForm', u'Font Weight:'))
self.LocationFooterGroupBox.setTitle( self.LocationFooterGroupBox.setTitle(
translate('AmendThemeForm', 'Display Location')) translate(u'AmendThemeForm', u'Display Location'))
self.FontFooterDefaultLabel.setText( self.FontFooterDefaultLabel.setText(
translate('AmendThemeForm', 'Use Default Location:')) translate(u'AmendThemeForm', u'Use Default Location:'))
self.FontFooterXLabel.setText( self.FontFooterXLabel.setText(
translate('AmendThemeForm', 'X Position:')) translate(u'AmendThemeForm', u'X Position:'))
self.FontFooterYLabel.setText( self.FontFooterYLabel.setText(
translate('AmendThemeForm', 'Y Position:')) translate(u'AmendThemeForm', u'Y Position:'))
self.FontFooterWidthLabel.setText(translate('AmendThemeForm', 'Width:')) self.FontFooterWidthLabel.setText(
translate(u'AmendThemeForm', u'Width:'))
self.FontFooterHeightLabel.setText( self.FontFooterHeightLabel.setText(
translate('AmendThemeForm', 'Height:')) translate(u'AmendThemeForm', u'Height:'))
self.FontFooterXSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.FontFooterXSpinBox.setSuffix(
self.FontFooterYSpinBox.setSuffix(translate('AmendThemeForm', 'px')) translate(u'AmendThemeForm', u'px'))
self.FontFooterWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.FontFooterYSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.FontFooterWidthSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.FontFooterHeightSpinBox.setSuffix( self.FontFooterHeightSpinBox.setSuffix(
translate('AmendThemeForm', 'px')) translate(u'AmendThemeForm', u'px'))
self.ThemeTabWidget.setTabText( self.ThemeTabWidget.setTabText(
self.ThemeTabWidget.indexOf(self.FontFooterTab), self.ThemeTabWidget.indexOf(self.FontFooterTab),
translate('AmendThemeForm', 'Font Footer')) translate(u'AmendThemeForm', u'Font Footer'))
self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline')) self.OutlineGroupBox.setTitle(translate(u'AmendThemeForm', u'Outline'))
self.OutlineSpinBoxLabel.setText( self.OutlineSpinBoxLabel.setText(
translate('AmendThemeForm', 'Outline Size:')) translate(u'AmendThemeForm', u'Outline Size:'))
self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.OutlineSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.OutlineColorLabel.setText( self.OutlineColorLabel.setText(
translate('AmendThemeForm', 'Outline Color:')) translate(u'AmendThemeForm', u'Outline Color:'))
self.OutlineEnabledLabel.setText( self.OutlineEnabledLabel.setText(
translate('AmendThemeForm', 'Show Outline:')) translate(u'AmendThemeForm', u'Show Outline:'))
self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow')) self.ShadowGroupBox.setTitle(translate(u'AmendThemeForm', u'Shadow'))
self.ShadowSpinBoxLabel.setText( self.ShadowSpinBoxLabel.setText(
translate('AmendThemeForm', 'Shadow Size:')) translate(u'AmendThemeForm', u'Shadow Size:'))
self.ShadowSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.ShadowSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.ShadowColorLabel.setText( self.ShadowColorLabel.setText(
translate('AmendThemeForm', 'Shadow Color:')) translate(u'AmendThemeForm', u'Shadow Color:'))
self.ShadowEnabledLabel.setText( self.ShadowEnabledLabel.setText(
translate('AmendThemeForm', 'Show Shadow:')) translate(u'AmendThemeForm', u'Show Shadow:'))
self.AlignmentGroupBox.setTitle( self.AlignmentGroupBox.setTitle(
translate('AmendThemeForm', 'Alignment')) translate(u'AmendThemeForm', u'Alignment'))
self.HorizontalLabel.setText( self.HorizontalLabel.setText(
translate('AmendThemeForm', 'Horizontal Align:')) translate(u'AmendThemeForm', u'Horizontal Align:'))
self.HorizontalComboBox.setItemText(0, self.HorizontalComboBox.setItemText(0,
translate('AmendThemeForm', 'Left')) translate(u'AmendThemeForm', u'Left'))
self.HorizontalComboBox.setItemText(1, self.HorizontalComboBox.setItemText(1,
translate('AmendThemeForm', 'Right')) translate(u'AmendThemeForm', u'Right'))
self.HorizontalComboBox.setItemText(2, self.HorizontalComboBox.setItemText(2,
translate('AmendThemeForm', 'Center')) translate(u'AmendThemeForm', u'Center'))
self.VerticalLabel.setText( self.VerticalLabel.setText(
translate('AmendThemeForm', 'Vertical Align:')) translate(u'AmendThemeForm', u'Vertical Align:'))
self.VerticalComboBox.setItemText(0, translate('AmendThemeForm', 'Top')) self.VerticalComboBox.setItemText(0,
self.VerticalComboBox.setItemText(1, translate(u'AmendThemeForm', u'Top'))
translate('AmendThemeForm', 'Middle')) self.VerticalComboBox.setItemText(1,
self.VerticalComboBox.setItemText(2, translate(u'AmendThemeForm', u'Middle'))
translate('AmendThemeForm', 'Bottom')) self.VerticalComboBox.setItemText(2,
translate(u'AmendThemeForm', u'Bottom'))
self.TransitionGroupBox.setTitle( self.TransitionGroupBox.setTitle(
translate('AmendThemeForm', 'Slide Transition')) translate(u'AmendThemeForm', u'Slide Transition'))
self.SlideTransitionCheckedBoxLabel.setText( self.SlideTransitionCheckedBoxLabel.setText(
translate('AmendThemeForm', 'Transition Active:')) translate(u'AmendThemeForm', u'Transition Active:'))
self.ThemeTabWidget.setTabText( self.ThemeTabWidget.setTabText(
self.ThemeTabWidget.indexOf(self.OtherOptionsTab), self.ThemeTabWidget.indexOf(self.OtherOptionsTab),
translate('AmendThemeForm', 'Other Options')) translate(u'AmendThemeForm', u'Other Options'))
self.PreviewGroupBox.setTitle(translate('AmendThemeForm', 'Preview')) self.PreviewGroupBox.setTitle(translate(u'AmendThemeForm', u'Preview'))

View File

@ -29,7 +29,7 @@ import os.path
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import ThemeXML from openlp.core.lib import ThemeXML, translate
from amendthemedialog import Ui_AmendThemeDialog from amendthemedialog import Ui_AmendThemeDialog
log = logging.getLogger(u'AmendThemeForm') log = logging.getLogger(u'AmendThemeForm')
@ -210,11 +210,12 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
def onImageToolButtonClicked(self): def onImageToolButtonClicked(self):
filename = QtGui.QFileDialog.getOpenFileName( filename = QtGui.QFileDialog.getOpenFileName(
self, self.trUtf8(u'Open file')) self, translate(u'AmendThemeForm', u'Open file'))
if filename: if filename:
self.ImageLineEdit.setText(filename) self.ImageLineEdit.setText(filename)
self.theme.background_filename = filename self.theme.background_filename = filename
self.previewTheme() self.previewTheme()
# #
#Main Font Tab #Main Font Tab
# #
@ -306,6 +307,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
if self.theme.font_main_height != self.FontMainHeightSpinBox.value(): if self.theme.font_main_height != self.FontMainHeightSpinBox.value():
self.theme.font_main_height = self.FontMainHeightSpinBox.value() self.theme.font_main_height = self.FontMainHeightSpinBox.value()
self.previewTheme() self.previewTheme()
# #
#Footer Font Tab #Footer Font Tab
# #
@ -384,6 +386,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.font_footer_height = \ self.theme.font_footer_height = \
self.FontFooterHeightSpinBox.value() self.FontFooterHeightSpinBox.value()
self.previewTheme() self.previewTheme()
# #
#Background Tab #Background Tab
# #
@ -446,6 +449,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.Color2PushButton.setStyleSheet( self.Color2PushButton.setStyleSheet(
u'background-color: %s' % unicode(self.theme.background_endColor)) u'background-color: %s' % unicode(self.theme.background_endColor))
self.previewTheme() self.previewTheme()
# #
#Other Tab #Other Tab
# #
@ -506,6 +510,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.display_verticalAlign = currentIndex self.theme.display_verticalAlign = currentIndex
self.stateChanging(self.theme) self.stateChanging(self.theme)
self.previewTheme() self.previewTheme()
# #
#Local Methods #Local Methods
# #
@ -629,7 +634,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
if theme.background_type == u'solid': if theme.background_type == u'solid':
self.Color1PushButton.setStyleSheet( self.Color1PushButton.setStyleSheet(
u'background-color: %s' % unicode(theme.background_color)) u'background-color: %s' % unicode(theme.background_color))
self.Color1Label.setText(self.trUtf8('Background Color:')) self.Color1Label.setText(
translate(u'AmendThemeForm', u'Background Color:'))
self.Color1Label.setVisible(True) self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True) self.Color1PushButton.setVisible(True)
self.Color2Label.setVisible(False) self.Color2Label.setVisible(False)
@ -644,8 +650,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
% unicode(theme.background_startColor)) % unicode(theme.background_startColor))
self.Color2PushButton.setStyleSheet(u'background-color: %s' \ self.Color2PushButton.setStyleSheet(u'background-color: %s' \
% unicode(theme.background_endColor)) % unicode(theme.background_endColor))
self.Color1Label.setText(self.trUtf8('First Color:')) self.Color1Label.setText(
self.Color2Label.setText(self.trUtf8('Second Color:')) translate(u'AmendThemeForm', u'First Color:'))
self.Color2Label.setText(
translate(u'AmendThemeForm', u'Second Color:'))
self.Color1Label.setVisible(True) self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True) self.Color1PushButton.setVisible(True)
self.Color2Label.setVisible(True) self.Color2Label.setVisible(True)
@ -713,7 +721,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
log.debug(u'Page Length area height %s, metrics %s, lines %s' % log.debug(u'Page Length area height %s, metrics %s, lines %s' %
(self.FontMainHeightSpinBox.value(), metrics.height(), (self.FontMainHeightSpinBox.value(), metrics.height(),
page_length)) page_length))
page_length_text = unicode(self.trUtf8('Slide Height is %s rows')) page_length_text = unicode(
translate(u'AmendThemeForm', u'Slide Height is %s rows'))
self.FontMainLinesPageLabel.setText(page_length_text % page_length) self.FontMainLinesPageLabel.setText(page_length_text % page_length)
frame = self.thememanager.generateImage(self.theme) frame = self.thememanager.generateImage(self.theme)
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
@ -728,8 +737,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.font_main_italics)# italic self.theme.font_main_italics)# italic
mainFont.setPixelSize(self.theme.font_main_proportion) mainFont.setPixelSize(self.theme.font_main_proportion)
metrics = QtGui.QFontMetrics(mainFont) metrics = QtGui.QFontMetrics(mainFont)
#Validate that the screen width is big enough to display the text # Validate that the screen width is big enough to display the text
if self.theme.font_main_width < metrics.maxWidth() * 2 + 64: if self.theme.font_main_width < metrics.maxWidth() * 2 + 64:
self.theme.font_main_width = metrics.maxWidth() * 2 + 64 self.theme.font_main_width = metrics.maxWidth() * 2 + 64
self.FontMainWidthSpinBox.setValue(self.theme.font_main_width) self.FontMainWidthSpinBox.setValue(self.theme.font_main_width)
return metrics return metrics

View File

@ -25,7 +25,7 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.core.lib import SettingsTab, Receiver from openlp.core.lib import SettingsTab, Receiver, translate
class DisplayTab(SettingsTab): class DisplayTab(SettingsTab):
""" """
@ -39,7 +39,7 @@ class DisplayTab(SettingsTab):
SettingsTab.__init__(self, u'Display') SettingsTab.__init__(self, u'Display')
def setupUi(self): def setupUi(self):
self.tabTitleVisible = self.trUtf8('Displays') self.tabTitleVisible = translate(u'DisplayTab', u'Displays')
self.layoutWidget = QtGui.QWidget(self) self.layoutWidget = QtGui.QWidget(self)
self.layoutWidget.setGeometry(QtCore.QRect(0, 40, 241, 79)) self.layoutWidget.setGeometry(QtCore.QRect(0, 40, 241, 79))
self.layoutWidget.setObjectName(u'layoutWidget') self.layoutWidget.setObjectName(u'layoutWidget')
@ -155,26 +155,28 @@ class DisplayTab(SettingsTab):
self.OverrideCheckBox.setObjectName(u'OverrideCheckBox') self.OverrideCheckBox.setObjectName(u'OverrideCheckBox')
QtCore.QMetaObject.connectSlotsByName(self) QtCore.QMetaObject.connectSlotsByName(self)
QtCore.QObject.connect(self.OverrideCheckBox, QtCore.QObject.connect(self.OverrideCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'), self.onOverrideCheckBoxChanged)
self.onOverrideCheckBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.setWindowTitle( self.trUtf8(u'Amend Display Settings')) self.setWindowTitle(translate(u'DisplayTab', u'Amend Display Settings'))
self.CurrentGroupBox.setTitle( self.trUtf8(u'Default Settings')) self.CurrentGroupBox.setTitle(
self.XLabel.setText(self.trUtf8(u'X')) translate(u'DisplayTab', u'Default Settings'))
self.XLabel.setText(translate(u'DisplayTab', u'X'))
self.Xpos.setText(u'0') self.Xpos.setText(u'0')
self.YLabel.setText( self.trUtf8(u'Y')) self.YLabel.setText(translate(u'DisplayTab', u'Y'))
self.Ypos.setText(u'0') self.Ypos.setText(u'0')
self.HeightLabel.setText( self.trUtf8(u'Height')) self.HeightLabel.setText(translate(u'DisplayTab', u'Height'))
self.Height.setText(u'0') self.Height.setText(u'0')
self.WidthLabel.setText( self.trUtf8(u'Width')) self.WidthLabel.setText(translate(u'DisplayTab', u'Width'))
self.Width.setText(u'0') self.Width.setText(u'0')
self.CurrentGroupBox_2.setTitle( self.trUtf8(u'Amend Settings')) self.CurrentGroupBox_2.setTitle(
self.XAmendLabel.setText( self.trUtf8(u'X')) translate(u'DisplayTab', u'Amend Settings'))
self.YAmendLabel.setText( self.trUtf8(u'Y')) self.XAmendLabel.setText(translate(u'DisplayTab', u'X'))
self.HeightAmendLabel.setText( self.trUtf8(u'Height')) self.YAmendLabel.setText(translate(u'DisplayTab', u'Y'))
self.WidthAmendLabel.setText( self.trUtf8(u'Width')) self.HeightAmendLabel.setText(translate(u'DisplayTab', u'Height'))
self.OverrideCheckBox.setText( self.trUtf8(u'Override Output Display')) self.WidthAmendLabel.setText(translate(u'DisplayTab', u'Width'))
self.OverrideCheckBox.setText(
translate(u'DisplayTab', u'Override Output Display'))
def load(self): def load(self):
settings = QtCore.QSettings() settings = QtCore.QSettings()
@ -209,16 +211,11 @@ class DisplayTab(SettingsTab):
def save(self): def save(self):
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
settings.setValue('x position', settings.setValue('x position', QtCore.QVariant(self.XposEdit.text()))
QtCore.QVariant(self.XposEdit.text())) settings.setValue('y position', QtCore.QVariant(self.YposEdit.text()))
settings.setValue('y position', settings.setValue('height', QtCore.QVariant(self.HeightEdit.text()))
QtCore.QVariant(self.YposEdit.text())) settings.setValue('width', QtCore.QVariant(self.WidthEdit.text()))
settings.setValue('height', settings.setValue('amend display', QtCore.QVariant(self.amend_display))
QtCore.QVariant(self.HeightEdit.text()))
settings.setValue('width',
QtCore.QVariant(self.WidthEdit.text()))
settings.setValue('amend display',
QtCore.QVariant(self.amend_display))
self.postSetUp() self.postSetUp()
def postSetUp(self): def postSetUp(self):

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver from openlp.core.lib import SettingsTab, Receiver, translate
class GeneralTab(SettingsTab): class GeneralTab(SettingsTab):
""" """
@ -54,7 +54,7 @@ class GeneralTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'GeneralTab') self.setObjectName(u'GeneralTab')
self.tabTitleVisible = self.trUtf8('General') self.tabTitleVisible = translate(u'GeneralTab', u'General')
self.GeneralLayout = QtGui.QHBoxLayout(self) self.GeneralLayout = QtGui.QHBoxLayout(self)
self.GeneralLayout.setSpacing(8) self.GeneralLayout.setSpacing(8)
self.GeneralLayout.setMargin(8) self.GeneralLayout.setMargin(8)
@ -177,25 +177,32 @@ class GeneralTab(SettingsTab):
QtCore.SIGNAL(u'editingFinished()'), self.onPasswordEditLostFocus) QtCore.SIGNAL(u'editingFinished()'), self.onPasswordEditLostFocus)
def retranslateUi(self): def retranslateUi(self):
self.MonitorGroupBox.setTitle(self.trUtf8('Monitors')) self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
self.MonitorLabel.setText( self.MonitorLabel.setText(
self.trUtf8('Select monitor for output display:')) translate(u'GeneralTab', u'Select monitor for output display:'))
self.DisplayOnMonitorCheck.setText( self.DisplayOnMonitorCheck.setText(
self.trUtf8('Display if a single screen')) translate(u'GeneralTab', u'Display if a single screen'))
self.StartupGroupBox.setTitle(self.trUtf8('Application Startup')) self.StartupGroupBox.setTitle(
self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning')) translate(u'GeneralTab', u'Application Startup'))
self.WarningCheckBox.setText(
translate(u'GeneralTab', u'Show blank screen warning'))
self.AutoOpenCheckBox.setText( self.AutoOpenCheckBox.setText(
self.trUtf8('Automatically open the last service')) translate(u'GeneralTab', u'Automatically open the last service'))
self.ShowSplashCheckBox.setText(self.trUtf8('Show the splash screen')) self.ShowSplashCheckBox.setText(
self.SettingsGroupBox.setTitle(self.trUtf8('Application Settings')) translate(u'GeneralTab', u'Show the splash screen'))
self.SettingsGroupBox.setTitle(
translate(u'GeneralTab', u'Application Settings'))
self.SaveCheckServiceCheckBox.setText( self.SaveCheckServiceCheckBox.setText(
self.trUtf8('Prompt to save Service before starting New')) translate(u'GeneralTab',
u'Prompt to save Service before starting New'))
self.AutoPreviewCheckBox.setText( self.AutoPreviewCheckBox.setText(
self.trUtf8('Preview Next Song from Service Manager')) translate(u'GeneralTab', u'Preview Next Song from Service Manager'))
self.CCLIGroupBox.setTitle(self.trUtf8('CCLI Details')) self.CCLIGroupBox.setTitle(translate(u'GeneralTab', u'CCLI Details'))
self.NumberLabel.setText(self.trUtf8('CCLI Number:')) self.NumberLabel.setText(translate(u'GeneralTab', u'CCLI Number:'))
self.UsernameLabel.setText(self.trUtf8('SongSelect Username:')) self.UsernameLabel.setText(
self.PasswordLabel.setText(self.trUtf8('SongSelect Password:')) translate(u'GeneralTab', u'SongSelect Username:'))
self.PasswordLabel.setText(
translate(u'GeneralTab', u'SongSelect Password:'))
def onMonitorComboBoxChanged(self): def onMonitorComboBoxChanged(self):
self.MonitorNumber = self.MonitorComboBox.currentIndex() self.MonitorNumber = self.MonitorComboBox.currentIndex()
@ -231,10 +238,11 @@ class GeneralTab(SettingsTab):
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
for screen in self.screens.screen_list: for screen in self.screens.screen_list:
screen_name = u'%s %d' % (self.trUtf8('Screen'), screen_name = u'%s %d' % (translate(u'GeneralTab', u'Screen'),
screen[u'number'] + 1) screen[u'number'] + 1)
if screen[u'primary']: if screen[u'primary']:
screen_name = u'%s (%s)' % (screen_name, self.trUtf8('primary')) screen_name = u'%s (%s)' % (screen_name,
translate(u'GeneralTab', u'primary'))
self.MonitorComboBox.addItem(screen_name) self.MonitorComboBox.addItem(screen_name)
# Get the configs # Get the configs
self.Warning = settings.value( self.Warning = settings.value(

View File

@ -354,111 +354,113 @@ class Ui_MainWindow(object):
""" """
Set up the translation system Set up the translation system
""" """
MainWindow.mainTitle = translate('MainWindow', 'OpenLP 2.0') MainWindow.mainTitle = translate(u'MainWindow', u'OpenLP 2.0')
MainWindow.language = translate('MainWindow', 'English') MainWindow.language = translate(u'MainWindow', u'English')
MainWindow.defaultThemeText = translate('MainWindow', MainWindow.defaultThemeText = translate(u'MainWindow',
'Default Theme: ') u'Default Theme: ')
MainWindow.setWindowTitle(MainWindow.mainTitle) MainWindow.setWindowTitle(MainWindow.mainTitle)
self.FileMenu.setTitle(translate('MainWindow', '&File')) self.FileMenu.setTitle(translate(u'MainWindow', u'&File'))
self.FileImportMenu.setTitle(translate('MainWindow', '&Import')) self.FileImportMenu.setTitle(translate(u'MainWindow', u'&Import'))
self.FileExportMenu.setTitle(translate('MainWindow', '&Export')) self.FileExportMenu.setTitle(translate(u'MainWindow', u'&Export'))
self.OptionsMenu.setTitle(translate('MainWindow', '&Options')) self.OptionsMenu.setTitle(translate(u'MainWindow', u'&Options'))
self.OptionsViewMenu.setTitle(translate('MainWindow', '&View')) self.OptionsViewMenu.setTitle(translate(u'MainWindow', u'&View'))
self.ViewModeMenu.setTitle(translate('MainWindow', 'M&ode')) self.ViewModeMenu.setTitle(translate(u'MainWindow', u'M&ode'))
self.OptionsLanguageMenu.setTitle(translate('MainWindow', self.OptionsLanguageMenu.setTitle(translate(u'MainWindow',
u'&Language')) u'&Language'))
self.ToolsMenu.setTitle(translate('MainWindow', '&Tools')) self.ToolsMenu.setTitle(translate(u'MainWindow', u'&Tools'))
self.HelpMenu.setTitle(translate('MainWindow', '&Help')) self.HelpMenu.setTitle(translate(u'MainWindow', u'&Help'))
self.MediaManagerDock.setWindowTitle( self.MediaManagerDock.setWindowTitle(
translate('MainWindow', 'Media Manager')) translate(u'MainWindow', u'Media Manager'))
self.ServiceManagerDock.setWindowTitle( self.ServiceManagerDock.setWindowTitle(
translate('MainWindow', 'Service Manager')) translate(u'MainWindow', u'Service Manager'))
self.ThemeManagerDock.setWindowTitle( self.ThemeManagerDock.setWindowTitle(
translate('MainWindow', 'Theme Manager')) translate(u'MainWindow', u'Theme Manager'))
self.FileNewItem.setText(translate('MainWindow', '&New')) self.FileNewItem.setText(translate(u'MainWindow', u'&New'))
self.FileNewItem.setToolTip(translate('MainWindow', 'New Service')) self.FileNewItem.setToolTip(translate(u'MainWindow', u'New Service'))
self.FileNewItem.setStatusTip( self.FileNewItem.setStatusTip(
translate('MainWindow', 'Create a new Service')) translate(u'MainWindow', u'Create a new Service'))
self.FileNewItem.setShortcut(translate('MainWindow', 'Ctrl+N')) self.FileNewItem.setShortcut(translate(u'MainWindow', u'Ctrl+N'))
self.FileOpenItem.setText(translate('MainWindow', '&Open')) self.FileOpenItem.setText(translate(u'MainWindow', u'&Open'))
self.FileOpenItem.setToolTip(translate('MainWindow', 'Open Service')) self.FileOpenItem.setToolTip(translate(u'MainWindow', u'Open Service'))
self.FileOpenItem.setStatusTip( self.FileOpenItem.setStatusTip(
translate('MainWindow', 'Open an existing service')) translate(u'MainWindow', u'Open an existing service'))
self.FileOpenItem.setShortcut(translate('MainWindow', 'Ctrl+O')) self.FileOpenItem.setShortcut(translate(u'MainWindow', u'Ctrl+O'))
self.FileSaveItem.setText(translate('MainWindow', '&Save')) self.FileSaveItem.setText(translate(u'MainWindow', u'&Save'))
self.FileSaveItem.setToolTip(translate('MainWindow', 'Save Service')) self.FileSaveItem.setToolTip(translate(u'MainWindow', u'Save Service'))
self.FileSaveItem.setStatusTip( self.FileSaveItem.setStatusTip(
translate('MainWindow', 'Save the current service to disk')) translate(u'MainWindow', u'Save the current service to disk'))
self.FileSaveItem.setShortcut(translate('MainWindow', 'Ctrl+S')) self.FileSaveItem.setShortcut(translate(u'MainWindow', u'Ctrl+S'))
self.FileSaveAsItem.setText(translate('MainWindow', 'Save &As...')) self.FileSaveAsItem.setText(translate(u'MainWindow', u'Save &As...'))
self.FileSaveAsItem.setToolTip( self.FileSaveAsItem.setToolTip(
translate('MainWindow', 'Save Service As')) translate(u'MainWindow', u'Save Service As'))
self.FileSaveAsItem.setStatusTip(translate('MainWindow', self.FileSaveAsItem.setStatusTip(translate(u'MainWindow',
'Save the current service under a new name')) u'Save the current service under a new name'))
self.FileSaveAsItem.setShortcut(translate('MainWindow', 'F12')) self.FileSaveAsItem.setShortcut(translate(u'MainWindow', u'F12'))
self.FileExitItem.setText(translate('MainWindow', 'E&xit')) self.FileExitItem.setText(translate(u'MainWindow', u'E&xit'))
self.FileExitItem.setStatusTip(translate('MainWindow', 'Quit OpenLP')) self.FileExitItem.setStatusTip(translate(u'MainWindow', u'Quit OpenLP'))
self.FileExitItem.setShortcut(translate('MainWindow', 'Alt+F4')) self.FileExitItem.setShortcut(translate(u'MainWindow', u'Alt+F4'))
self.ImportThemeItem.setText(translate('MainWindow', '&Theme')) self.ImportThemeItem.setText(translate(u'MainWindow', u'&Theme'))
self.ImportLanguageItem.setText(translate('MainWindow', '&Language')) self.ImportLanguageItem.setText(translate(u'MainWindow', u'&Language'))
self.ExportThemeItem.setText(translate('MainWindow', '&Theme')) self.ExportThemeItem.setText(translate(u'MainWindow', u'&Theme'))
self.ExportLanguageItem.setText(translate('MainWindow', '&Language')) self.ExportLanguageItem.setText(translate(u'MainWindow', u'&Language'))
self.actionLook_Feel.setText(translate('MainWindow', 'Look && &Feel')) self.actionLook_Feel.setText(translate(u'MainWindow', u'Look && &Feel'))
self.OptionsSettingsItem.setText(translate('MainWindow', '&Settings')) self.OptionsSettingsItem.setText(translate(u'MainWindow', u'&Settings'))
self.ViewMediaManagerItem.setText( self.ViewMediaManagerItem.setText(
translate('MainWindow', '&Media Manager')) translate(u'MainWindow', u'&Media Manager'))
self.ViewMediaManagerItem.setToolTip( self.ViewMediaManagerItem.setToolTip(
translate('MainWindow', 'Toggle Media Manager')) translate(u'MainWindow', u'Toggle Media Manager'))
self.ViewMediaManagerItem.setStatusTip(translate('MainWindow', self.ViewMediaManagerItem.setStatusTip(translate(u'MainWindow',
'Toggle the visibility of the Media Manager')) u'Toggle the visibility of the Media Manager'))
self.ViewMediaManagerItem.setShortcut(translate('MainWindow', 'F8')) self.ViewMediaManagerItem.setShortcut(translate(u'MainWindow', u'F8'))
self.ViewThemeManagerItem.setText( self.ViewThemeManagerItem.setText(
translate('MainWindow', '&Theme Manager')) translate(u'MainWindow', u'&Theme Manager'))
self.ViewThemeManagerItem.setToolTip( self.ViewThemeManagerItem.setToolTip(
translate('MainWindow', 'Toggle Theme Manager')) translate(u'MainWindow', u'Toggle Theme Manager'))
self.ViewThemeManagerItem.setStatusTip(translate('MainWindow', self.ViewThemeManagerItem.setStatusTip(translate(u'MainWindow',
'Toggle the visibility of the Theme Manager')) u'Toggle the visibility of the Theme Manager'))
self.ViewThemeManagerItem.setShortcut(translate('MainWindow', 'F10')) self.ViewThemeManagerItem.setShortcut(translate(u'MainWindow', u'F10'))
self.ViewServiceManagerItem.setText( self.ViewServiceManagerItem.setText(
translate('MainWindow', '&Service Manager')) translate(u'MainWindow', u'&Service Manager'))
self.ViewServiceManagerItem.setToolTip( self.ViewServiceManagerItem.setToolTip(
translate('MainWindow', 'Toggle Service Manager')) translate(u'MainWindow', u'Toggle Service Manager'))
self.ViewServiceManagerItem.setStatusTip(translate('MainWindow', self.ViewServiceManagerItem.setStatusTip(translate(u'MainWindow',
'Toggle the visibility of the Service Manager')) u'Toggle the visibility of the Service Manager'))
self.ViewServiceManagerItem.setShortcut(translate('MainWindow', 'F9')) self.ViewServiceManagerItem.setShortcut(translate(u'MainWindow', u'F9'))
self.action_Preview_Panel.setText( self.action_Preview_Panel.setText(
translate('MainWindow', '&Preview Panel')) translate(u'MainWindow', u'&Preview Panel'))
self.action_Preview_Panel.setToolTip( self.action_Preview_Panel.setToolTip(
translate('MainWindow', 'Toggle Preview Panel')) translate(u'MainWindow', u'Toggle Preview Panel'))
self.action_Preview_Panel.setStatusTip(translate('MainWindow', self.action_Preview_Panel.setStatusTip(translate(u'MainWindow',
'Toggle the visibility of the Preview Panel')) u'Toggle the visibility of the Preview Panel'))
self.action_Preview_Panel.setShortcut(translate('MainWindow', 'F11')) self.action_Preview_Panel.setShortcut(translate(u'MainWindow', u'F11'))
self.PluginItem.setText(translate('MainWindow', '&Plugin List')) self.PluginItem.setText(translate(u'MainWindow', u'&Plugin List'))
self.PluginItem.setStatusTip( self.PluginItem.setStatusTip(
translate('MainWindow', 'List the Plugins')) translate(u'MainWindow', u'List the Plugins'))
self.PluginItem.setShortcut(translate('MainWindow', 'Alt+F7')) self.PluginItem.setShortcut(translate(u'MainWindow', u'Alt+F7'))
self.HelpDocumentationItem.setText( self.HelpDocumentationItem.setText(
translate('MainWindow', '&User Guide')) translate(u'MainWindow', u'&User Guide'))
self.HelpAboutItem.setText(translate('MainWindow', '&About')) self.HelpAboutItem.setText(translate(u'MainWindow', u'&About'))
self.HelpAboutItem.setStatusTip( self.HelpAboutItem.setStatusTip(
translate('MainWindow', 'More information about OpenLP')) translate(u'MainWindow', u'More information about OpenLP'))
self.HelpAboutItem.setShortcut(translate('MainWindow', 'Ctrl+F1')) self.HelpAboutItem.setShortcut(translate(u'MainWindow', u'Ctrl+F1'))
self.HelpOnlineHelpItem.setText(translate('MainWindow', '&Online Help')) self.HelpOnlineHelpItem.setText(
self.HelpWebSiteItem.setText(translate('MainWindow', '&Web Site')) translate(u'MainWindow', u'&Online Help'))
self.HelpWebSiteItem.setText(translate(u'MainWindow', u'&Web Site'))
#i18n #i18n
self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect')) self.AutoLanguageItem.setText(translate(u'MainWindow', u'&Auto Detect'))
self.AutoLanguageItem.setStatusTip( self.AutoLanguageItem.setStatusTip(
translate('MainWindow', 'Choose System language, if available')) translate(u'MainWindow', u'Choose System language, if available'))
for item in self.LanguageGroup.actions(): for item in self.LanguageGroup.actions():
item.setText(item.objectName()) item.setText(item.objectName())
item.setStatusTip(translate('MainWindow', item.setStatusTip(translate(u'MainWindow',
'Set the interface language to %1').arg(item.objectName())) u'Set the interface language to %1').arg(item.objectName()))
self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...')) self.ToolsAddToolItem.setText(translate(u'MainWindow', u'Add &Tool...'))
self.ToolsAddToolItem.setStatusTip( self.ToolsAddToolItem.setStatusTip(
translate('MainWindow', 'Add an application to the list of tools')) translate(u'MainWindow',
u'Add an application to the list of tools'))
self.action_Preview_Panel.setText( self.action_Preview_Panel.setText(
translate('MainWindow', '&Preview Pane')) translate(u'MainWindow', u'&Preview Pane'))
self.ModeLiveItem.setText(translate('MainWindow', '&Live')) self.ModeLiveItem.setText(translate(u'MainWindow', u'&Live'))
class MainWindow(QtGui.QMainWindow, Ui_MainWindow): class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
@ -618,11 +620,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
Triggered by delay thread. Triggered by delay thread.
""" """
app_version = self.applicationVersion[u'full'] app_version = self.applicationVersion[u'full']
version_text = unicode(self.trUtf8('Version %s of OpenLP is now ' version_text = unicode(translate(u'MainWindow', u'Version %s of OpenLP '
'available for download (you are currently running version %s).' u'is now available for download (you are currently running version '
'\n\nYou can download the latest version from http://openlp.org')) u' %s). \n\nYou can download the latest version from '
u'http://openlp.org'))
QtGui.QMessageBox.question(self, QtGui.QMessageBox.question(self,
self.trUtf8('OpenLP Version Updated'), translate(u'MainWindow', u'OpenLP Version Updated'),
version_text % (version, app_version), version_text % (version, app_version),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
@ -653,8 +656,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
and settings.value(u'blank warning', QtCore.QVariant(False)).toBool(): and settings.value(u'blank warning', QtCore.QVariant(False)).toBool():
self.LiveController.onBlankDisplay(True) self.LiveController.onBlankDisplay(True)
QtGui.QMessageBox.question(self, QtGui.QMessageBox.question(self,
self.trUtf8('OpenLP Main Display Blanked'), translate(u'MainWindow', u'OpenLP Main Display Blanked'),
self.trUtf8('The Main Display has been blanked out'), translate(u'MainWindow',
u'The Main Display has been blanked out'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
settings.endGroup() settings.endGroup()
@ -709,9 +713,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
""" """
if self.serviceNotSaved: if self.serviceNotSaved:
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
self.trUtf8('Save Changes to Service?'), translate(u'MainWindow', u'Save Changes to Service?'),
self.trUtf8('Your service has changed. ' translate(u'MainWindow', u'Your service has changed. '
'Do you want to save those changes?'), u'Do you want to save those changes?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Cancel | QtGui.QMessageBox.Cancel |
QtGui.QMessageBox.Discard | QtGui.QMessageBox.Discard |

View File

@ -99,13 +99,15 @@ class Ui_PluginViewDialog(object):
QtCore.QMetaObject.connectSlotsByName(PluginViewDialog) QtCore.QMetaObject.connectSlotsByName(PluginViewDialog)
def retranslateUi(self, PluginViewDialog): def retranslateUi(self, PluginViewDialog):
PluginViewDialog.setWindowTitle(translate('PluginForm', 'Plugin List')) PluginViewDialog.setWindowTitle(
translate(u'PluginForm', u'Plugin List'))
self.PluginInfoGroupBox.setTitle( self.PluginInfoGroupBox.setTitle(
translate('PluginForm', 'Plugin Details')) translate(u'PluginForm', u'Plugin Details'))
self.VersionLabel.setText(translate('PluginForm', 'Version:')) self.VersionLabel.setText(
self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel')) translate(u'PluginForm', u'Version:'))
self.AboutLabel.setText(translate('PluginForm', 'About:')) self.VersionNumberLabel.setText(translate(u'PluginForm', u'TextLabel'))
self.StatusLabel.setText(translate('PluginForm', 'Status:')) self.AboutLabel.setText(translate(u'PluginForm', u'About:'))
self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active')) self.StatusLabel.setText(translate(u'PluginForm', u'Status:'))
self.StatusComboBox.setItemText(1, translate('PluginForm', 'Inactive')) self.StatusComboBox.setItemText(0, translate(u'PluginForm', u'Active'))
self.StatusComboBox.setItemText(1,
translate(u'PluginForm', u'Inactive'))

View File

@ -68,8 +68,9 @@ class Ui_ServiceItemEditDialog(object):
def retranslateUi(self, ServiceItemEditDialog): def retranslateUi(self, ServiceItemEditDialog):
ServiceItemEditDialog.setWindowTitle( ServiceItemEditDialog.setWindowTitle(
translate('ServiceItemEditForm', 'Service Item Maintenance')) translate(u'ServiceItemEditForm', u'Service Item Maintenance'))
self.upButton.setText(translate('ServiceItemEditForm', 'Up')) self.upButton.setText(translate(u'ServiceItemEditForm', u'Up'))
self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete')) self.deleteButton.setText(translate(u'ServiceItemEditForm', u'Delete'))
self.downButton.setText(translate('ServiceItemEditForm', 'Down')) self.downButton.setText(translate(u'ServiceItemEditForm', u'Down'))

View File

@ -38,21 +38,16 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
self.setupUi(self) self.setupUi(self)
self.itemList = [] self.itemList = []
# enable drop # enable drop
QtCore.QObject.connect(self.upButton, QtCore.QObject.connect(self.upButton, QtCore.SIGNAL(u'clicked()'),
QtCore.SIGNAL(u'clicked()'), self.onItemUp)
self.onItemUp) QtCore.QObject.connect(self.downButton, QtCore.SIGNAL(u'clicked()'),
QtCore.QObject.connect(self.downButton, self.onItemDown)
QtCore.SIGNAL(u'clicked()'), QtCore.QObject.connect(self.deleteButton, QtCore.SIGNAL(u'clicked()'),
self.onItemDown) self.onItemDelete)
QtCore.QObject.connect(self.deleteButton, QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
QtCore.SIGNAL(u'clicked()'), self.accept)
self.onItemDelete) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
QtCore.QObject.connect(self.buttonBox, self.reject)
QtCore.SIGNAL(u'accepted()'),
self.accept)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'rejected()'),
self.reject)
def setServiceItem(self, item): def setServiceItem(self, item):
self.item = item self.item = item
@ -68,8 +63,8 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
self.item._raw_frames = [] self.item._raw_frames = []
if self.item.is_image(): if self.item.is_image():
for item in self.itemList: for item in self.itemList:
self.item.add_from_image(item[u'path'], self.item.add_from_image(item[u'path'], item[u'title'],
item[u'title'], item[u'image']) item[u'image'])
self.item.render() self.item.render()
return self.item return self.item

View File

@ -33,7 +33,7 @@ log = logging.getLogger(__name__)
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, ServiceItem, contextMenuAction, \ from openlp.core.lib import OpenLPToolbar, ServiceItem, contextMenuAction, \
Receiver, build_icon, ItemCapabilities, SettingsManager Receiver, build_icon, ItemCapabilities, SettingsManager, translate
from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
@ -114,21 +114,27 @@ class ServiceManager(QtGui.QWidget):
# Create the top toolbar # Create the top toolbar
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('New Service'), u':/general/general_new.png', translate(u'ServiceManager', u'New Service'),
self.trUtf8('Create a new service'), self.onNewService) u':/general/general_new.png',
translate(u'ServiceManager', u'Create a new service'),
self.onNewService)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('Open Service'), u':/general/general_open.png', translate(u'ServiceManager', u'Open Service'),
self.trUtf8('Load an existing service'), self.onLoadService) u':/general/general_open.png',
translate(u'ServiceManager', u'Load an existing service'),
self.onLoadService)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('Save Service'), u':/general/general_save.png', translate(u'ServiceManager', u'Save Service'),
self.trUtf8('Save this service'), self.onSaveService) u':/general/general_save.png',
translate(u'ServiceManager', u'Save this service'),
self.onSaveService)
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
self.ThemeLabel = QtGui.QLabel(self.trUtf8('Theme:'), self.ThemeLabel = QtGui.QLabel(translate(u'ServiceManager', u'Theme:'),
self) self)
self.ThemeLabel.setMargin(3) self.ThemeLabel.setMargin(3)
self.Toolbar.addWidget(self.ThemeLabel) self.Toolbar.addWidget(self.ThemeLabel)
self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)
self.ThemeComboBox.setToolTip(self.trUtf8( self.ThemeComboBox.setToolTip(translate(u'ServiceManager',
u'Select a theme for the service')) u'Select a theme for the service'))
self.ThemeComboBox.setSizeAdjustPolicy( self.ThemeComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToContents) QtGui.QComboBox.AdjustToContents)
@ -161,22 +167,29 @@ class ServiceManager(QtGui.QWidget):
# Add the bottom toolbar # Add the bottom toolbar
self.OrderToolbar = OpenLPToolbar(self) self.OrderToolbar = OpenLPToolbar(self)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
self.trUtf8('Move to &top'), u':/services/service_top.png', translate(u'ServiceManager', u'Move to &top'),
self.trUtf8('Move to top'), self.onServiceTop) u':/services/service_top.png',
translate(u'ServiceManager', u'Move to top'), self.onServiceTop)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
self.trUtf8('Move &up'), u':/services/service_up.png', translate(u'ServiceManager', u'Move &up'),
self.trUtf8('Move up order'), self.onServiceUp) u':/services/service_up.png',
translate(u'ServiceManager', u'Move up order'), self.onServiceUp)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
self.trUtf8('Move &down'), u':/services/service_down.png', translate(u'ServiceManager', u'Move &down'),
self.trUtf8('Move down order'), self.onServiceDown) u':/services/service_down.png',
translate(u'ServiceManager', u'Move down order'),
self.onServiceDown)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
self.trUtf8('Move to &bottom'), u':/services/service_bottom.png', translate(u'ServiceManager', u'Move to &bottom'),
self.trUtf8('Move to end'), self.onServiceEnd) u':/services/service_bottom.png',
translate(u'ServiceManager', u'Move to end'),
self.onServiceEnd)
self.OrderToolbar.addSeparator() self.OrderToolbar.addSeparator()
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
self.trUtf8('&Delete From Service'), translate(u'ServiceManager', u'&Delete From Service'),
u':/general/general_delete.png', u':/general/general_delete.png',
self.trUtf8('Delete From Service'), self.onDeleteFromService) translate(u'ServiceManager', u'Delete From Service'),
self.onDeleteFromService)
self.Layout.addWidget(self.OrderToolbar) self.Layout.addWidget(self.OrderToolbar)
# Connect up our signals and slots # Connect up our signals and slots
QtCore.QObject.connect(self.ThemeComboBox, QtCore.QObject.connect(self.ThemeComboBox,
@ -206,31 +219,38 @@ class ServiceManager(QtGui.QWidget):
self.servicePath = AppLocation.get_section_data_path(u'servicemanager') self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
#build the drag and drop context menu #build the drag and drop context menu
self.dndMenu = QtGui.QMenu() self.dndMenu = QtGui.QMenu()
self.newAction = self.dndMenu.addAction(self.trUtf8('&Add New Item')) self.newAction = self.dndMenu.addAction(
translate(u'ServiceManager', u'&Add New Item'))
self.newAction.setIcon(build_icon(u':/general/general_edit.png')) self.newAction.setIcon(build_icon(u':/general/general_edit.png'))
self.addToAction = self.dndMenu.addAction( self.addToAction = self.dndMenu.addAction(
self.trUtf8('&Add to Selected Item')) translate(u'ServiceManager', u'&Add to Selected Item'))
self.addToAction.setIcon(build_icon(u':/general/general_edit.png')) self.addToAction.setIcon(build_icon(u':/general/general_edit.png'))
#build the context menu #build the context menu
self.menu = QtGui.QMenu() self.menu = QtGui.QMenu()
self.editAction = self.menu.addAction(self.trUtf8('&Edit Item')) self.editAction = self.menu.addAction(
translate(u'ServiceManager', u'&Edit Item'))
self.editAction.setIcon(build_icon(u':/general/general_edit.png')) self.editAction.setIcon(build_icon(u':/general/general_edit.png'))
self.maintainAction = self.menu.addAction(self.trUtf8('&Maintain Item')) self.maintainAction = self.menu.addAction(
translate(u'ServiceManager', u'&Maintain Item'))
self.maintainAction.setIcon(build_icon(u':/general/general_edit.png')) self.maintainAction.setIcon(build_icon(u':/general/general_edit.png'))
self.notesAction = self.menu.addAction(self.trUtf8('&Notes')) self.notesAction = self.menu.addAction(
translate(u'ServiceManager', u'&Notes'))
self.notesAction.setIcon(build_icon(u':/services/service_notes.png')) self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
self.deleteAction = self.menu.addAction( self.deleteAction = self.menu.addAction(
self.trUtf8('&Delete From Service')) translate(u'ServiceManager', u'&Delete From Service'))
self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png'))
self.sep1 = self.menu.addAction(u'') self.sep1 = self.menu.addAction(u'')
self.sep1.setSeparator(True) self.sep1.setSeparator(True)
self.previewAction = self.menu.addAction(self.trUtf8('&Preview Verse')) self.previewAction = self.menu.addAction(
translate(u'ServiceManager', u'&Preview Verse'))
self.previewAction.setIcon(build_icon(u':/general/general_preview.png')) self.previewAction.setIcon(build_icon(u':/general/general_preview.png'))
self.liveAction = self.menu.addAction(self.trUtf8('&Live Verse')) self.liveAction = self.menu.addAction(
translate(u'ServiceManager', u'&Live Verse'))
self.liveAction.setIcon(build_icon(u':/general/general_live.png')) self.liveAction.setIcon(build_icon(u':/general/general_live.png'))
self.sep2 = self.menu.addAction(u'') self.sep2 = self.menu.addAction(u'')
self.sep2.setSeparator(True) self.sep2.setSeparator(True)
self.themeMenu = QtGui.QMenu(self.trUtf8(u'&Change Item Theme')) self.themeMenu = QtGui.QMenu(
translate(u'ServiceManager', u'&Change Item Theme'))
self.menu.addMenu(self.themeMenu) self.menu.addMenu(self.themeMenu)
def supportedSuffixes(self, suffix): def supportedSuffixes(self, suffix):
@ -462,9 +482,10 @@ class ServiceManager(QtGui.QWidget):
self.parent.generalSettingsSection + u'/save prompt', self.parent.generalSettingsSection + u'/save prompt',
QtCore.QVariant(False)).toBool(): QtCore.QVariant(False)).toBool():
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
self.trUtf8('Save Changes to Service?'), translate(u'ServiceManager', u'Save Changes to Service?'),
self.trUtf8('Your service is unsaved, do you want to save ' translate(u'ServiceManager',
'those changes before creating a new one?'), u'Your service is unsaved, do you want to save '
u'those changes before creating a new one?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Cancel | QtGui.QMessageBox.Cancel |
QtGui.QMessageBox.Save), QtGui.QMessageBox.Save),
@ -547,9 +568,9 @@ class ServiceManager(QtGui.QWidget):
log.debug(u'onSaveService') log.debug(u'onSaveService')
if not quick or self.isNew: if not quick or self.isNew:
filename = QtGui.QFileDialog.getSaveFileName(self, filename = QtGui.QFileDialog.getSaveFileName(self,
self.trUtf8(u'Save Service'), translate(u'ServiceManager', u'Save Service'),
SettingsManager.get_last_dir(self.parent.serviceSettingsSection), SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
self.trUtf8(u'OpenLP Service Files (*.osz)')) translate(u'ServiceManager', u'OpenLP Service Files (*.osz)'))
else: else:
filename = SettingsManager.get_last_dir( filename = SettingsManager.get_last_dir(
self.parent.serviceSettingsSection) self.parent.serviceSettingsSection)
@ -606,7 +627,7 @@ class ServiceManager(QtGui.QWidget):
self.parent.serviceSettingsSection) self.parent.serviceSettingsSection)
else: else:
filename = QtGui.QFileDialog.getOpenFileName( filename = QtGui.QFileDialog.getOpenFileName(
self, self.trUtf8('Open Service'), self, translate(u'ServiceManager', u'Open Service'),
SettingsManager.get_last_dir( SettingsManager.get_last_dir(
self.parent.serviceSettingsSection), u'Services (*.osz)') self.parent.serviceSettingsSection), u'Services (*.osz)')
self.loadService(filename) self.loadService(filename)
@ -619,9 +640,10 @@ class ServiceManager(QtGui.QWidget):
""" """
if self.parent.serviceNotSaved: if self.parent.serviceNotSaved:
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
self.trUtf8('Save Changes to Service?'), translate(u'ServiceManager', u'Save Changes to Service?'),
self.trUtf8('Your current service is unsaved, do you want to ' translate(u'ServiceManager',
'save the changes before opening a new one?'), u'Your current service is unsaved, do you want to '
u'save the changes before opening a new one?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Discard | QtGui.QMessageBox.Discard |
QtGui.QMessageBox.Save), QtGui.QMessageBox.Save),
@ -783,9 +805,9 @@ class ServiceManager(QtGui.QWidget):
self.serviceItems[item][u'service_item'], count) self.serviceItems[item][u'service_item'], count)
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Missing Display Handler'), translate(u'ServiceManager', u'Missing Display Handler'),
self.trUtf8('Your item cannot be displayed as ' translate(u'ServiceManager', u'Your item cannot be displayed '
'there is no handler to display it'), u'as there is no handler to display it'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
@ -819,9 +841,9 @@ class ServiceManager(QtGui.QWidget):
self.serviceItems[item][u'service_item'], 0) self.serviceItems[item][u'service_item'], 0)
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Missing Display Handler'), translate(u'ServiceManager', u'Missing Display Handler'),
self.trUtf8('Your item cannot be displayed as ' translate(u'ServiceManager', u'Your item cannot be displayed '
'there is no handler to display it'), u'as there is no handler to display it'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)

View File

@ -49,5 +49,4 @@ class Ui_ServiceNoteEdit(object):
def retranslateUi(self, ServiceNoteEdit): def retranslateUi(self, ServiceNoteEdit):
ServiceNoteEdit.setWindowTitle( ServiceNoteEdit.setWindowTitle(
translate('ServiceNoteForm', 'Service Item Notes')) translate(u'ServiceNoteForm', u'Service Item Notes'))

View File

@ -24,6 +24,7 @@
############################################################################### ###############################################################################
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from servicenotedialog import Ui_ServiceNoteEdit from servicenotedialog import Ui_ServiceNoteEdit
class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit): class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit):
@ -36,9 +37,7 @@ class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit):
""" """
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)
QtCore.QObject.connect(self.buttonBox, QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
QtCore.SIGNAL(u'accepted()'), self.accept)
self.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
QtCore.QObject.connect(self.buttonBox, self.reject)
QtCore.SIGNAL(u'rejected()'),
self.reject)

View File

@ -60,4 +60,4 @@ class Ui_SettingsDialog(object):
QtCore.QMetaObject.connectSlotsByName(SettingsDialog) QtCore.QMetaObject.connectSlotsByName(SettingsDialog)
def retranslateUi(self, SettingsDialog): def retranslateUi(self, SettingsDialog):
SettingsDialog.setWindowTitle(translate('SettingsForm', 'Settings')) SettingsDialog.setWindowTitle(translate(u'SettingsForm', u'Settings'))

View File

@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon
from openlp.core.ui import HideMode from openlp.core.ui import HideMode
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \ from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
ItemCapabilities ItemCapabilities, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -127,11 +127,11 @@ class SlideController(QtGui.QWidget):
# Type label for the top of the slide controller # Type label for the top of the slide controller
self.TypeLabel = QtGui.QLabel(self.Panel) self.TypeLabel = QtGui.QLabel(self.Panel)
if self.isLive: if self.isLive:
self.TypeLabel.setText(self.trUtf8('Live')) self.TypeLabel.setText(translate(u'SlideController', u'Live'))
self.split = 1 self.split = 1
self.typePrefix = u'live' self.typePrefix = u'live'
else: else:
self.TypeLabel.setText(self.trUtf8('Preview')) self.TypeLabel.setText(translate(u'SlideController', u'Preview'))
self.split = 0 self.split = 0
self.typePrefix = u'preview' self.typePrefix = u'preview'
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
@ -178,75 +178,92 @@ class SlideController(QtGui.QWidget):
if self.isLive: if self.isLive:
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'First Slide', u':/slides/slide_first.png', u'First Slide', u':/slides/slide_first.png',
self.trUtf8('Move to first'), self.onSlideSelectedFirst) translate(u'SlideController', u'Move to first'),
self.onSlideSelectedFirst)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Previous Slide', u':/slides/slide_previous.png', u'Previous Slide', u':/slides/slide_previous.png',
self.trUtf8('Move to previous'), self.onSlideSelectedPrevious) translate(u'SlideController', u'Move to previous'),
self.onSlideSelectedPrevious)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Next Slide', u':/slides/slide_next.png', u'Next Slide', u':/slides/slide_next.png',
self.trUtf8('Move to next'), self.onSlideSelectedNext) translate(u'SlideController', u'Move to next'),
self.onSlideSelectedNext)
if self.isLive: if self.isLive:
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Last Slide', u':/slides/slide_last.png', u'Last Slide', u':/slides/slide_last.png',
self.trUtf8('Move to last'), self.onSlideSelectedLast) translate(u'SlideController', u'Move to last'),
self.onSlideSelectedLast)
if self.isLive: if self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.blankButton = self.Toolbar.addToolbarButton( self.blankButton = self.Toolbar.addToolbarButton(
u'Blank Screen', u':/slides/slide_blank.png', u'Blank Screen', u':/slides/slide_blank.png',
self.trUtf8('Blank Screen'), self.onBlankDisplay, True) translate(u'SlideController', u'Blank Screen'),
self.onBlankDisplay, True)
self.themeButton = self.Toolbar.addToolbarButton( self.themeButton = self.Toolbar.addToolbarButton(
u'Display Theme', u':/slides/slide_theme.png', u'Display Theme', u':/slides/slide_theme.png',
self.trUtf8('Theme Screen'), self.onThemeDisplay, True) translate(u'SlideController', u'Theme Screen'),
self.onThemeDisplay, True)
self.hideButton = self.Toolbar.addToolbarButton( self.hideButton = self.Toolbar.addToolbarButton(
u'Hide screen', u':/slides/slide_desktop.png', u'Hide screen', u':/slides/slide_desktop.png',
self.trUtf8('Hide Screen'), self.onHideDisplay, True) translate(u'SlideController', u'Hide Screen'),
self.onHideDisplay, True)
if not self.isLive: if not self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Go Live', u':/general/general_live.png', u'Go Live', u':/general/general_live.png',
self.trUtf8('Move to live'), self.onGoLive) translate(u'SlideController', u'Move to live'), self.onGoLive)
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Edit Song', u':/general/general_edit.png', u'Edit Song', u':/general/general_edit.png',
self.trUtf8('Edit and re-preview Song'), self.onEditSong) translate(u'SlideController', u'Edit and re-preview Song'),
self.onEditSong)
if isLive: if isLive:
self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarSeparator(u'Loop Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Start Loop', u':/media/media_time.png', u'Start Loop', u':/media/media_time.png',
self.trUtf8('Start continuous loop'), self.onStartLoop) translate(u'SlideController', u'Start continuous loop'),
self.onStartLoop)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Stop Loop', u':/media/media_stop.png', u'Stop Loop', u':/media/media_stop.png',
self.trUtf8('Stop continuous loop'), self.onStopLoop) translate(u'SlideController', u'Stop continuous loop'),
self.onStopLoop)
self.DelaySpinBox = QtGui.QSpinBox() self.DelaySpinBox = QtGui.QSpinBox()
self.DelaySpinBox.setMinimum(1) self.DelaySpinBox.setMinimum(1)
self.DelaySpinBox.setMaximum(180) self.DelaySpinBox.setMaximum(180)
self.Toolbar.addToolbarWidget( self.Toolbar.addToolbarWidget(
u'Image SpinBox', self.DelaySpinBox) u'Image SpinBox', self.DelaySpinBox)
self.DelaySpinBox.setSuffix(self.trUtf8('s')) self.DelaySpinBox.setSuffix(translate(u'SlideController', u's'))
self.DelaySpinBox.setToolTip( self.DelaySpinBox.setToolTip(
self.trUtf8('Delay between slides in seconds')) translate(u'SlideController',
u'Delay between slides in seconds'))
self.ControllerLayout.addWidget(self.Toolbar) self.ControllerLayout.addWidget(self.Toolbar)
#Build a Media ToolBar #Build a Media ToolBar
self.Mediabar = OpenLPToolbar(self) self.Mediabar = OpenLPToolbar(self)
self.Mediabar.addToolbarButton( self.Mediabar.addToolbarButton(
u'Media Start', u':/slides/media_playback_start.png', u'Media Start', u':/slides/media_playback_start.png',
self.trUtf8('Start playing media'), self.onMediaPlay) translate(u'SlideController', u'Start playing media'),
self.onMediaPlay)
self.Mediabar.addToolbarButton( self.Mediabar.addToolbarButton(
u'Media Pause', u':/slides/media_playback_pause.png', u'Media Pause', u':/slides/media_playback_pause.png',
self.trUtf8('Start playing media'), self.onMediaPause) translate(u'SlideController', u'Start playing media'),
self.onMediaPause)
self.Mediabar.addToolbarButton( self.Mediabar.addToolbarButton(
u'Media Stop', u':/slides/media_playback_stop.png', u'Media Stop', u':/slides/media_playback_stop.png',
self.trUtf8('Start playing media'), self.onMediaStop) translate(u'SlideController', u'Start playing media'),
self.onMediaStop)
if self.isLive: if self.isLive:
self.blankButton = self.Mediabar.addToolbarButton( self.blankButton = self.Mediabar.addToolbarButton(
u'Blank Screen', u':/slides/slide_blank.png', u'Blank Screen', u':/slides/slide_blank.png',
self.trUtf8('Blank Screen'), self.onBlankDisplay, True) translate(u'SlideController', u'Blank Screen'),
self.onBlankDisplay, True)
self.themeButton = self.Mediabar.addToolbarButton( self.themeButton = self.Mediabar.addToolbarButton(
u'Display Theme', u':/slides/slide_theme.png', u'Display Theme', u':/slides/slide_theme.png',
self.trUtf8('Theme Screen'), self.onThemeDisplay, True) translate(u'SlideController', u'Theme Screen'),
self.onThemeDisplay, True)
self.hideButton = self.Mediabar.addToolbarButton( self.hideButton = self.Mediabar.addToolbarButton(
u'Hide screen', u':/slides/slide_desktop.png', u'Hide screen', u':/slides/slide_desktop.png',
self.trUtf8('Hide Screen'), self.onHideDisplay, True) translate(u'SlideController', u'Hide Screen'),
self.onHideDisplay, True)
if not self.isLive: if not self.isLive:
self.seekSlider = Phonon.SeekSlider() self.seekSlider = Phonon.SeekSlider()
self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24)) self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
@ -262,11 +279,11 @@ class SlideController(QtGui.QWidget):
# Build the Song Toolbar # Build the Song Toolbar
if isLive: if isLive:
self.SongMenu = QtGui.QToolButton(self.Toolbar) self.SongMenu = QtGui.QToolButton(self.Toolbar)
self.SongMenu.setText(self.trUtf8('Go to Verse')) self.SongMenu.setText(translate(u'SlideController', u'Go to Verse'))
self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu) self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
self.SongMenu.setMenu(QtGui.QMenu(self.trUtf8('Go to Verse'), self.SongMenu.setMenu(QtGui.QMenu(
self.Toolbar)) translate(u'SlideController', u'Go to Verse'), self.Toolbar))
self.Toolbar.makeWidgetsInvisible([u'Song Menu']) self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
# Screen preview area # Screen preview area
self.PreviewFrame = QtGui.QFrame(self.Splitter) self.PreviewFrame = QtGui.QFrame(self.Splitter)
@ -545,7 +562,8 @@ class SlideController(QtGui.QWidget):
if self.isLive and frame[u'verseTag'] is not None: if self.isLive and frame[u'verseTag'] is not None:
if tag1 not in self.slideList: if tag1 not in self.slideList:
self.slideList[tag1] = framenumber self.slideList[tag1] = framenumber
self.SongMenu.menu().addAction(self.trUtf8(u'%s'%tag1), self.SongMenu.menu().addAction(
translate(u'SlideController', u'%s'%tag1),
self.onSongBarHandler) self.onSongBarHandler)
item.setText(frame[u'text']) item.setText(frame[u'text'])
else: else:

View File

@ -35,7 +35,7 @@ from openlp.core.ui import AmendThemeForm
from openlp.core.theme import Theme from openlp.core.theme import Theme
from openlp.core.lib import OpenLPToolbar, contextMenuAction, \ from openlp.core.lib import OpenLPToolbar, contextMenuAction, \
ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \ ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \
contextMenuSeparator, SettingsManager contextMenuSeparator, SettingsManager, translate
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -54,21 +54,25 @@ class ThemeManager(QtGui.QWidget):
self.amendThemeForm = AmendThemeForm(self) self.amendThemeForm = AmendThemeForm(self)
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('New Theme'), u':/themes/theme_new.png', translate(u'ThemeManager', u'New Theme'), u':/themes/theme_new.png',
self.trUtf8('Create a new theme'), self.onAddTheme) translate(u'ThemeManager', u'Create a new theme'), self.onAddTheme)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('Edit Theme'), u':/themes/theme_edit.png', translate(u'ThemeManager', u'Edit Theme'),
self.trUtf8('Edit a theme'), self.onEditTheme) u':/themes/theme_edit.png',
translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('Delete Theme'), u':/general/general_delete.png', translate(u'ThemeManager', u'Delete Theme'),
self.trUtf8('Delete a theme'), self.onDeleteTheme) u':/general/general_delete.png',
translate(u'ThemeManager', u'Delete a theme'), self.onDeleteTheme)
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('Import Theme'), u':/general/general_import.png', translate(u'ThemeManager', u'Import Theme'),
self.trUtf8('Import a theme'), self.onImportTheme) u':/general/general_import.png',
translate(u'ThemeManager', u'Import a theme'), self.onImportTheme)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
self.trUtf8('Export Theme'), u':/general/general_export.png', translate(u'ThemeManager', u'Export Theme'),
self.trUtf8('Export a theme'), self.onExportTheme) u':/general/general_export.png',
translate(u'ThemeManager', u'Export a theme'), self.onExportTheme)
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
self.Layout.addWidget(self.Toolbar) self.Layout.addWidget(self.Toolbar)
self.ThemeListWidget = QtGui.QListWidget(self) self.ThemeListWidget = QtGui.QListWidget(self)
@ -78,24 +82,24 @@ class ThemeManager(QtGui.QWidget):
self.ThemeListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.ThemeListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.ThemeListWidget.addAction( self.ThemeListWidget.addAction(
contextMenuAction(self.ThemeListWidget, u':/themes/theme_edit.png', contextMenuAction(self.ThemeListWidget, u':/themes/theme_edit.png',
self.trUtf8('Edit a theme'), self.onEditTheme)) translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme))
self.ThemeListWidget.addAction( self.ThemeListWidget.addAction(
contextMenuSeparator(self.ThemeListWidget)) contextMenuSeparator(self.ThemeListWidget))
self.ThemeListWidget.addAction( self.ThemeListWidget.addAction(
contextMenuAction(self.ThemeListWidget, contextMenuAction(self.ThemeListWidget,
u':/general/general_delete.png', u':/general/general_delete.png',
self.trUtf8('Delete theme'), translate(u'ThemeManager', u'Delete theme'),
self.onDeleteTheme)) self.onDeleteTheme))
self.ThemeListWidget.addAction( self.ThemeListWidget.addAction(
contextMenuAction(self.ThemeListWidget, contextMenuAction(self.ThemeListWidget,
u':/general/general_export.png', u':/general/general_export.png',
self.trUtf8('Make Global'), translate(u'ThemeManager', u'Make Global'),
self.changeGlobalFromScreen)) self.changeGlobalFromScreen))
self.ThemeListWidget.addAction( self.ThemeListWidget.addAction(
contextMenuAction(self.ThemeListWidget, contextMenuAction(self.ThemeListWidget,
u':/general/general_export.png', u':/general/general_export.png',
self.trUtf8('Export theme'), translate(u'ThemeManager', u'Export theme'),
self.onExportTheme)) self.onExportTheme))
self.ThemeListWidget.addAction( self.ThemeListWidget.addAction(
contextMenuSeparator(self.ThemeListWidget)) contextMenuSeparator(self.ThemeListWidget))
#Signals #Signals
@ -127,7 +131,8 @@ class ThemeManager(QtGui.QWidget):
self.ThemeListWidget.item(count).setText(newName) self.ThemeListWidget.item(count).setText(newName)
#Set the new name #Set the new name
if themeName == newName: if themeName == newName:
name = u'%s (%s)' % (newName, self.trUtf8('default')) name = u'%s (%s)' % (newName,
translate(u'ThemeManager', u'default'))
self.ThemeListWidget.item(count).setText(name) self.ThemeListWidget.item(count).setText(name)
def changeGlobalFromScreen(self, index = -1): def changeGlobalFromScreen(self, index = -1):
@ -144,7 +149,8 @@ class ThemeManager(QtGui.QWidget):
if count == selected_row: if count == selected_row:
self.global_theme = unicode( self.global_theme = unicode(
self.ThemeListWidget.item(count).text()) self.ThemeListWidget.item(count).text())
name = u'%s (%s)' % (self.global_theme, self.trUtf8('default')) name = u'%s (%s)' % (self.global_theme,
translate(u'ThemeManager', u'default'))
self.ThemeListWidget.item(count).setText(name) self.ThemeListWidget.item(count).setText(name)
QtCore.QSettings().setValue( QtCore.QSettings().setValue(
self.settingsSection + u'/global theme', self.settingsSection + u'/global theme',
@ -178,20 +184,25 @@ class ThemeManager(QtGui.QWidget):
# should be the same unless default # should be the same unless default
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()): if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'ThemeManager', u'Error'),
self.trUtf8('You are unable to delete the default theme.'), translate(u'ThemeManager',
u'You are unable to delete the default theme.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
else: else:
for plugin in self.parent.plugin_manager.plugins: for plugin in self.parent.plugin_manager.plugins:
if not plugin.can_delete_theme(theme): if not plugin.can_delete_theme(theme):
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), QtGui.QMessageBox.critical(self,
self.trUtf8('Theme %s is use in %s plugin' % (theme, translate(u'ThemeManager', u'Error'),
translate(u'ThemeManager',
u'Theme %s is use in %s plugin' % (theme,
plugin.name))) plugin.name)))
return return
if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme:
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), QtGui.QMessageBox.critical(
self.trUtf8('Theme %s is use by Service Manager' % self, translate(u'ThemeManager',u'Error'),
theme)) translate(u'ThemeManager',
u'Theme %s is use by Service Manager' % theme),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return return
self.themelist.remove(theme) self.themelist.remove(theme)
th = theme + u'.png' th = theme + u'.png'
@ -215,13 +226,14 @@ class ThemeManager(QtGui.QWidget):
""" """
item = self.ThemeListWidget.currentItem() item = self.ThemeListWidget.currentItem()
if item is None: if item is None:
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), QtGui.QMessageBox.critical(self,
self.trUtf8('You have not selected a theme.'), translate(u'ThemeManager', u'Error'),
translate(u'ThemeManager', u'You have not selected a theme.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return return
theme = unicode(item.data(QtCore.Qt.UserRole).toString()) theme = unicode(item.data(QtCore.Qt.UserRole).toString())
path = QtGui.QFileDialog.getExistingDirectory(self, path = QtGui.QFileDialog.getExistingDirectory(self,
unicode(self.trUtf8('Save Theme - (%s)')) % theme, unicode(translate(u'ThemeManager', u'Save Theme - (%s)')) % theme,
SettingsManager.get_last_dir(self.settingsSection, 1)) SettingsManager.get_last_dir(self.settingsSection, 1))
path = unicode(path) path = unicode(path)
if path: if path:
@ -244,7 +256,7 @@ class ThemeManager(QtGui.QWidget):
def onImportTheme(self): def onImportTheme(self):
files = QtGui.QFileDialog.getOpenFileNames( files = QtGui.QFileDialog.getOpenFileNames(
self, self.trUtf8('Select Theme Import File'), self, translate(u'ThemeManager', u'Select Theme Import File'),
SettingsManager.get_last_dir(self.settingsSection), u'Theme (*.*)') SettingsManager.get_last_dir(self.settingsSection), u'Theme (*.*)')
log.info(u'New Themes %s', unicode(files)) log.info(u'New Themes %s', unicode(files))
if files: if files:
@ -272,7 +284,8 @@ class ThemeManager(QtGui.QWidget):
if os.path.exists(theme): if os.path.exists(theme):
textName = os.path.splitext(name)[0] textName = os.path.splitext(name)[0]
if textName == self.global_theme: if textName == self.global_theme:
name = u'%s (%s)' % (textName, self.trUtf8('default')) name = u'%s (%s)' % (textName,
translate(u'ThemeManager', u'default'))
else: else:
name = textName name = textName
thumb = os.path.join(self.thumbPath, u'%s.png' % textName) thumb = os.path.join(self.thumbPath, u'%s.png' % textName)
@ -358,8 +371,8 @@ class ThemeManager(QtGui.QWidget):
self.generateAndSaveImage(dir, themename, filexml) self.generateAndSaveImage(dir, themename, filexml)
except IOError: except IOError:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'ThemeManager', u'Error'),
self.trUtf8('File is not a valid theme.')) translate(u'ThemeManager', u'File is not a valid theme.'))
log.exception(u'Importing theme from zip file failed %s' % filename) log.exception(u'Importing theme from zip file failed %s' % filename)
finally: finally:
if zip: if zip:
@ -440,9 +453,10 @@ class ThemeManager(QtGui.QWidget):
if self.saveThemeName != name: if self.saveThemeName != name:
if os.path.exists(theme_file): if os.path.exists(theme_file):
result = QtGui.QMessageBox.question( result = QtGui.QMessageBox.question(
self, self.trUtf8('Theme Exists'), self, translate(u'ThemeManager', u'Theme Exists'),
self.trUtf8('A theme with this name already exists, ' translate(u'ThemeManager',
'would you like to overwrite it?'), u'A theme with this name already exists, '
u'would you like to overwrite it?'),
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No) QtGui.QMessageBox.No)
if result == QtGui.QMessageBox.Yes: if result == QtGui.QMessageBox.Yes:
@ -498,7 +512,7 @@ class ThemeManager(QtGui.QWidget):
def baseTheme(self): def baseTheme(self):
log.debug(u'base theme created') log.debug(u'base theme created')
newtheme = ThemeXML() newtheme = ThemeXML()
newtheme.new_document(unicode(self.trUtf8('New Theme'))) newtheme.new_document(unicode(translate(u'ThemeManager', u'New Theme')))
newtheme.add_background_solid(unicode(u'#000000')) newtheme.add_background_solid(unicode(u'#000000'))
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
unicode(30), u'False') unicode(30), u'False')

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, ThemeLevel from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate
class ThemesTab(SettingsTab): class ThemesTab(SettingsTab):
""" """
@ -37,7 +37,7 @@ class ThemesTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'ThemesTab') self.setObjectName(u'ThemesTab')
self.tabTitleVisible = self.trUtf8('Themes') self.tabTitleVisible = translate(u'ThemesTab', u'Themes')
self.ThemesTabLayout = QtGui.QHBoxLayout(self) self.ThemesTabLayout = QtGui.QHBoxLayout(self)
self.ThemesTabLayout.setSpacing(8) self.ThemesTabLayout.setSpacing(8)
self.ThemesTabLayout.setMargin(8) self.ThemesTabLayout.setMargin(8)
@ -106,21 +106,26 @@ class ThemesTab(SettingsTab):
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self): def retranslateUi(self):
self.GlobalGroupBox.setTitle(self.trUtf8('Global theme')) self.GlobalGroupBox.setTitle(translate(u'ThemesTab', u'Global theme'))
self.LevelGroupBox.setTitle(self.trUtf8('Theme level')) self.LevelGroupBox.setTitle(translate(u'ThemesTab', u'Theme level'))
self.SongLevelRadioButton.setText(self.trUtf8('Song level')) self.SongLevelRadioButton.setText(
self.SongLevelLabel.setText(self.trUtf8('Use the theme from each song ' translate(u'ThemesTab', u'Song level'))
'in the database. If a song doesn\'t have a theme associated with ' self.SongLevelLabel.setText(
'it, then use the service\'s theme. If the service doesn\'t have ' translate(u'ThemesTab', u'Use the theme from each song '
'a theme, then use the global theme.')) u'in the database. If a song doesn\'t have a theme associated with '
self.ServiceLevelRadioButton.setText(self.trUtf8('Service level')) u'it, then use the service\'s theme. If the service doesn\'t have '
self.ServiceLevelLabel.setText(self.trUtf8('Use the theme from the ' u'a theme, then use the global theme.'))
'service, overriding any of the individual songs\' themes. If the ' self.ServiceLevelRadioButton.setText(
'service doesn\'t have a theme, then use the global theme.')) translate(u'ThemesTab', u'Service level'))
self.GlobalLevelRadioButton.setText(self.trUtf8('Global level')) self.ServiceLevelLabel.setText(
self.GlobalLevelLabel.setText(self.trUtf8('Use the global theme, ' translate(u'ThemesTab', u'Use the theme from the service, '
'overriding any themes associated with either the service or the ' u'overriding any of the individual songs\' themes. If the '
'songs.')) u'service doesn\'t have a theme, then use the global theme.'))
self.GlobalLevelRadioButton.setText(
translate(u'ThemesTab', u'Global level'))
self.GlobalLevelLabel.setText(
translate(u'ThemesTab', u'Use the global theme, overriding any '
u'themes associated with either the service or the songs.'))
def load(self): def load(self):
settings = QtCore.QSettings() settings = QtCore.QSettings()

View File

@ -34,7 +34,7 @@ log = logging.getLogger()
class LanguageManager(object): class LanguageManager(object):
""" """
Helper for Language selection Helper for Language selection
""" """
__qmList__ = None __qmList__ = None
AutoLanguage = False AutoLanguage = False
@ -55,8 +55,8 @@ class LanguageManager(object):
trans_dir = QtCore.QDir(os.path.join(trans_dir, u'resources', u'i18n')) trans_dir = QtCore.QDir(os.path.join(trans_dir, u'resources', u'i18n'))
fileNames = trans_dir.entryList(QtCore.QStringList("*.qm"), fileNames = trans_dir.entryList(QtCore.QStringList("*.qm"),
QtCore.QDir.Files, QtCore.QDir.Name) QtCore.QDir.Files, QtCore.QDir.Name)
for i in fileNames: for name in fileNames:
fileNames.replaceInStrings(i, trans_dir.filePath(i)) fileNames.replaceInStrings(name, trans_dir.filePath(name))
return fileNames return fileNames
@staticmethod @staticmethod
@ -89,9 +89,9 @@ class LanguageManager(object):
u'general/language', QtCore.QVariant(language)) u'general/language', QtCore.QVariant(language))
log.info(u'Language file: \'%s\' written to conf file' % language) log.info(u'Language file: \'%s\' written to conf file' % language)
QtGui.QMessageBox.information(None, QtGui.QMessageBox.information(None,
translate('LanguageManager', 'Language'), translate(u'LanguageManager', u'Language'),
translate('LanguageManager', translate(u'LanguageManager',
'After restart new Language settings will be used.')) u'After restart new Language settings will be used.'))
@staticmethod @staticmethod
def init_qm_list(): def init_qm_list():
@ -101,11 +101,12 @@ class LanguageManager(object):
regEx = QtCore.QRegExp("^.*openlp_(.*).qm") regEx = QtCore.QRegExp("^.*openlp_(.*).qm")
if regEx.exactMatch(qmf): if regEx.exactMatch(qmf):
langName = regEx.cap(1) langName = regEx.cap(1)
LanguageManager.__qmList__[u'%#2i %s' % (i+1, LanguageManager.__qmList__[u'%#2i %s' % (i+1,
LanguageManager.language_name(qmf))] = langName LanguageManager.language_name(qmf))] = langName
@staticmethod @staticmethod
def get_qm_list(): def get_qm_list():
if LanguageManager.__qmList__ == None: if LanguageManager.__qmList__ == None:
LanguageManager.init_qm_list() LanguageManager.init_qm_list()
return LanguageManager.__qmList__ return LanguageManager.__qmList__

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager
from openlp.plugins.alerts.forms import AlertForm from openlp.plugins.alerts.forms import AlertForm
@ -63,8 +63,10 @@ class alertsPlugin(Plugin):
AlertIcon = build_icon(u':/tools/tools_alert.png') AlertIcon = build_icon(u':/tools/tools_alert.png')
self.toolsAlertItem.setIcon(AlertIcon) self.toolsAlertItem.setIcon(AlertIcon)
self.toolsAlertItem.setObjectName(u'toolsAlertItem') self.toolsAlertItem.setObjectName(u'toolsAlertItem')
self.toolsAlertItem.setText(self.trUtf8('&Alert')) self.toolsAlertItem.setText(
self.toolsAlertItem.setStatusTip(self.trUtf8('Show an alert message')) translate(u'AlertsPlugin.AlertsPlugin', u'&Alert'))
self.toolsAlertItem.setStatusTip(
translate(u'AlertsPlugin.AlertsPlugin', u'Show an alert message'))
self.toolsAlertItem.setShortcut(u'F7') self.toolsAlertItem.setShortcut(u'F7')
self.service_manager.parent.ToolsMenu.addAction(self.toolsAlertItem) self.service_manager.parent.ToolsMenu.addAction(self.toolsAlertItem)
QtCore.QObject.connect(self.toolsAlertItem, QtCore.QObject.connect(self.toolsAlertItem,
@ -92,6 +94,7 @@ class alertsPlugin(Plugin):
self.alertForm.exec_() self.alertForm.exec_()
def about(self): def about(self):
about_text = self.trUtf8('<b>Alerts Plugin</b><br>This plugin ' about_text = translate(u'AlertsPlugin.AlertsPlugin',
'controls the displaying of alerts on the presentations screen') u'<b>Alerts Plugin</b><br>This plugin '
u'controls the displaying of alerts on the presentations screen')
return about_text return about_text

View File

@ -147,14 +147,22 @@ class Ui_AlertDialog(object):
AlertDialog.setTabOrder(self.DisplayCloseButton, self.CloseButton) AlertDialog.setTabOrder(self.DisplayCloseButton, self.CloseButton)
def retranslateUi(self, AlertDialog): def retranslateUi(self, AlertDialog):
AlertDialog.setWindowTitle(translate('AlertForm', 'Alert Message')) AlertDialog.setWindowTitle(
self.AlertEntryLabel.setText(translate('AlertForm', 'Alert &text:')) translate(u'AlertsPlugin.AlertForm', u'Alert Message'))
self.AlertParameter.setText(translate('AlertForm', '&Parameter(s):')) self.AlertEntryLabel.setText(
self.NewButton.setText(translate('AlertForm', '&New')) translate(u'AlertsPlugin.AlertForm', u'Alert &text:'))
self.SaveButton.setText(translate('AlertForm', '&Save')) self.AlertParameter.setText(
self.DeleteButton.setText(translate('AlertForm', '&Delete')) translate(u'AlertsPlugin.AlertForm', u'&Parameter(s):'))
self.DisplayButton.setText(translate('AlertForm', 'Displ&ay')) self.NewButton.setText(
translate(u'AlertsPlugin.AlertForm', u'&New'))
self.SaveButton.setText(
translate(u'AlertsPlugin.AlertForm', u'&Save'))
self.DeleteButton.setText(
translate(u'AlertsPlugin.AlertForm', u'&Delete'))
self.DisplayButton.setText(
translate(u'AlertsPlugin.AlertForm', u'Displ&ay'))
self.DisplayCloseButton.setText( self.DisplayCloseButton.setText(
translate('AlertForm', 'Display && Cl&ose')) translate(u'AlertsPlugin.AlertForm', u'Display && Cl&ose'))
self.CloseButton.setText(translate('AlertForm', '&Close')) self.CloseButton.setText(
translate(u'AlertsPlugin.AlertForm', u'&Close'))

View File

@ -26,6 +26,7 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.plugins.alerts.lib.models import AlertItem from openlp.plugins.alerts.lib.models import AlertItem
from openlp.core.lib import translate
from alertdialog import Ui_AlertDialog from alertdialog import Ui_AlertDialog
@ -42,38 +43,29 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
self.item_id = None self.item_id = None
QtGui.QDialog.__init__(self, None) QtGui.QDialog.__init__(self, None)
self.setupUi(self) self.setupUi(self)
QtCore.QObject.connect(self.DisplayButton, QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL(u'clicked()'),
QtCore.SIGNAL(u'clicked()'), self.onDisplayClicked)
self.onDisplayClicked)
QtCore.QObject.connect(self.DisplayCloseButton, QtCore.QObject.connect(self.DisplayCloseButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onDisplayCloseClicked)
self.onDisplayCloseClicked)
QtCore.QObject.connect(self.AlertTextEdit, QtCore.QObject.connect(self.AlertTextEdit,
QtCore.SIGNAL(u'textChanged(const QString&)'), QtCore.SIGNAL(u'textChanged(const QString&)'), self.onTextChanged)
self.onTextChanged) QtCore.QObject.connect(self.NewButton, QtCore.SIGNAL(u'clicked()'),
QtCore.QObject.connect(self.NewButton, self.onNewClick)
QtCore.SIGNAL(u'clicked()'), QtCore.QObject.connect(self.DeleteButton, QtCore.SIGNAL(u'clicked()'),
self.onNewClick) self.onDeleteClick)
QtCore.QObject.connect(self.DeleteButton, QtCore.QObject.connect(self.SaveButton, QtCore.SIGNAL(u'clicked()'),
QtCore.SIGNAL(u'clicked()'), self.onSaveClick)
self.onDeleteClick)
QtCore.QObject.connect(self.SaveButton,
QtCore.SIGNAL(u'clicked()'),
self.onSaveClick)
QtCore.QObject.connect(self.AlertListWidget, QtCore.QObject.connect(self.AlertListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onDoubleClick)
self.onDoubleClick)
QtCore.QObject.connect(self.AlertListWidget, QtCore.QObject.connect(self.AlertListWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSingleClick)
self.onSingleClick)
def loadList(self): def loadList(self):
self.AlertListWidget.clear() self.AlertListWidget.clear()
alerts = self.manager.get_all_alerts() alerts = self.manager.get_all_alerts()
for alert in alerts: for alert in alerts:
item_name = QtGui.QListWidgetItem(alert.text) item_name = QtGui.QListWidgetItem(alert.text)
item_name.setData( item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(alert.id))
QtCore.Qt.UserRole, QtCore.QVariant(alert.id))
self.AlertListWidget.addItem(item_name) self.AlertListWidget.addItem(item_name)
self.SaveButton.setEnabled(False) self.SaveButton.setEnabled(False)
self.DeleteButton.setEnabled(False) self.DeleteButton.setEnabled(False)
@ -101,8 +93,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
def onNewClick(self): def onNewClick(self):
if len(self.AlertTextEdit.text()) == 0: if len(self.AlertTextEdit.text()) == 0:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
self.trUtf8('Item selected to Add'), translate(u'AlertsPlugin.AlertForm', u'Item selected to Add'),
self.trUtf8('Missing data')) translate(u'AlertsPlugin.AlertForm', u'Missing data'))
else: else:
alert = AlertItem() alert = AlertItem()
alert.text = unicode(self.AlertTextEdit.text()) alert.text = unicode(self.AlertTextEdit.text())
@ -156,3 +148,4 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
self.parent.alertsmanager.displayAlert(text) self.parent.alertsmanager.displayAlert(text)
return True return True
return False return False

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver from openlp.core.lib import Receiver, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -93,7 +93,8 @@ class AlertsManager(QtCore.QObject):
self.alertList.append(text) self.alertList.append(text)
if self.timer_id != 0: if self.timer_id != 0:
Receiver.send_message(u'maindisplay_status_text', Receiver.send_message(u'maindisplay_status_text',
self.trUtf8(u'Alert message created and delayed')) translate(u'AlertsPlugin.AlertsManager',
u'Alert message created and delayed'))
return return
Receiver.send_message(u'maindisplay_status_text', u'') Receiver.send_message(u'maindisplay_status_text', u'')
self.generateAlert() self.generateAlert()

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab, translate
class AlertsTab(SettingsTab): class AlertsTab(SettingsTab):
""" """
@ -38,7 +38,7 @@ class AlertsTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'AlertsTab') self.setObjectName(u'AlertsTab')
self.tabTitleVisible = self.trUtf8('Alerts') self.tabTitleVisible = translate(u'AlertsPlugin.AlertsTab', u'Alerts')
self.AlertsLayout = QtGui.QHBoxLayout(self) self.AlertsLayout = QtGui.QHBoxLayout(self)
self.AlertsLayout.setSpacing(8) self.AlertsLayout.setSpacing(8)
self.AlertsLayout.setMargin(8) self.AlertsLayout.setMargin(8)
@ -186,19 +186,32 @@ class AlertsTab(SettingsTab):
QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.FontGroupBox.setTitle(self.trUtf8('Font')) self.FontGroupBox.setTitle(
self.FontLabel.setText(self.trUtf8('Font Name:')) translate(u'AlertsPlugin.AlertsTab', u'Font'))
self.FontColorLabel.setText(self.trUtf8('Font Color:')) self.FontLabel.setText(
self.BackgroundColorLabel.setText(self.trUtf8('Background Color:')) translate(u'AlertsPlugin.AlertsTab', u'Font Name:'))
self.FontSizeLabel.setText(self.trUtf8('Font Size:')) self.FontColorLabel.setText(
self.FontSizeSpinBox.setSuffix(self.trUtf8('pt')) translate(u'AlertsPlugin.AlertsTab', u'Font Color:'))
self.TimeoutLabel.setText(self.trUtf8('Alert timeout:')) self.BackgroundColorLabel.setText(
self.TimeoutSpinBox.setSuffix(self.trUtf8('s')) translate(u'AlertsPlugin.AlertsTab', u'Background Color:'))
self.LocationLabel.setText(self.trUtf8('Location:')) self.FontSizeLabel.setText(
self.PreviewGroupBox.setTitle(self.trUtf8('Preview')) translate(u'AlertsPlugin.AlertsTab', u'Font Size:'))
self.FontPreview.setText(self.trUtf8('openlp.org')) self.FontSizeSpinBox.setSuffix(
self.LocationComboBox.setItemText(0, self.trUtf8('Top')) translate(u'AlertsPlugin.AlertsTab', u'pt'))
self.LocationComboBox.setItemText(1, self.trUtf8('Bottom')) self.TimeoutLabel.setText(
translate(u'AlertsPlugin.AlertsTab', u'Alert timeout:'))
self.TimeoutSpinBox.setSuffix(
translate(u'AlertsPlugin.AlertsTab', u's'))
self.LocationLabel.setText(
translate(u'AlertsPlugin.AlertsTab', u'Location:'))
self.PreviewGroupBox.setTitle(
translate(u'AlertsPlugin.AlertsTab', u'Preview'))
self.FontPreview.setText(
translate(u'AlertsPlugin.AlertsTab', u'openlp.org'))
self.LocationComboBox.setItemText(0,
translate(u'AlertsPlugin.AlertsTab', u'Top'))
self.LocationComboBox.setItemText(1,
translate(u'AlertsPlugin.AlertsTab', u'Bottom'))
def onBackgroundColorButtonClicked(self): def onBackgroundColorButtonClicked(self):
self.bg_color = QtGui.QColorDialog.getColor( self.bg_color = QtGui.QColorDialog.getColor(

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -88,9 +88,10 @@ class BiblePlugin(Plugin):
self.media_item.onImportClick() self.media_item.onImportClick()
def about(self): def about(self):
about_text = self.trUtf8('<strong>Bible Plugin</strong><br />This ' about_text = translate(u'BiblesPlugin.BiblePlugin',
'plugin allows bible verses from different sources to be ' u'<strong>Bible Plugin</strong><br />This '
'displayed on the screen during the service.') u'plugin allows bible verses from different sources to be '
u'displayed on the screen during the service.')
return about_text return about_text
def can_delete_theme(self, theme): def can_delete_theme(self, theme):

View File

@ -309,63 +309,77 @@ class Ui_BibleImportWizard(object):
def retranslateUi(self, BibleImportWizard): def retranslateUi(self, BibleImportWizard):
BibleImportWizard.setWindowTitle( BibleImportWizard.setWindowTitle(
translate('ImportWizardForm', 'Bible Import Wizard')) translate(u'BiblesPlugin.ImportWizardForm', u'Bible Import Wizard'))
self.TitleLabel.setText( self.TitleLabel.setText(
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \ u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
translate('ImportWizardForm', 'Welcome to the Bible Import Wizard')) translate(u'BiblesPlugin.ImportWizardForm',
u'Welcome to the Bible Import Wizard'))
self.InformationLabel.setText( self.InformationLabel.setText(
translate('ImportWizardForm', translate(u'BiblesPlugin.ImportWizardForm',
'This wizard will help you to import Bibles from a ' u'This wizard will help you to import Bibles from a '
'variety of formats. Click the next button below to start the ' u'variety of formats. Click the next button below to start the '
'process by selecting a format to import from.')) u'process by selecting a format to import from.'))
self.SelectPage.setTitle( self.SelectPage.setTitle(translate(u'BiblesPlugin.ImportWizardForm',
translate('ImportWizardForm', 'Select Import Source')) u'Select Import Source'))
self.SelectPage.setSubTitle(translate('ImportWizardForm', self.SelectPage.setSubTitle(
'Select the import format, and where to import from.')) translate(u'BiblesPlugin.ImportWizardForm',
self.FormatLabel.setText(translate('ImportWizardForm', 'Format:')) u'Select the import format, and where to import from.'))
self.FormatComboBox.setItemText(0, self.FormatLabel.setText(
translate('ImportWizardForm', 'OSIS')) translate(u'BiblesPlugin.ImportWizardForm', u'Format:'))
self.FormatComboBox.setItemText(1, translate('ImportWizardForm', 'CSV')) self.FormatComboBox.setItemText(0,
self.FormatComboBox.setItemText(2, translate(u'BiblesPlugin.ImportWizardForm', u'OSIS'))
translate('ImportWizardForm', 'OpenSong')) self.FormatComboBox.setItemText(1,
translate(u'BiblesPlugin.ImportWizardForm', u'CSV'))
self.FormatComboBox.setItemText(2,
translate(u'BiblesPlugin.ImportWizardForm', u'OpenSong'))
self.FormatComboBox.setItemText(3, self.FormatComboBox.setItemText(3,
translate('ImportWizardForm', 'Web Download')) translate(u'BiblesPlugin.ImportWizardForm', u'Web Download'))
self.OsisLocationLabel.setText( self.OsisLocationLabel.setText(
translate('ImportWizardForm', 'File Location:')) translate(u'BiblesPlugin.ImportWizardForm', u'File Location:'))
self.BooksLocationLabel.setText( self.BooksLocationLabel.setText(
translate('ImportWizardForm', 'Books Location:')) translate(u'BiblesPlugin.ImportWizardForm', u'Books Location:'))
self.VerseLocationLabel.setText( self.VerseLocationLabel.setText(
translate('ImportWizardForm', 'Verse Location:')) translate(u'BiblesPlugin.ImportWizardForm', u'Verse Location:'))
self.OpenSongFileLabel.setText( self.OpenSongFileLabel.setText(
translate('ImportWizardForm', 'Bible Filename:')) translate(u'BiblesPlugin.ImportWizardForm', u'Bible Filename:'))
self.LocationLabel.setText(translate('ImportWizardForm', 'Location:')) self.LocationLabel.setText(
self.LocationComboBox.setItemText(0, translate(u'BiblesPlugin.ImportWizardForm', u'Location:'))
translate('ImportWizardForm', 'Crosswalk')) self.LocationComboBox.setItemText(0,
self.LocationComboBox.setItemText(1, translate(u'BiblesPlugin.ImportWizardForm', u'Crosswalk'))
translate('ImportWizardForm', 'BibleGateway')) self.LocationComboBox.setItemText(1,
self.BibleLabel.setText(translate('ImportWizardForm', 'Bible:')) translate(u'BiblesPlugin.ImportWizardForm', u'BibleGateway'))
self.BibleLabel.setText(
translate(u'BiblesPlugin.ImportWizardForm', u'Bible:'))
self.WebDownloadTabWidget.setTabText( self.WebDownloadTabWidget.setTabText(
self.WebDownloadTabWidget.indexOf(self.DownloadOptionsTab), self.WebDownloadTabWidget.indexOf(self.DownloadOptionsTab),
translate('ImportWizardForm', 'Download Options')) translate(u'BiblesPlugin.ImportWizardForm', u'Download Options'))
self.AddressLabel.setText(translate('ImportWizardForm', 'Server:')) self.AddressLabel.setText(
self.UsernameLabel.setText(translate('ImportWizardForm', 'Username:')) translate(u'BiblesPlugin.ImportWizardForm', u'Server:'))
self.PasswordLabel.setText(translate('ImportWizardForm', 'Password:')) self.UsernameLabel.setText(
translate(u'BiblesPlugin.ImportWizardForm', u'Username:'))
self.PasswordLabel.setText(
translate(u'BiblesPlugin.ImportWizardForm', u'Password:'))
self.WebDownloadTabWidget.setTabText( self.WebDownloadTabWidget.setTabText(
self.WebDownloadTabWidget.indexOf(self.ProxyServerTab), self.WebDownloadTabWidget.indexOf(self.ProxyServerTab),
translate('ImportWizardForm', 'Proxy Server (Optional)')) translate(u'BiblesPlugin.ImportWizardForm',
u'Proxy Server (Optional)'))
self.LicenseDetailsPage.setTitle( self.LicenseDetailsPage.setTitle(
translate('ImportWizardForm', 'License Details')) translate(u'BiblesPlugin.ImportWizardForm', u'License Details'))
self.LicenseDetailsPage.setSubTitle(translate('ImportWizardForm', self.LicenseDetailsPage.setSubTitle(
'Set up the Bible\'s license details.')) translate(u'BiblesPlugin.ImportWizardForm',
u'Set up the Bible\'s license details.'))
self.VersionNameLabel.setText( self.VersionNameLabel.setText(
translate('ImportWizardForm', 'Version Name:')) translate(u'BiblesPlugin.ImportWizardForm', u'Version Name:'))
self.CopyrightLabel.setText(translate('ImportWizardForm', 'Copyright:')) self.CopyrightLabel.setText(
translate(u'BiblesPlugin.ImportWizardForm', u'Copyright:'))
self.PermissionLabel.setText( self.PermissionLabel.setText(
translate('ImportWizardForm', 'Permission:')) translate(u'BiblesPlugin.ImportWizardForm', u'Permission:'))
self.ImportPage.setTitle(translate('ImportWizardForm', 'Importing')) self.ImportPage.setTitle(
self.ImportPage.setSubTitle(translate('ImportWizardForm', translate(u'BiblesPlugin.ImportWizardForm', u'Importing'))
'Please wait while your Bible is imported.')) self.ImportPage.setSubTitle(
translate(u'BiblesPlugin.ImportWizardForm',
u'Please wait while your Bible is imported.'))
self.ImportProgressLabel.setText( self.ImportProgressLabel.setText(
translate('ImportWizardForm', 'Ready.')) translate(u'BiblesPlugin.ImportWizardForm', u'Ready.'))
self.ImportProgressBar.setFormat(u'%p%') self.ImportProgressBar.setFormat(u'%p%')

View File

@ -31,7 +31,7 @@ import os.path
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from bibleimportwizard import Ui_BibleImportWizard from bibleimportwizard import Ui_BibleImportWizard
from openlp.core.lib import Receiver, SettingsManager from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.utils import AppLocation, variant_to_unicode from openlp.core.utils import AppLocation, variant_to_unicode
from openlp.plugins.bibles.lib.manager import BibleFormat from openlp.plugins.bibles.lib.manager import BibleFormat
@ -123,26 +123,32 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS:
if self.field(u'osis_location').toString() == u'': if self.field(u'osis_location').toString() == u'':
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Invalid Bible Location'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('You need to specify a file to import your ' u'Invalid Bible Location'),
'Bible from.'), translate(u'BiblesPlugin.ImportWizardForm',
u'You need to specify a file to import your '
u'Bible from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.OSISLocationEdit.setFocus() self.OSISLocationEdit.setFocus()
return False return False
elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV:
if self.field(u'csv_booksfile').toString() == u'': if self.field(u'csv_booksfile').toString() == u'':
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Invalid Books File'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('You need to specify a file with books of ' u'Invalid Books File'),
'the Bible to use in the import.'), translate(u'BiblesPlugin.ImportWizardForm',
u'You need to specify a file with books of '
u'the Bible to use in the import.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.BooksLocationEdit.setFocus() self.BooksLocationEdit.setFocus()
return False return False
elif self.field(u'csv_versefile').toString() == u'': elif self.field(u'csv_versefile').toString() == u'':
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Invalid Verse File'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('You need to specify a file of Bible ' u'Invalid Verse File'),
'verses to import.'), translate(u'BiblesPlugin.ImportWizardForm',
u'You need to specify a file of Bible '
u'verses to import.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.CsvVerseLocationEdit.setFocus() self.CsvVerseLocationEdit.setFocus()
return False return False
@ -150,9 +156,11 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
BibleFormat.OpenSong: BibleFormat.OpenSong:
if self.field(u'opensong_file').toString() == u'': if self.field(u'opensong_file').toString() == u'':
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Invalid OpenSong Bible'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('You need to specify an OpenSong Bible ' u'Invalid OpenSong Bible'),
'file to import.'), translate(u'BiblesPlugin.ImportWizardForm',
u'You need to specify an OpenSong Bible '
u'file to import.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.OpenSongFileEdit.setFocus() self.OpenSongFileEdit.setFocus()
return False return False
@ -164,26 +172,32 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
self.field(u'license_copyright')) self.field(u'license_copyright'))
if license_version == u'': if license_version == u'':
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Empty Version Name'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('You need to specify a version name for your ' u'Empty Version Name'),
'Bible.'), translate(u'BiblesPlugin.ImportWizardForm',
u'You need to specify a version name for your '
u'Bible.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.VersionNameEdit.setFocus() self.VersionNameEdit.setFocus()
return False return False
elif license_copyright == u'': elif license_copyright == u'':
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Empty Copyright'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('You need to set a copyright for your Bible! ' u'Empty Copyright'),
'Bibles in the Public Domain need to be marked as ' translate(u'BiblesPlugin.ImportWizardForm',
'such.'), u'You need to set a copyright for your Bible! '
u'Bibles in the Public Domain need to be marked as '
u'such.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.CopyrightEdit.setFocus() self.CopyrightEdit.setFocus()
return False return False
elif self.manager.exists(license_version): elif self.manager.exists(license_version):
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('Bible Exists'), translate(u'BiblesPlugin.ImportWizardForm',
self.trUtf8('This Bible already exists! Please import ' u'Bible Exists'),
'a different Bible or first delete the existing one.'), translate(u'BiblesPlugin.ImportWizardForm',
u'This Bible already exists! Please import '
u'a different Bible or first delete the existing one.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.VersionNameEdit.setFocus() self.VersionNameEdit.setFocus()
return False return False
@ -202,34 +216,40 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
""" """
self.BibleComboBox.clear() self.BibleComboBox.clear()
for bible in self.web_bible_list[index].keys(): for bible in self.web_bible_list[index].keys():
self.BibleComboBox.addItem(unicode(self.trUtf8(bible))) self.BibleComboBox.addItem(unicode(
translate(u'BiblesPlugin.ImportWizardForm', bible)))
def onOsisFileButtonClicked(self): def onOsisFileButtonClicked(self):
""" """
Show the file open dialog for the OSIS file. Show the file open dialog for the OSIS file.
""" """
self.getFileName(self.trUtf8('Open OSIS File'), self.getFileName(
translate(u'BiblesPlugin.ImportWizardForm', u'Open OSIS File'),
self.OSISLocationEdit) self.OSISLocationEdit)
def onBooksFileButtonClicked(self): def onBooksFileButtonClicked(self):
""" """
Show the file open dialog for the books CSV file. Show the file open dialog for the books CSV file.
""" """
self.getFileName(self.trUtf8('Open Books CSV File'), self.getFileName(
translate(u'BiblesPlugin.ImportWizardForm', u'Open Books CSV File'),
self.BooksLocationEdit) self.BooksLocationEdit)
def onCsvVersesFileButtonClicked(self): def onCsvVersesFileButtonClicked(self):
""" """
Show the file open dialog for the verses CSV file. Show the file open dialog for the verses CSV file.
""" """
self.getFileName(self.trUtf8('Open Verses CSV File'), self.getFileName(
translate(u'BiblesPlugin.ImportWizardForm',
u'Open Verses CSV File'),
self.CsvVerseLocationEdit) self.CsvVerseLocationEdit)
def onOpenSongBrowseButtonClicked(self): def onOpenSongBrowseButtonClicked(self):
""" """
Show the file open dialog for the OpenSong file. Show the file open dialog for the OpenSong file.
""" """
self.getFileName(self.trUtf8('Open OpenSong Bible'), self.getFileName(
translate(u'BiblesPlugin.ImportWizardForm', u'Open OpenSong Bible'),
self.OpenSongFileEdit) self.OpenSongFileEdit)
def onCancelButtonClicked(self, checked): def onCancelButtonClicked(self, checked):
@ -365,7 +385,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMinimum(0)
self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setMaximum(1188)
self.ImportProgressBar.setValue(0) self.ImportProgressBar.setValue(0)
self.ImportProgressLabel.setText(self.trUtf8('Starting import...')) self.ImportProgressLabel.setText(
translate(u'BiblesPlugin.ImportWizardForm', u'Starting import...'))
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
def performImport(self): def performImport(self):
@ -422,10 +443,13 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
self.manager.save_meta_data(license_version, license_version, self.manager.save_meta_data(license_version, license_version,
license_copyright, license_permission) license_copyright, license_permission)
self.manager.reload_bibles() self.manager.reload_bibles()
self.ImportProgressLabel.setText(self.trUtf8('Finished import.')) self.ImportProgressLabel.setText(
translate(u'BiblesPlugin.ImportWizardForm',
u'Finished import.'))
else: else:
self.ImportProgressLabel.setText( self.ImportProgressLabel.setText(
self.trUtf8('Your Bible import failed.')) translate(u'BiblesPlugin.ImportWizardForm',
u'Your Bible import failed.'))
importer.delete() importer.delete()
def postImport(self): def postImport(self):

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsTab from openlp.core.lib import Receiver, SettingsTab, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -45,7 +45,7 @@ class BiblesTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'BiblesTab') self.setObjectName(u'BiblesTab')
self.tabTitleVisible = self.trUtf8('Bibles') self.tabTitleVisible = translate(u'BiblesPlugin,BiblesTab', u'Bibles')
self.BibleLayout = QtGui.QHBoxLayout(self) self.BibleLayout = QtGui.QHBoxLayout(self)
self.BibleLayout.setSpacing(8) self.BibleLayout.setSpacing(8)
self.BibleLayout.setMargin(8) self.BibleLayout.setMargin(8)
@ -149,22 +149,35 @@ class BiblesTab(SettingsTab):
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self): def retranslateUi(self):
self.VerseDisplayGroupBox.setTitle(self.trUtf8('Verse Display')) self.VerseDisplayGroupBox.setTitle(
translate(u'BiblesPlugin,BiblesTab', u'Verse Display'))
self.NewChaptersCheckBox.setText( self.NewChaptersCheckBox.setText(
self.trUtf8('Only show new chapter numbers')) translate(u'BiblesPlugin,BiblesTab',
self.LayoutStyleLabel.setText(self.trUtf8('Layout Style:')) u'Only show new chapter numbers'))
self.DisplayStyleLabel.setText(self.trUtf8('Display Style:')) self.LayoutStyleLabel.setText(
self.BibleThemeLabel.setText(self.trUtf8('Bible Theme:')) translate(u'BiblesPlugin,BiblesTab', u'Layout Style:'))
self.LayoutStyleComboBox.setItemText(0, self.trUtf8('verse per slide')) self.DisplayStyleLabel.setText(
self.LayoutStyleComboBox.setItemText(1, self.trUtf8('verse per line')) translate(u'BiblesPlugin,BiblesTab', u'Display Style:'))
self.LayoutStyleComboBox.setItemText(2, self.trUtf8('continuous')) self.BibleThemeLabel.setText(
self.DisplayStyleComboBox.setItemText(0, self.trUtf8('No brackets')) translate(u'BiblesPlugin,BiblesTab', u'Bible Theme:'))
self.DisplayStyleComboBox.setItemText(1, self.trUtf8('( and )')) self.LayoutStyleComboBox.setItemText(0,
self.DisplayStyleComboBox.setItemText(2, self.trUtf8('{ and }')) translate(u'BiblesPlugin,BiblesTab', u'verse per slide'))
self.DisplayStyleComboBox.setItemText(3, self.trUtf8('[ and ]')) self.LayoutStyleComboBox.setItemText(1,
self.ChangeNoteLabel.setText(self.trUtf8( translate(u'BiblesPlugin,BiblesTab', u'verse per line'))
'Note:\nChanges don\'t affect verses already in the service')) self.LayoutStyleComboBox.setItemText(2,
self.BibleDualCheckBox.setText(self.trUtf8('Display Dual Bible Verses')) translate(u'BiblesPlugin,BiblesTab', u'continuous'))
self.DisplayStyleComboBox.setItemText(0,
translate(u'BiblesPlugin,BiblesTab', u'No brackets'))
self.DisplayStyleComboBox.setItemText(1,
translate(u'BiblesPlugin,BiblesTab', u'( and )'))
self.DisplayStyleComboBox.setItemText(2,
translate(u'BiblesPlugin,BiblesTab', u'{ and }'))
self.DisplayStyleComboBox.setItemText(3,
translate(u'BiblesPlugin,BiblesTab', u'[ and ]'))
self.ChangeNoteLabel.setText(translate(u'BiblesPlugin.BiblesTab',
u'Note:\nChanges don\'t affect verses already in the service'))
self.BibleDualCheckBox.setText(
translate(u'BiblesPlugin,BiblesTab', u'Display Dual Bible Verses'))
def onBibleThemeComboBoxChanged(self): def onBibleThemeComboBoxChanged(self):
self.bible_theme = self.BibleThemeComboBox.currentText() self.bible_theme = self.BibleThemeComboBox.currentText()

View File

@ -29,7 +29,7 @@ import time
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \ from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
ItemCapabilities ItemCapabilities, translate
from openlp.plugins.bibles.forms import ImportWizardForm from openlp.plugins.bibles.forms import ImportWizardForm
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -71,7 +71,7 @@ class BibleMediaItem(MediaManagerItem):
return unicode(obj) return unicode(obj)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Bible') self.PluginNameVisible = translate(u'BiblesPlugin.MediaItem', u'Bible')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -147,7 +147,8 @@ class BibleMediaItem(MediaManagerItem):
self.QuickMessage = QtGui.QLabel(self.QuickTab) self.QuickMessage = QtGui.QLabel(self.QuickTab)
self.QuickMessage.setObjectName(u'QuickMessage') self.QuickMessage.setObjectName(u'QuickMessage')
self.QuickLayout.addWidget(self.QuickMessage, 6, 0, 1, 3) self.QuickLayout.addWidget(self.QuickMessage, 6, 0, 1, 3)
self.SearchTabWidget.addTab(self.QuickTab, self.trUtf8('Quick')) self.SearchTabWidget.addTab(self.QuickTab,
translate(u'BiblesPlugin.MediaItem', u'Quick'))
QuickSpacerItem = QtGui.QSpacerItem(20, 35, QtGui.QSizePolicy.Minimum, QuickSpacerItem = QtGui.QSpacerItem(20, 35, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Expanding) QtGui.QSizePolicy.Expanding)
self.QuickLayout.addItem(QuickSpacerItem, 6, 2, 1, 1) self.QuickLayout.addItem(QuickSpacerItem, 6, 2, 1, 1)
@ -231,7 +232,8 @@ class BibleMediaItem(MediaManagerItem):
self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab) self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab)
self.AdvancedMessage.setObjectName(u'AdvancedMessage') self.AdvancedMessage.setObjectName(u'AdvancedMessage')
self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3)
self.SearchTabWidget.addTab(self.AdvancedTab, self.trUtf8('Advanced')) self.SearchTabWidget.addTab(self.AdvancedTab,
translate(u'BiblesPlugin.MediaItem', u'Advanced'))
# Add the search tab widget to the page layout # Add the search tab widget to the page layout
self.PageLayout.addWidget(self.SearchTabWidget) self.PageLayout.addWidget(self.SearchTabWidget)
# Combo Boxes # Combo Boxes
@ -289,27 +291,48 @@ class BibleMediaItem(MediaManagerItem):
def retranslateUi(self): def retranslateUi(self):
log.debug(u'retranslateUi') log.debug(u'retranslateUi')
self.QuickVersionLabel.setText(self.trUtf8('Version:')) self.QuickVersionLabel.setText(
self.QuickSecondVersionLabel.setText(self.trUtf8('Dual:')) translate(u'BiblesPlugin.MediaItem', u'Version:'))
self.QuickSearchLabel.setText(self.trUtf8('Search Type:')) self.QuickSecondVersionLabel.setText(
self.QuickSearchLabel.setText(self.trUtf8('Find:')) translate(u'BiblesPlugin.MediaItem', u'Dual:'))
self.QuickSearchButton.setText(self.trUtf8('Search')) self.QuickSearchLabel.setText(
self.QuickClearLabel.setText(self.trUtf8('Results:')) translate(u'BiblesPlugin.MediaItem', u'Search Type:'))
self.AdvancedVersionLabel.setText(self.trUtf8('Version:')) self.QuickSearchLabel.setText(
self.AdvancedSecondBibleLabel.setText(self.trUtf8('Dual:')) translate(u'BiblesPlugin.MediaItem', u'Find:'))
self.AdvancedBookLabel.setText(self.trUtf8('Book:')) self.QuickSearchButton.setText(
self.AdvancedChapterLabel.setText(self.trUtf8('Chapter:')) translate(u'BiblesPlugin.MediaItem', u'Search'))
self.AdvancedVerseLabel.setText(self.trUtf8('Verse:')) self.QuickClearLabel.setText(
self.AdvancedFromLabel.setText(self.trUtf8('From:')) translate(u'BiblesPlugin.MediaItem', u'Results:'))
self.AdvancedToLabel.setText(self.trUtf8('To:')) self.AdvancedVersionLabel.setText(
self.AdvancedClearLabel.setText(self.trUtf8('Results:')) translate(u'BiblesPlugin.MediaItem', u'Version:'))
self.AdvancedSearchButton.setText(self.trUtf8('Search')) self.AdvancedSecondBibleLabel.setText(
self.QuickSearchComboBox.addItem(self.trUtf8('Verse Search')) translate(u'BiblesPlugin.MediaItem', u'Dual:'))
self.QuickSearchComboBox.addItem(self.trUtf8('Text Search')) self.AdvancedBookLabel.setText(
self.ClearQuickSearchComboBox.addItem(self.trUtf8('Clear')) translate(u'BiblesPlugin.MediaItem', u'Book:'))
self.ClearQuickSearchComboBox.addItem(self.trUtf8('Keep')) self.AdvancedChapterLabel.setText(
self.ClearAdvancedSearchComboBox.addItem(self.trUtf8('Clear')) translate(u'BiblesPlugin.MediaItem', u'Chapter:'))
self.ClearAdvancedSearchComboBox.addItem(self.trUtf8('Keep')) self.AdvancedVerseLabel.setText(
translate(u'BiblesPlugin.MediaItem', u'Verse:'))
self.AdvancedFromLabel.setText(
translate(u'BiblesPlugin.MediaItem', u'From:'))
self.AdvancedToLabel.setText(
translate(u'BiblesPlugin.MediaItem', u'To:'))
self.AdvancedClearLabel.setText(
translate(u'BiblesPlugin.MediaItem', u'Results:'))
self.AdvancedSearchButton.setText(
translate(u'BiblesPlugin.MediaItem', u'Search'))
self.QuickSearchComboBox.addItem(
translate(u'BiblesPlugin.MediaItem', u'Verse Search'))
self.QuickSearchComboBox.addItem(
translate(u'BiblesPlugin.MediaItem', u'Text Search'))
self.ClearQuickSearchComboBox.addItem(
translate(u'BiblesPlugin.MediaItem', u'Clear'))
self.ClearQuickSearchComboBox.addItem(
translate(u'BiblesPlugin.MediaItem', u'Keep'))
self.ClearAdvancedSearchComboBox.addItem(
translate(u'BiblesPlugin.MediaItem', u'Clear'))
self.ClearAdvancedSearchComboBox.addItem(
translate(u'BiblesPlugin.MediaItem', u'Keep'))
def initialise(self): def initialise(self):
log.debug(u'bible manager initialise') log.debug(u'bible manager initialise')
@ -363,8 +386,9 @@ class BibleMediaItem(MediaManagerItem):
def onNoBookFound(self): def onNoBookFound(self):
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('No Book Found'), translate(u'BiblesPlugin.MediaItem', u'No Book Found'),
self.trUtf8('No matching book could be found in this Bible.'), translate(u'BiblesPlugin.MediaItem',
u'No matching book could be found in this Bible.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok QtGui.QMessageBox.Ok
) )
@ -497,10 +521,10 @@ class BibleMediaItem(MediaManagerItem):
if self.parent.settings_tab.display_style == 1: if self.parent.settings_tab.display_style == 1:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'(u', u')') u'(u', u')')
elif self.parent.settings_tab.display_style == 2: elif self.parent.settings_tab.display_style == 2:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'{', u'}') u'{', u'}')
elif self.parent.settings_tab.display_style == 3: elif self.parent.settings_tab.display_style == 3:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'[', u']') u'[', u']')
else: else:
@ -532,10 +556,11 @@ class BibleMediaItem(MediaManagerItem):
bible_text = u'' bible_text = u''
if not service_item.title: if not service_item.title:
service_item.title = u'%s %s' % (book, verse_text) service_item.title = u'%s %s' % (book, verse_text)
elif service_item.title.find(self.trUtf8(u'etc')) == -1: elif service_item.title.find(
service_item.title = u'%s, %s' \ translate(u'BiblesPlugin.MediaItem', u'etc')) == -1:
% (service_item.title, self.trUtf8(u'etc')) service_item.title = u'%s, %s' % (service_item.title,
if len(self.parent.settings_tab.bible_theme) == 0: translate(u'BiblesPlugin.MediaItem', u'etc'))
if len(self.parent.settings_tab.bible_theme) == 0:
service_item.theme = None service_item.theme = None
else: else:
service_item.theme = self.parent.settings_tab.bible_theme service_item.theme = self.parent.settings_tab.bible_theme
@ -583,7 +608,8 @@ class BibleMediaItem(MediaManagerItem):
self.verses = self.parent.manager.get_verse_count(bible, book, 1) self.verses = self.parent.manager.get_verse_count(bible, book, 1)
if self.verses == 0: if self.verses == 0:
self.AdvancedSearchButton.setEnabled(False) self.AdvancedSearchButton.setEnabled(False)
self.AdvancedMessage.setText(self.trUtf8('Bible not fully loaded')) self.AdvancedMessage.setText(
translate(u'BiblesPlugin.MediaItem', u'Bible not fully loaded'))
else: else:
self.AdvancedSearchButton.setEnabled(True) self.AdvancedSearchButton.setEnabled(True)
self.AdvancedMessage.setText(u'') self.AdvancedMessage.setText(u'')
@ -631,3 +657,4 @@ class BibleMediaItem(MediaManagerItem):
def searchByReference(self, bible, search): def searchByReference(self, bible, search):
log.debug(u'searchByReference %s, %s', bible, search) log.debug(u'searchByReference %s, %s', bible, search)
self.search_results = self.parent.manager.get_verses(bible, search) self.search_results = self.parent.manager.get_verses(bible, search)

View File

@ -28,7 +28,7 @@ import logging
from lxml import objectify from lxml import objectify
from PyQt4 import QtCore from PyQt4 import QtCore
from openlp.core.lib import Receiver from openlp.core.lib import Receiver, translate
from db import BibleDB from db import BibleDB
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -94,7 +94,8 @@ class OpenSongBible(BibleDB):
) )
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
self.wizard.incrementProgressBar( self.wizard.incrementProgressBar(
QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\ QtCore.QString('%s %s %s' % (
translate(u'BiblesPlugin.Opensong', u'Importing'), \
db_book.name, chapter.attrib[u'n']))) db_book.name, chapter.attrib[u'n'])))
self.commit() self.commit()
except IOError: except IOError:

View File

@ -26,7 +26,7 @@
import logging import logging
from forms import EditCustomForm from forms import EditCustomForm
from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -67,10 +67,11 @@ class CustomPlugin(Plugin):
self.remove_toolbox_item() self.remove_toolbox_item()
def about(self): def about(self):
about_text = self.trUtf8('<b>Custom Plugin</b><br>This plugin ' about_text = translate(u'CustomPlugin.CustomPlugin',
'allows slides to be displayed on the screen in the same way ' u'<b>Custom Plugin</b><br>This plugin '
'songs are. This plugin provides greater freedom over the ' u'allows slides to be displayed on the screen in the same way '
'songs plugin.<br>') u'songs are. This plugin provides greater freedom over the '
u'songs plugin.<br>')
return about_text return about_text
def can_delete_theme(self, theme): def can_delete_theme(self, theme):

View File

@ -24,6 +24,7 @@
############################################################################### ###############################################################################
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate from openlp.core.lib import translate
class Ui_customEditDialog(object): class Ui_customEditDialog(object):
@ -106,8 +107,8 @@ class Ui_customEditDialog(object):
self.SplitButton = QtGui.QPushButton(self.ButtonWidge) self.SplitButton = QtGui.QPushButton(self.ButtonWidge)
self.SplitButton.setObjectName(u'SplitButton') self.SplitButton.setObjectName(u'SplitButton')
self.verticalLayout_2.addWidget(self.SplitButton) self.verticalLayout_2.addWidget(self.SplitButton)
spacerItem1 = QtGui.QSpacerItem(20, 40, spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) QtGui.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem1) self.verticalLayout_2.addItem(spacerItem1)
self.EditLayout_3.addWidget(self.ButtonWidge) self.EditLayout_3.addWidget(self.ButtonWidge)
self.gridLayout.addWidget(self.EditWidget, 2, 0, 1, 1) self.gridLayout.addWidget(self.EditWidget, 2, 0, 1, 1)
@ -130,7 +131,8 @@ class Ui_customEditDialog(object):
self.horizontalLayout_2.addWidget(self.CreditEdit) self.horizontalLayout_2.addWidget(self.CreditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(customEditDialog) self.buttonBox = QtGui.QDialogButtonBox(customEditDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Save)
self.buttonBox.setObjectName(u'buttonBox') self.buttonBox.setObjectName(u'buttonBox')
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1) self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1)
@ -153,23 +155,44 @@ class Ui_customEditDialog(object):
customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox) customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox)
def retranslateUi(self, customEditDialog): def retranslateUi(self, customEditDialog):
customEditDialog.setWindowTitle(translate('EditCustomForm', 'Edit Custom Slides')) customEditDialog.setWindowTitle(
self.UpButton.setToolTip(translate('EditCustomForm', 'Move slide Up 1')) translate(u'CustomPlugin.EditCustomForm', u'Edit Custom Slides'))
self.DownButton.setToolTip(translate('EditCustomForm', 'Move slide down 1')) self.UpButton.setToolTip(translate(u'CustomPlugin.EditCustomForm'
self.TitleLabel.setText(translate('EditCustomForm', 'Title:')) u'CustomPlugin.EditCustomForm', u'Move slide Up 1'))
self.AddButton.setText(translate('EditCustomForm', 'Add New')) self.DownButton.setToolTip(
self.AddButton.setToolTip(translate('EditCustomForm', 'Add new slide at bottom')) translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1'))
self.EditButton.setText(translate('EditCustomForm', 'Edit')) self.TitleLabel.setText(
self.EditButton.setToolTip(translate('EditCustomForm', 'Edit selected slide')) translate(u'CustomPlugin.EditCustomForm', u'Title:'))
self.EditAllButton.setText(translate('EditCustomForm', 'Edit All')) self.AddButton.setText(
self.EditAllButton.setToolTip(translate('EditCustomForm', 'Edit all slides')) translate(u'CustomPlugin.EditCustomForm', u'Add New'))
self.SaveButton.setText(translate('EditCustomForm', 'Save')) self.AddButton.setToolTip(translate(u'CustomPlugin.EditCustomForm',
self.SaveButton.setToolTip(translate('EditCustomForm', 'Replace edited slide')) u'Add new slide at bottom'))
self.DeleteButton.setText(translate('EditCustomForm', 'Delete')) self.EditButton.setText(
self.DeleteButton.setToolTip(translate('EditCustomForm', 'Delete selected slide')) translate(u'CustomPlugin.EditCustomForm', u'Edit'))
self.ClearButton.setText(translate('EditCustomForm', 'Clear')) self.EditButton.setToolTip(
self.ClearButton.setToolTip(translate('EditCustomForm', 'Clear edit area')) translate(u'CustomPlugin.EditCustomForm', u'Edit selected slide'))
self.SplitButton.setText(translate('EditCustomForm', 'Split Slide')) self.EditAllButton.setText(
self.SplitButton.setToolTip(translate('EditCustomForm', 'Add slide split')) translate(u'CustomPlugin.EditCustomForm', u'Edit All'))
self.ThemeLabel.setText(translate('EditCustomForm', 'Theme:')) self.EditAllButton.setToolTip(
self.CreditLabel.setText(translate('EditCustomForm', 'Credits:')) translate(u'CustomPlugin.EditCustomForm', u'Edit all slides'))
self.SaveButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Save'))
self.SaveButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Replace edited slide'))
self.DeleteButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Delete'))
self.DeleteButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Delete selected slide'))
self.ClearButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Clear'))
self.ClearButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Clear edit area'))
self.SplitButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Split Slide'))
self.SplitButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Add slide split'))
self.ThemeLabel.setText(
translate(u'CustomPlugin.EditCustomForm', u'Theme:'))
self.CreditLabel.setText(
translate(u'CustomPlugin.EditCustomForm', u'Credits:'))

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from editcustomdialog import Ui_customEditDialog from editcustomdialog import Ui_customEditDialog
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate
from openlp.plugins.custom.lib.models import CustomSlide from openlp.plugins.custom.lib.models import CustomSlide
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -47,7 +47,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
self.setupUi(self) self.setupUi(self)
# Connecting signals and slots # Connecting signals and slots
self.previewButton = QtGui.QPushButton() self.previewButton = QtGui.QPushButton()
self.previewButton.setText(self.trUtf8('Save && Preview')) self.previewButton.setText(translate(u'CustomPlugin.EditCustomForm',
u'Save && Preview'))
self.buttonBox.addButton( self.buttonBox.addButton(
self.previewButton, QtGui.QDialogButtonBox.ActionRole) self.previewButton, QtGui.QDialogButtonBox.ActionRole)
QtCore.QObject.connect(self.buttonBox, QtCore.QObject.connect(self.buttonBox,
@ -84,7 +85,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def onPreview(self, button): def onPreview(self, button):
log.debug(u'onPreview') log.debug(u'onPreview')
if button.text() == unicode(self.trUtf8('Save && Preview')) \ if button.text() == unicode(translate(u'CustomPlugin.EditCustomForm',
u'Save && Preview')) \
and self.saveCustom(): and self.saveCustom():
Receiver.send_message(u'custom_preview') Receiver.send_message(u'custom_preview')
@ -147,7 +149,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def saveCustom(self): def saveCustom(self):
valid, message = self._validate() valid, message = self._validate()
if not valid: if not valid:
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), message, QtGui.QMessageBox.critical(self,
translate(u'CustomPlugin.EditCustomForm', u'Error'), message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return False return False
sxml = SongXMLBuilder() sxml = SongXMLBuilder()
@ -160,8 +163,10 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
count += 1 count += 1
self.customSlide.title = unicode(self.TitleEdit.displayText(), u'utf-8') self.customSlide.title = unicode(self.TitleEdit.displayText(), u'utf-8')
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(), u'utf-8') self.customSlide.credits = unicode(self.CreditEdit.displayText(),
self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(), u'utf-8') u'utf-8')
self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(),
u'utf-8')
self.custommanager.save_slide(self.customSlide) self.custommanager.save_slide(self.customSlide)
return True return True
@ -227,7 +232,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def onSaveButtonPressed(self): def onSaveButtonPressed(self):
if self.editAll: if self.editAll:
self.VerseListView.clear() self.VerseListView.clear()
for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n[---]\n'): for row in unicode(self.VerseTextEdit.toPlainText()).split(
u'\n[---]\n'):
self.VerseListView.addItem(row) self.VerseListView.addItem(row)
else: else:
self.VerseListView.currentItem().setText( self.VerseListView.currentItem().setText(
@ -263,12 +269,15 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def _validate(self): def _validate(self):
if len(self.TitleEdit.displayText()) == 0: if len(self.TitleEdit.displayText()) == 0:
self.TitleEdit.setFocus() self.TitleEdit.setFocus()
return False, self.trUtf8('You need to enter a title') return False, translate(u'CustomPlugin.EditCustomForm',
u'You need to enter a title')
# must have 1 slide # must have 1 slide
if self.VerseListView.count() == 0: if self.VerseListView.count() == 0:
self.VerseTextEdit.setFocus() self.VerseTextEdit.setFocus()
return False, self.trUtf8('You need to enter a slide') return False, translate(u'CustomPlugin.EditCustomForm',
u'You need to enter a slide')
if self.VerseTextEdit.toPlainText(): if self.VerseTextEdit.toPlainText():
self.VerseTextEdit.setFocus() self.VerseTextEdit.setFocus()
return False, self.trUtf8('You have unsaved data, please save or clear') return False, translate(u'CustomPlugin.editCustomForm',
u'You have unsaved data, please save or clear')
return True, u'' return True, u''

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab, translate
class CustomTab(SettingsTab): class CustomTab(SettingsTab):
""" """
@ -36,7 +36,7 @@ class CustomTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'CustomTab') self.setObjectName(u'CustomTab')
self.tabTitleVisible = self.trUtf8('Custom') self.tabTitleVisible = translate(u'CustomPlugin.CustomTab', u'Custom')
self.CustomLayout = QtGui.QFormLayout(self) self.CustomLayout = QtGui.QFormLayout(self)
self.CustomLayout.setObjectName(u'CustomLayout') self.CustomLayout.setObjectName(u'CustomLayout')
self.CustomModeGroupBox = QtGui.QGroupBox(self) self.CustomModeGroupBox = QtGui.QGroupBox(self)
@ -55,9 +55,10 @@ class CustomTab(SettingsTab):
self.onDisplayFooterCheckBoxChanged) self.onDisplayFooterCheckBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.CustomModeGroupBox.setTitle(self.trUtf8('Custom Display')) self.CustomModeGroupBox.setTitle(translate(u'CustomPlugin.CustomTab',
u'Custom Display'))
self.DisplayFooterCheckBox.setText( self.DisplayFooterCheckBox.setText(
self.trUtf8('Display Footer')) translate(u'CustomPlugin.CustomTab', u'Display Footer'))
def onDisplayFooterCheckBoxChanged(self, check_state): def onDisplayFooterCheckBoxChanged(self, check_state):
self.displayFooter = False self.displayFooter = False

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \ from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \
Receiver, ItemCapabilities Receiver, ItemCapabilities, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -66,11 +66,10 @@ class CustomMediaItem(MediaManagerItem):
QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick) QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Custom') self.PluginNameVisible = translate(u'CustomPlugin.MediaItem', u'Custom')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
self.hasFileIcon = False
def initialise(self): def initialise(self):
self.loadCustomListView(self.parent.custommanager.get_all_slides()) self.loadCustomListView(self.parent.custommanager.get_all_slides())

View File

@ -25,7 +25,7 @@
import logging import logging
from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.images.lib import ImageMediaItem, ImageTab from openlp.plugins.images.lib import ImageMediaItem, ImageTab
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -56,11 +56,12 @@ class ImagePlugin(Plugin):
return ImageMediaItem(self, self.icon, self.name) return ImageMediaItem(self, self.icon, self.name)
def about(self): def about(self):
about_text = self.trUtf8('<b>Image Plugin</b><br>Allows images of ' about_text = translate(u'ImagePlugin.ImagePlugin', u'<b>Image Plugin'
'all types to be displayed. If a number of images are selected ' u'</b><br>Allows images of all types to be displayed. If a number '
'together and presented on the live controller it is possible ' u'of images are selected together and presented on the live '
'to turn them into a timed loop.<br<br>From the plugin if the ' u'controller it is possible to turn them into a timed loop.<br<br>'
'<i>Override background</i> is chosen and an image is selected ' u'From the plugin if the <i>Override background</i> is chosen and '
'any songs which are rendered will use the selected image from ' u'an image is selected any songs which are rendered will use the '
'the background instead of the one provied by the theme.<br>') u'selected image from the background instead of the one provied by '
u'the theme.<br>')
return about_text return about_text

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver from openlp.core.lib import SettingsTab, Receiver, translate
class ImageTab(SettingsTab): class ImageTab(SettingsTab):
""" """
@ -36,7 +36,7 @@ class ImageTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'ImageTab') self.setObjectName(u'ImageTab')
self.tabTitleVisible = self.trUtf8('Images') self.tabTitleVisible = translate(u'ImagePlugin.ImageTab', u'Images')
self.ImageLayout = QtGui.QFormLayout(self) self.ImageLayout = QtGui.QFormLayout(self)
self.ImageLayout.setObjectName(u'ImageLayout') self.ImageLayout.setObjectName(u'ImageLayout')
self.ImageSettingsGroupBox = QtGui.QGroupBox(self) self.ImageSettingsGroupBox = QtGui.QGroupBox(self)
@ -63,9 +63,12 @@ class ImageTab(SettingsTab):
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.ImageSettingsGroupBox.setTitle(self.trUtf8('Image Settings')) self.ImageSettingsGroupBox.setTitle(
self.TimeoutLabel.setText(self.trUtf8('Slide Loop Delay:')) translate(u'ImagePlugin.ImageTab', u'Image Settings'))
self.TimeoutSpinBox.setSuffix(self.trUtf8('sec')) self.TimeoutLabel.setText(
translate(u'ImagePlugin.ImageTab', u'Slide Loop Delay:'))
self.TimeoutSpinBox.setSuffix(
translate(u'ImagePlugin.ImageTab', u'sec'))
def onTimeoutSpinBoxChanged(self): def onTimeoutSpinBoxChanged(self):
self.loop_delay = self.TimeoutSpinBox.value() self.loop_delay = self.TimeoutSpinBox.value()

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
contextMenuAction, ItemCapabilities, SettingsManager contextMenuAction, ItemCapabilities, SettingsManager, translate
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -56,15 +56,17 @@ class ImageMediaItem(MediaManagerItem):
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Image') self.PluginNameVisible = translate(u'ImagePlugin.MediaItem', u'Image')
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = self.trUtf8('Select Image(s)') self.OnNewPrompt = translate(u'ImagePlugin.MediaItem',
u'Select Image(s)')
file_formats = u'' file_formats = u''
for file_format in QtGui.QImageReader.supportedImageFormats(): for file_format in QtGui.QImageReader.supportedImageFormats():
file_formats += u'*.%s ' % file_format file_formats += u'*.%s ' % file_format
self.OnNewFileMasks = unicode( self.OnNewFileMasks = unicode(
self.trUtf8('Images (%s);; All files (*)')) % file_formats translate(u'ImagePlugin.MediaItem',
u'Images (%s);; All files (*)')) % file_formats
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -93,7 +95,7 @@ class ImageMediaItem(MediaManagerItem):
self.ListView.addAction( self.ListView.addAction(
contextMenuAction( contextMenuAction(
self.ListView, u':/slides/slide_blank.png', self.ListView, u':/slides/slide_blank.png',
self.trUtf8('Replace Live Background'), translate(u'ImagePlugin.MediaItem', u'Replace Live Background'),
self.onReplaceClick)) self.onReplaceClick))
def addEndHeaderBar(self): def addEndHeaderBar(self):
@ -108,7 +110,8 @@ class ImageMediaItem(MediaManagerItem):
self.ImageWidget.setObjectName(u'ImageWidget') self.ImageWidget.setObjectName(u'ImageWidget')
self.blankButton = self.Toolbar.addToolbarButton( self.blankButton = self.Toolbar.addToolbarButton(
u'Replace Background', u':/slides/slide_blank.png', u'Replace Background', u':/slides/slide_blank.png',
self.trUtf8('Replace Live Background'), self.onReplaceClick, False) translate(u'ImagePlugin.MediaItem', u'Replace Live Background'),
self.onReplaceClick, False)
# Add the song widget to the page layout # Add the song widget to the page layout
self.PageLayout.addWidget(self.ImageWidget) self.PageLayout.addWidget(self.ImageWidget)
@ -147,7 +150,8 @@ class ImageMediaItem(MediaManagerItem):
def generateSlideData(self, service_item, item=None): def generateSlideData(self, service_item, item=None):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
if items: if items:
service_item.title = unicode(self.trUtf8('Image(s)')) service_item.title = unicode(
translate(u'ImagePlugin.MediaItem', u'Image(s)'))
service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsMaintain)
service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsPreview)
service_item.add_capability(ItemCapabilities.AllowsLoop) service_item.add_capability(ItemCapabilities.AllowsLoop)
@ -165,8 +169,9 @@ class ImageMediaItem(MediaManagerItem):
def onReplaceClick(self): def onReplaceClick(self):
if not self.ListView.selectedIndexes(): if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
self.trUtf8('No item selected'), translate(u'ImagePlugin.MediaItem', u'No item selected'),
self.trUtf8('You must select one item')) translate(u'ImagePlugin.MediaItem',
u'You must select one item'))
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
for item in items: for item in items:
bitem = self.ListView.item(item.row()) bitem = self.ListView.item(item.row())

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, contextMenuAction, Receiver ItemCapabilities, SettingsManager, contextMenuAction, Receiver, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -58,13 +58,14 @@ class MediaMediaItem(MediaManagerItem):
self.ServiceItemIconName = u':/media/media_video.png' self.ServiceItemIconName = u':/media/media_video.png'
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Media') self.PluginNameVisible = translate(u'MediaPlugin.MediaItem', u'Media')
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = self.trUtf8('Select Media') self.OnNewPrompt = translate(u'MediaPlugin.MediaItem', u'Select Media')
self.OnNewFileMasks = self.trUtf8('Videos (%s);;' self.OnNewFileMasks = translate(u'MediaPlugin.MediaItem',
'Audio (%s);;' u'Videos (%s);;'
'All files (*)' % (self.parent.video_list, self.parent.audio_list)) u'Audio (%s);;'
u'All files (*)' % (self.parent.video_list, self.parent.audio_list))
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -76,9 +77,8 @@ class MediaMediaItem(MediaManagerItem):
MediaManagerItem.addListViewToToolBar(self) MediaManagerItem.addListViewToToolBar(self)
self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.ListView.addAction( self.ListView.addAction(
contextMenuAction( contextMenuAction(self.ListView, u':/slides/slide_blank.png',
self.ListView, u':/slides/slide_blank.png', translate(u'MediaPlugin.MediaItem', u'Replace Live Background'),
self.trUtf8('Replace Live Background'),
self.onReplaceClick)) self.onReplaceClick))
def addEndHeaderBar(self): def addEndHeaderBar(self):
@ -93,7 +93,8 @@ class MediaMediaItem(MediaManagerItem):
self.ImageWidget.setObjectName(u'ImageWidget') self.ImageWidget.setObjectName(u'ImageWidget')
self.blankButton = self.Toolbar.addToolbarButton( self.blankButton = self.Toolbar.addToolbarButton(
u'Replace Background', u':/slides/slide_blank.png', u'Replace Background', u':/slides/slide_blank.png',
self.trUtf8('Replace Live Background'), self.onReplaceClick, False) translate(u'MediaPlugin.MediaItem', u'Replace Live Background'),
self.onReplaceClick, False)
# Add the song widget to the page layout # Add the song widget to the page layout
self.PageLayout.addWidget(self.ImageWidget) self.PageLayout.addWidget(self.ImageWidget)
@ -105,8 +106,9 @@ class MediaMediaItem(MediaManagerItem):
self.background = True self.background = True
if not self.ListView.selectedIndexes(): if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
self.trUtf8('No item selected'), translate(u'MediaPlugin.MediaItem', u'No item selected'),
self.trUtf8('You must select one item')) translate(u'MediaPlugin.MediaItem',
u'You must select one item'))
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
for item in items: for item in items:
bitem = self.ListView.item(item.row()) bitem = self.ListView.item(item.row())
@ -119,7 +121,8 @@ class MediaMediaItem(MediaManagerItem):
if item is None: if item is None:
return False return False
filename = unicode((item.data(QtCore.Qt.UserRole)).toString()) filename = unicode((item.data(QtCore.Qt.UserRole)).toString())
service_item.title = unicode(self.trUtf8('Media')) service_item.title = unicode(
translate(u'MediaPlugin.MediaItem', u'Media'))
service_item.add_capability(ItemCapabilities.RequiresMedia) service_item.add_capability(ItemCapabilities.RequiresMedia)
frame = u':/media/image_clapperboard.png' frame = u':/media/image_clapperboard.png'
(path, name) = os.path.split(filename) (path, name) = os.path.split(filename)
@ -130,8 +133,8 @@ class MediaMediaItem(MediaManagerItem):
self.ListView.setSelectionMode( self.ListView.setSelectionMode(
QtGui.QAbstractItemView.ExtendedSelection) QtGui.QAbstractItemView.ExtendedSelection)
self.ListView.setIconSize(QtCore.QSize(88, 50)) self.ListView.setIconSize(QtCore.QSize(88, 50))
self.loadList(SettingsManager.load_list( self.loadList(SettingsManager.load_list(self.settingsSection,
self.settingsSection, self.settingsSection)) self.settingsSection))
def onDeleteClick(self): def onDeleteClick(self):
item = self.ListView.currentItem() item = self.ListView.currentItem()
@ -149,3 +152,4 @@ class MediaMediaItem(MediaManagerItem):
item_name.setIcon(build_icon(img)) item_name.setIcon(build_icon(img))
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))
self.ListView.addItem(item_name) self.ListView.addItem(item_name)

View File

@ -25,10 +25,11 @@
import logging import logging
from openlp.core.lib import Plugin, build_icon, PluginStatus
from openlp.plugins.media.lib import MediaMediaItem
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.media.lib import MediaMediaItem
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class MediaPlugin(Plugin): class MediaPlugin(Plugin):
@ -46,13 +47,17 @@ class MediaPlugin(Plugin):
for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype) mimetype = unicode(mimetype)
type = mimetype.split(u'audio/x-') type = mimetype.split(u'audio/x-')
self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype) self.audio_list, mimetype = self._add_to_list(self.audio_list,
type, mimetype)
type = mimetype.split(u'audio/') type = mimetype.split(u'audio/')
self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype) self.audio_list, mimetype = self._add_to_list(self.audio_list,
type, mimetype)
type = mimetype.split(u'video/x-') type = mimetype.split(u'video/x-')
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) self.video_list, mimetype = self._add_to_list(self.video_list,
type, mimetype)
type = mimetype.split(u'video/') type = mimetype.split(u'video/')
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) self.video_list, mimetype = self._add_to_list(self.video_list,
type, mimetype)
def _add_to_list(self, list, value, type): def _add_to_list(self, list, value, type):
if len(value) == 2: if len(value) == 2:
@ -76,6 +81,8 @@ class MediaPlugin(Plugin):
return MediaMediaItem(self, self.icon, self.name) return MediaMediaItem(self, self.icon, self.name)
def about(self): def about(self):
about_text = self.trUtf8('<b>Media Plugin</b><br>This plugin ' about_text = translate(u'MediaPlugin.MediaPlugin',
'allows the playing of audio and video media') u'<b>Media Plugin</b><br>This plugin '
u'allows the playing of audio and video media')
return about_text return about_text

View File

@ -106,20 +106,23 @@ class ImpressController(PresentationController):
loop = 0 loop = 0
log.debug(u'get UNO Desktop Openoffice - getComponentContext') log.debug(u'get UNO Desktop Openoffice - getComponentContext')
context = uno.getComponentContext() context = uno.getComponentContext()
log.debug(u'get UNO Desktop Openoffice - createInstaneWithContext - UnoUrlResolver') log.debug(u'get UNO Desktop Openoffice - createInstaneWithContext - '
u'UnoUrlResolver')
resolver = context.ServiceManager.createInstanceWithContext( resolver = context.ServiceManager.createInstanceWithContext(
u'com.sun.star.bridge.UnoUrlResolver', context) u'com.sun.star.bridge.UnoUrlResolver', context)
while ctx is None and loop < 3: while ctx is None and loop < 3:
try: try:
log.debug(u'get UNO Desktop Openoffice - resolve') log.debug(u'get UNO Desktop Openoffice - resolve')
ctx = resolver.resolve(u'uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext') ctx = resolver.resolve(u'uno:socket,host=localhost,port=2002;'
u'urp;StarOffice.ComponentContext')
except: except:
log.exception(u'Unable to find running instance ') log.exception(u'Unable to find running instance ')
self.start_process() self.start_process()
loop += 1 loop += 1
try: try:
self.manager = ctx.ServiceManager self.manager = ctx.ServiceManager
log.debug(u'get UNO Desktop Openoffice - createInstanceWithContext - Desktop') log.debug(u'get UNO Desktop Openoffice - createInstanceWithContext'
u' - Desktop')
desktop = self.manager.createInstanceWithContext( desktop = self.manager.createInstanceWithContext(
"com.sun.star.frame.Desktop", ctx ) "com.sun.star.frame.Desktop", ctx )
return desktop return desktop
@ -201,7 +204,8 @@ class ImpressDocument(PresentationDocument):
if desktop is None: if desktop is None:
self.controller.start_process() self.controller.start_process()
desktop = self.controller.get_com_desktop() desktop = self.controller.get_com_desktop()
url = u'file:///' + self.filepath.replace(u'\\', u'/').replace(u':', u'|').replace(u' ', u'%20') url = u'file:///' + self.filepath.replace(u'\\', u'/').replace(
u':', u'|').replace(u' ', u'%20')
else: else:
desktop = self.controller.get_uno_desktop() desktop = self.controller.get_uno_desktop()
url = uno.systemPathToFileUrl(self.filepath) url = uno.systemPathToFileUrl(self.filepath)
@ -219,7 +223,8 @@ class ImpressDocument(PresentationDocument):
log.exception(u'Failed to load presentation') log.exception(u'Failed to load presentation')
return return
self.presentation = self.document.getPresentation() self.presentation = self.document.getPresentation()
self.presentation.Display = self.controller.plugin.render_manager.screens.current_display + 1 self.presentation.Display = \
self.controller.plugin.render_manager.screens.current_display + 1
self.control = None self.control = None
self.create_thumbnails() self.create_thumbnails()
@ -332,12 +337,14 @@ class ImpressDocument(PresentationDocument):
log.debug(u'start presentation OpenOffice') log.debug(u'start presentation OpenOffice')
if self.control is None or not self.control.isRunning(): if self.control is None or not self.control.isRunning():
self.presentation.start() self.presentation.start()
# start() returns before the getCurrentComponent is ready. Try for 5 seconds # start() returns before the getCurrentComponent is ready.
# Try for 5 seconds
i = 1 i = 1
while self.desktop.getCurrentComponent() is None and i < 50: while self.desktop.getCurrentComponent() is None and i < 50:
time.sleep(0.1) time.sleep(0.1)
i = i + 1 i = i + 1
self.control = self.desktop.getCurrentComponent().Presentation.getController() self.control = \
self.desktop.getCurrentComponent().Presentation.getController()
else: else:
self.control.activate() self.control.activate()
self.goto_slide(1) self.goto_slide(1)
@ -383,7 +390,7 @@ class ImpressDocument(PresentationDocument):
Returns the text on the slide Returns the text on the slide
``slide_no`` ``slide_no``
The slide the text is required for, starting at 1 The slide the text is required for, starting at 1
""" """
doc = self.document doc = self.document
pages = doc.getDrawPages() pages = doc.getDrawPages()
@ -412,3 +419,4 @@ class ImpressDocument(PresentationDocument):
if shape.supportsService("com.sun.star.drawing.Text"): if shape.supportsService("com.sun.star.drawing.Text"):
text += shape.getString() + '\n' text += shape.getString() + '\n'
return text return text

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
SettingsManager SettingsManager, translate
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import MessageListener from openlp.plugins.presentations.lib import MessageListener
@ -61,11 +61,14 @@ class PresentationMediaItem(MediaManagerItem):
self.message_listener = MessageListener(self) self.message_listener = MessageListener(self)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Presentation') self.PluginNameVisible = translate(u'PresentationPlugin.MediaItem',
u'Presentation')
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = self.trUtf8('Select Presentation(s)') self.OnNewPrompt = translate(u'PresentationPlugin.MediaItem',
self.Automatic = self.trUtf8('Automatic') u'Select Presentation(s)')
self.Automatic = translate(u'PresentationPlugin.MediaItem',
u'Automatic')
fileType = u'' fileType = u''
for controller in self.controllers: for controller in self.controllers:
if self.controllers[controller].enabled: if self.controllers[controller].enabled:
@ -75,7 +78,8 @@ class PresentationMediaItem(MediaManagerItem):
if fileType.find(type) == -1: if fileType.find(type) == -1:
fileType += u'*%s ' % type fileType += u'*%s ' % type
self.parent.service_manager.supportedSuffixes(type) self.parent.service_manager.supportedSuffixes(type)
self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType) self.OnNewFileMasks = translate(u'PresentationPlugin.MediaItem',
u'Presentations (%s)' % fileType)
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -101,7 +105,8 @@ class PresentationMediaItem(MediaManagerItem):
self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget)
self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel') self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel')
self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1)
self.DisplayTypeLabel.setText(self.trUtf8('Present using:')) self.DisplayTypeLabel.setText(
translate(u'PresentationPlugin.MediaItem', u'Present using:'))
# Add the Presentation widget to the page layout # Add the Presentation widget to the page layout
self.PageLayout.addWidget(self.PresentationWidget) self.PageLayout.addWidget(self.PresentationWidget)
@ -134,8 +139,10 @@ class PresentationMediaItem(MediaManagerItem):
filename = os.path.split(unicode(file))[1] filename = os.path.split(unicode(file))[1]
if titles.count(filename) > 0: if titles.count(filename) > 0:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('File exists'), self.trUtf8( self, translate(u'PresentationPlugin.MediaItem',
'A presentation with that filename already exists.'), u'File exists'),
translate(u'PresentationPlugin.MediaItem',
u'A presentation with that filename already exists.'),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
else: else:
icon = None icon = None

View File

@ -122,7 +122,8 @@ class PowerpointDocument(PresentationDocument):
if not self.controller.process.Visible: if not self.controller.process.Visible:
self.controller.start_process() self.controller.start_process()
#try: #try:
self.controller.process.Presentations.Open(self.filepath, False, False, True) self.controller.process.Presentations.Open(self.filepath, False, False,
True)
#except: #except:
# return # return
self.presentation = self.controller.process.Presentations( self.presentation = self.controller.process.Presentations(
@ -140,8 +141,8 @@ class PowerpointDocument(PresentationDocument):
""" """
if self.check_thumbnails(): if self.check_thumbnails():
return return
self.presentation.Export(os.path.join(self.thumbnailpath, '') self.presentation.Export(os.path.join(self.thumbnailpath, ''), 'png',
, 'png', 640, 480) 640, 480)
def close_presentation(self): def close_presentation(self):
""" """
@ -225,7 +226,8 @@ class PowerpointDocument(PresentationDocument):
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88) dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
except: except:
try: try:
dpi = win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88) dpi = \
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
except: except:
dpi = 96 dpi = 96
self.presentation.SlideShowSettings.Run() self.presentation.SlideShowSettings.Run()
@ -286,7 +288,7 @@ class PowerpointDocument(PresentationDocument):
Returns the text on the slide Returns the text on the slide
``slide_no`` ``slide_no``
The slide the text is required for, starting at 1 The slide the text is required for, starting at 1
""" """
text = '' text = ''
shapes = self.presentation.Slides(slide_no).Shapes shapes = self.presentation.Slides(slide_no).Shapes

View File

@ -125,7 +125,8 @@ class PptviewDocument(PresentationDocument):
filepath = str(self.filepath.replace(u'/', u'\\')) filepath = str(self.filepath.replace(u'/', u'\\'))
try: try:
self.pptid = self.controller.process.OpenPPT(filepath, None, rect, self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
str(os.path.join(self.thumbnailpath, self.controller.thumbnailprefix))) str(os.path.join(self.thumbnailpath,
self.controller.thumbnailprefix)))
self.stop_presentation() self.stop_presentation()
except: except:
log.exception(u'Failed to load presentation') log.exception(u'Failed to load presentation')
@ -233,3 +234,4 @@ class PptviewDocument(PresentationDocument):
return path return path
else: else:
return None return None

View File

@ -381,7 +381,7 @@ class PresentationDocument(object):
Returns the text on the slide Returns the text on the slide
``slide_no`` ``slide_no``
The slide the text is required for, starting at 1 The slide the text is required for, starting at 1
""" """
return '' return ''

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab, translate
class PresentationTab(SettingsTab): class PresentationTab(SettingsTab):
""" """
@ -37,7 +37,8 @@ class PresentationTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'PresentationTab') self.setObjectName(u'PresentationTab')
self.tabTitleVisible = self.trUtf8('Presentations') self.tabTitleVisible = translate(u'PresentationPlugin.PresentationTab',
u'Presentations')
self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout = QtGui.QHBoxLayout(self)
self.PresentationLayout.setSpacing(8) self.PresentationLayout.setSpacing(8)
self.PresentationLayout.setMargin(8) self.PresentationLayout.setMargin(8)
@ -88,12 +89,15 @@ class PresentationTab(SettingsTab):
self.PresentationLayout.addWidget(self.PresentationRightWidget) self.PresentationLayout.addWidget(self.PresentationRightWidget)
def retranslateUi(self): def retranslateUi(self):
self.VerseDisplayGroupBox.setTitle(self.trUtf8('Available Controllers')) self.VerseDisplayGroupBox.setTitle(
translate(u'PresentationPlugin.PresentationTab',
u'Available Controllers'))
for key in self.controllers: for key in self.controllers:
controller = self.controllers[key] controller = self.controllers[key]
checkbox = self.PresenterCheckboxes[controller.name] checkbox = self.PresenterCheckboxes[controller.name]
checkbox.setText( checkbox.setText(
u'%s %s' % (controller.name, self.trUtf8('available'))) u'%s %s' % (controller.name,
translate(u'PresentationPlugin.PresentationTab', u'available')))
def load(self): def load(self):
for key in self.controllers: for key in self.controllers:

View File

@ -26,7 +26,7 @@
import os import os
import logging import logging
from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import * from openlp.plugins.presentations.lib import *
@ -108,9 +108,10 @@ class PresentationPlugin(Plugin):
return False return False
def about(self): def about(self):
about_text = self.trUtf8('<b>Presentation Plugin</b> <br> Delivers ' about_text = translate(u'PresentationPlugin.PresentationPlugin',
'the ability to show presentations using a number of different ' u'<b>Presentation Plugin</b> <br> Delivers '
'programs. The choice of available presentation programs is ' u'the ability to show presentations using a number of different '
'available to the user in a drop down box.') u'programs. The choice of available presentation programs is '
u'available to the user in a drop down box.')
return about_text return about_text

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab, translate
class RemoteTab(SettingsTab): class RemoteTab(SettingsTab):
""" """
@ -36,7 +36,7 @@ class RemoteTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'RemoteTab') self.setObjectName(u'RemoteTab')
self.tabTitleVisible = self.trUtf8('Remotes') self.tabTitleVisible = translate(u'RemotePlugin.RemoteTab', u'Remotes')
self.RemoteLayout = QtGui.QFormLayout(self) self.RemoteLayout = QtGui.QFormLayout(self)
self.RemoteLayout.setObjectName(u'RemoteLayout') self.RemoteLayout.setObjectName(u'RemoteLayout')
self.RemoteModeGroupBox = QtGui.QGroupBox(self) self.RemoteModeGroupBox = QtGui.QGroupBox(self)
@ -53,7 +53,8 @@ class RemoteTab(SettingsTab):
0, QtGui.QFormLayout.LabelRole, self.RemoteModeGroupBox) 0, QtGui.QFormLayout.LabelRole, self.RemoteModeGroupBox)
def retranslateUi(self): def retranslateUi(self):
self.RemoteModeGroupBox.setTitle(self.trUtf8('Remotes Receiver Port')) self.RemoteModeGroupBox.setTitle(
translate(u'RemotePlugin.RemoteTab', u'Remotes Receiver Port'))
def load(self): def load(self):
self.RemotePortSpinBox.setValue( self.RemotePortSpinBox.setValue(

View File

@ -25,7 +25,7 @@
import logging import logging
from openlp.core.lib import Plugin from openlp.core.lib import Plugin, translate
from openlp.plugins.remotes.lib import RemoteTab, HttpServer from openlp.plugins.remotes.lib import RemoteTab, HttpServer
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -69,8 +69,9 @@ class RemotesPlugin(Plugin):
""" """
Information about this plugin Information about this plugin
""" """
about_text = self.trUtf8('<b>Remote Plugin</b><br>This plugin ' about_text = translate(u'RemotePlugin.RemotePlugin',
'provides the ability to send messages to a running version of ' u'<b>Remote Plugin</b><br>This plugin '
'openlp on a different computer via a web browser or other app<br>' u'provides the ability to send messages to a running version of '
'The Primary use for this would be to send alerts from a creche') u'openlp on a different computer via a web browser or other app<br>'
u'The Primary use for this would be to send alerts from a creche')
return about_text return about_text

View File

@ -37,36 +37,42 @@ class VerseType(object):
@staticmethod @staticmethod
def to_string(verse_type): def to_string(verse_type):
if verse_type == VerseType.Verse: if verse_type == VerseType.Verse:
return translate('VerseType', 'Verse') return translate(u'VerseType', u'Verse')
elif verse_type == VerseType.Chorus: elif verse_type == VerseType.Chorus:
return translate('VerseType', 'Chorus') return translate(u'VerseType', u'Chorus')
elif verse_type == VerseType.Bridge: elif verse_type == VerseType.Bridge:
return translate('VerseType', 'Bridge') return translate(u'VerseType', u'Bridge')
elif verse_type == VerseType.PreChorus: elif verse_type == VerseType.PreChorus:
return translate('VerseType', 'Pre-Chorus') return translate(u'VerseType', u'Pre-Chorus')
elif verse_type == VerseType.Intro: elif verse_type == VerseType.Intro:
return translate('VerseType', 'Intro') return translate(u'VerseType', u'Intro')
elif verse_type == VerseType.Ending: elif verse_type == VerseType.Ending:
return translate('VerseType', 'Ending') return translate(u'VerseType', u'Ending')
elif verse_type == VerseType.Other: elif verse_type == VerseType.Other:
return translate('VerseType', 'Other') return translate(u'VerseType', u'Other')
@staticmethod @staticmethod
def from_string(verse_type): def from_string(verse_type):
verse_type = verse_type.lower() verse_type = verse_type.lower()
if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower(): if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower():
return VerseType.Verse return VerseType.Verse
elif verse_type == unicode(VerseType.to_string(VerseType.Chorus)).lower(): elif verse_type == \
unicode(VerseType.to_string(VerseType.Chorus)).lower():
return VerseType.Chorus return VerseType.Chorus
elif verse_type == unicode(VerseType.to_string(VerseType.Bridge)).lower(): elif verse_type == \
unicode(VerseType.to_string(VerseType.Bridge)).lower():
return VerseType.Bridge return VerseType.Bridge
elif verse_type == unicode(VerseType.to_string(VerseType.PreChorus)).lower(): elif verse_type == \
unicode(VerseType.to_string(VerseType.PreChorus)).lower():
return VerseType.PreChorus return VerseType.PreChorus
elif verse_type == unicode(VerseType.to_string(VerseType.Intro)).lower(): elif verse_type == \
unicode(VerseType.to_string(VerseType.Intro)).lower():
return VerseType.Intro return VerseType.Intro
elif verse_type == unicode(VerseType.to_string(VerseType.Ending)).lower(): elif verse_type == \
unicode(VerseType.to_string(VerseType.Ending)).lower():
return VerseType.Ending return VerseType.Ending
elif verse_type == unicode(VerseType.to_string(VerseType.Other)).lower(): elif verse_type == \
unicode(VerseType.to_string(VerseType.Other)).lower():
return VerseType.Other return VerseType.Other
from authorsform import AuthorsForm from authorsform import AuthorsForm

View File

@ -75,8 +75,10 @@ class Ui_AuthorsDialog(object):
def retranslateUi(self, AuthorsDialog): def retranslateUi(self, AuthorsDialog):
AuthorsDialog.setWindowTitle( AuthorsDialog.setWindowTitle(
translate('AuthorsForm', 'Author Maintenance')) translate(u'SongsPlugin.AuthorsForm', u'Author Maintenance'))
self.DisplayLabel.setText(translate('AuthorsForm', 'Display name:')) self.DisplayLabel.setText(
self.FirstNameLabel.setText(translate('AuthorsForm', 'First name:')) translate(u'SongsPlugin.AuthorsForm', u'Display name:'))
self.LastNameLabel.setText(translate('AuthorsForm', 'Last name:')) self.FirstNameLabel.setText(
translate(u'SongsPlugin.AuthorsForm', u'First name:'))
self.LastNameLabel.setText(
translate(u'SongsPlugin.AuthorsForm', u'Last name:'))

View File

@ -25,8 +25,10 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.core.lib import translate
from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog
class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
""" """
Class to control the Maintenance of Authors Dialog Class to control the Maintenance of Authors Dialog
@ -77,21 +79,28 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
def accept(self): def accept(self):
if not self.FirstNameEdit.text(): if not self.FirstNameEdit.text():
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), self.trUtf8( QtGui.QMessageBox.critical(
'You need to type in the first name of the author.')) self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
translate(u'SongsPlugin.AuthorsForm',
u'You need to type in the first name of the author.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.FirstNameEdit.setFocus() self.FirstNameEdit.setFocus()
return False return False
elif not self.LastNameEdit.text(): elif not self.LastNameEdit.text():
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), QtGui.QMessageBox.critical(
self.trUtf8('You need to type in the last name of the author.')) self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
translate(u'SongsPlugin.AuthorsForm',
u'You need to type in the last name of the author.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.LastNameEdit.setFocus() self.LastNameEdit.setFocus()
return False return False
elif not self.DisplayEdit.text(): elif not self.DisplayEdit.text():
if QtGui.QMessageBox.critical( if QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
self.trUtf8('You haven\'t set a display name for the ' translate(u'SongsPlugin.AuthorsForm',
'author, would you like me to combine the first and ' u'You haven\'t set a display name for the '
'last names for you?'), u'author, would you like me to combine the first and '
u'last names for you?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
) == QtGui.QMessageBox.Yes: ) == QtGui.QMessageBox.Yes:

View File

@ -116,7 +116,8 @@ class Ui_EditSongDialog(object):
self.AuthorsTabLayout.setObjectName(u'AuthorsTabLayout') self.AuthorsTabLayout.setObjectName(u'AuthorsTabLayout')
self.AuthorsMaintenanceWidget = QtGui.QWidget(self.AuthorsTab) self.AuthorsMaintenanceWidget = QtGui.QWidget(self.AuthorsTab)
self.AuthorsMaintenanceWidget.setObjectName(u'AuthorsMaintenanceWidget') self.AuthorsMaintenanceWidget.setObjectName(u'AuthorsMaintenanceWidget')
self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(self.AuthorsMaintenanceWidget) self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(
self.AuthorsMaintenanceWidget)
self.AuthorsMaintenanceLayout.setSpacing(8) self.AuthorsMaintenanceLayout.setSpacing(8)
self.AuthorsMaintenanceLayout.setMargin(0) self.AuthorsMaintenanceLayout.setMargin(0)
self.AuthorsMaintenanceLayout.setObjectName(u'AuthorsMaintenanceLayout') self.AuthorsMaintenanceLayout.setObjectName(u'AuthorsMaintenanceLayout')
@ -146,7 +147,8 @@ class Ui_EditSongDialog(object):
self.AuthorsSelectionComboItem.setSizeAdjustPolicy( self.AuthorsSelectionComboItem.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength) QtGui.QComboBox.AdjustToMinimumContentsLength)
self.AuthorsSelectionComboItem.setMinimumContentsLength(8) self.AuthorsSelectionComboItem.setMinimumContentsLength(8)
self.AuthorsSelectionComboItem.setObjectName(u'AuthorsSelectionComboItem') self.AuthorsSelectionComboItem.setObjectName(
u'AuthorsSelectionComboItem')
self.AuthorAddLayout.addWidget(self.AuthorsSelectionComboItem) self.AuthorAddLayout.addWidget(self.AuthorsSelectionComboItem)
self.AuthorAddButton = QtGui.QPushButton(self.AuthorAddWidget) self.AuthorAddButton = QtGui.QPushButton(self.AuthorAddWidget)
self.AuthorAddButton.setMaximumSize(QtCore.QSize(110, 16777215)) self.AuthorAddButton.setMaximumSize(QtCore.QSize(110, 16777215))
@ -261,7 +263,8 @@ class Ui_EditSongDialog(object):
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongbookCombo.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(
self.SongbookCombo.sizePolicy().hasHeightForWidth())
self.SongbookCombo.setEditable(True) self.SongbookCombo.setEditable(True)
self.SongbookCombo.setSizePolicy(sizePolicy) self.SongbookCombo.setSizePolicy(sizePolicy)
self.SongbookCombo.setObjectName(u'SongbookCombo') self.SongbookCombo.setObjectName(u'SongbookCombo')
@ -277,7 +280,8 @@ class Ui_EditSongDialog(object):
self.ThemeTabLayout.setObjectName(u'ThemeTabLayout') self.ThemeTabLayout.setObjectName(u'ThemeTabLayout')
self.ThemeCopyCommentsWidget = QtGui.QWidget(self.ThemeTab) self.ThemeCopyCommentsWidget = QtGui.QWidget(self.ThemeTab)
self.ThemeCopyCommentsWidget.setObjectName(u'ThemeCopyCommentsWidget') self.ThemeCopyCommentsWidget.setObjectName(u'ThemeCopyCommentsWidget')
self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(self.ThemeCopyCommentsWidget) self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(
self.ThemeCopyCommentsWidget)
self.ThemeCopyCommentsLayout.setSpacing(8) self.ThemeCopyCommentsLayout.setSpacing(8)
self.ThemeCopyCommentsLayout.setMargin(0) self.ThemeCopyCommentsLayout.setMargin(0)
self.ThemeCopyCommentsLayout.setObjectName(u'ThemeCopyCommentsLayout') self.ThemeCopyCommentsLayout.setObjectName(u'ThemeCopyCommentsLayout')
@ -286,7 +290,8 @@ class Ui_EditSongDialog(object):
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Preferred) QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.TextWidget.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(
self.TextWidget.sizePolicy().hasHeightForWidth())
self.TextWidget.setSizePolicy(sizePolicy) self.TextWidget.setSizePolicy(sizePolicy)
self.TextWidget.setObjectName(u'TextWidget') self.TextWidget.setObjectName(u'TextWidget')
self.DetailsLayout = QtGui.QVBoxLayout(self.TextWidget) self.DetailsLayout = QtGui.QVBoxLayout(self.TextWidget)
@ -401,58 +406,91 @@ class Ui_EditSongDialog(object):
EditSongDialog.setTabOrder(self.AlternativeEdit, self.VerseListWidget) EditSongDialog.setTabOrder(self.AlternativeEdit, self.VerseListWidget)
EditSongDialog.setTabOrder(self.VerseListWidget, self.VerseAddButton) EditSongDialog.setTabOrder(self.VerseListWidget, self.VerseAddButton)
EditSongDialog.setTabOrder(self.VerseAddButton, self.VerseEditButton) EditSongDialog.setTabOrder(self.VerseAddButton, self.VerseEditButton)
EditSongDialog.setTabOrder(self.VerseEditButton, self.VerseEditAllButton) EditSongDialog.setTabOrder(self.VerseEditButton,
EditSongDialog.setTabOrder(self.VerseEditAllButton, self.VerseDeleteButton) self.VerseEditAllButton)
EditSongDialog.setTabOrder(self.VerseEditAllButton,
self.VerseDeleteButton)
EditSongDialog.setTabOrder(self.VerseDeleteButton, self.VerseOrderEdit) EditSongDialog.setTabOrder(self.VerseDeleteButton, self.VerseOrderEdit)
EditSongDialog.setTabOrder(self.VerseOrderEdit, self.AuthorsSelectionComboItem) EditSongDialog.setTabOrder(self.VerseOrderEdit,
EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem, self.AuthorAddButton) self.AuthorsSelectionComboItem)
EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem,
self.AuthorAddButton)
EditSongDialog.setTabOrder(self.AuthorAddButton, self.AuthorsListView) EditSongDialog.setTabOrder(self.AuthorAddButton, self.AuthorsListView)
EditSongDialog.setTabOrder(self.AuthorsListView, self.AuthorRemoveButton) EditSongDialog.setTabOrder(self.AuthorsListView,
EditSongDialog.setTabOrder(self.AuthorRemoveButton, self.MaintenanceButton) self.AuthorRemoveButton)
EditSongDialog.setTabOrder(self.AuthorRemoveButton,
self.MaintenanceButton)
EditSongDialog.setTabOrder(self.MaintenanceButton, self.SongTopicCombo) EditSongDialog.setTabOrder(self.MaintenanceButton, self.SongTopicCombo)
EditSongDialog.setTabOrder(self.SongTopicCombo, self.TopicAddButton) EditSongDialog.setTabOrder(self.SongTopicCombo, self.TopicAddButton)
EditSongDialog.setTabOrder(self.TopicAddButton, self.TopicsListView) EditSongDialog.setTabOrder(self.TopicAddButton, self.TopicsListView)
EditSongDialog.setTabOrder(self.TopicsListView, self.TopicRemoveButton) EditSongDialog.setTabOrder(self.TopicsListView, self.TopicRemoveButton)
EditSongDialog.setTabOrder(self.TopicRemoveButton, self.SongbookCombo) EditSongDialog.setTabOrder(self.TopicRemoveButton, self.SongbookCombo)
EditSongDialog.setTabOrder(self.SongbookCombo, self.ThemeSelectionComboItem) EditSongDialog.setTabOrder(self.SongbookCombo,
EditSongDialog.setTabOrder(self.ThemeSelectionComboItem, self.ThemeAddButton) self.ThemeSelectionComboItem)
EditSongDialog.setTabOrder(self.ThemeSelectionComboItem,
self.ThemeAddButton)
EditSongDialog.setTabOrder(self.ThemeAddButton, self.CopyrightEditItem) EditSongDialog.setTabOrder(self.ThemeAddButton, self.CopyrightEditItem)
EditSongDialog.setTabOrder(self.CopyrightEditItem, self.CopyrightInsertButton) EditSongDialog.setTabOrder(self.CopyrightEditItem,
EditSongDialog.setTabOrder(self.CopyrightInsertButton, self.CCLNumberEdit) self.CopyrightInsertButton)
EditSongDialog.setTabOrder(self.CopyrightInsertButton,
self.CCLNumberEdit)
EditSongDialog.setTabOrder(self.CCLNumberEdit, self.CommentsEdit) EditSongDialog.setTabOrder(self.CCLNumberEdit, self.CommentsEdit)
EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox) EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox)
def retranslateUi(self, EditSongDialog): def retranslateUi(self, EditSongDialog):
EditSongDialog.setWindowTitle(translate('EditSongForm', 'Song Editor')) EditSongDialog.setWindowTitle(
self.TitleLabel.setText(translate('EditSongForm', 'Title:')) translate(u'SongsPlugin.EditSongForm', u'Song Editor'))
self.AlternativeTitleLabel.setText(translate('EditSongForm', 'Alternative Title:')) self.TitleLabel.setText(
self.LyricsLabel.setText(translate('EditSongForm', 'Lyrics:')) translate(u'SongsPlugin.EditSongForm', u'Title:'))
self.VerseOrderLabel.setText(translate('EditSongForm', 'Verse Order:')) self.AlternativeTitleLabel.setText(
self.VerseAddButton.setText(translate('EditSongForm', 'Add')) translate(u'SongsPlugin.EditSongForm', u'Alternative Title:'))
self.VerseEditButton.setText(translate('EditSongForm', 'Edit')) self.LyricsLabel.setText(
self.VerseEditAllButton.setText(translate('EditSongForm', 'Edit All')) translate(u'SongsPlugin.EditSongForm', u'Lyrics:'))
self.VerseDeleteButton.setText(translate('EditSongForm', 'Delete')) self.VerseOrderLabel.setText(
translate(u'SongsPlugin.EditSongForm', u'Verse Order:'))
self.VerseAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Add'))
self.VerseEditButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Edit'))
self.VerseEditAllButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Edit All'))
self.VerseDeleteButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Delete'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.LyricsTab), self.SongTabWidget.indexOf(self.LyricsTab),
translate('EditSongForm', 'Title && Lyrics')) translate(u'SongsPlugin.EditSongForm', u'Title && Lyrics'))
self.AuthorsGroupBox.setTitle(translate('EditSongForm', 'Authors')) self.AuthorsGroupBox.setTitle(
self.AuthorAddButton.setText(translate('EditSongForm', '&Add to Song')) translate(u'SongsPlugin.EditSongForm', u'Authors'))
self.AuthorRemoveButton.setText(translate('EditSongForm', '&Remove')) self.AuthorAddButton.setText(
self.MaintenanceButton.setText( translate(u'SongsPlugin.EditSongForm', u'&Add to Song'))
translate('EditSongForm', '&Manage Authors, Topics, Books')) self.AuthorRemoveButton.setText(
self.TopicGroupBox.setTitle(translate('EditSongForm', 'Topic')) translate(u'SongsPlugin.EditSongForm', u'&Remove'))
self.TopicAddButton.setText(translate('EditSongForm', 'A&dd to Song')) self.MaintenanceButton.setText(translate(u'SongsPlugin.EditSongForm',
self.TopicRemoveButton.setText(translate('EditSongForm', 'R&emove')) u'&Manage Authors, Topics, Books'))
self.SongBookGroup.setTitle(translate('EditSongForm', 'Song Book')) self.TopicGroupBox.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Topic'))
self.TopicAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'A&dd to Song'))
self.TopicRemoveButton.setText(
translate(u'SongsPlugin.EditSongForm', u'R&emove'))
self.SongBookGroup.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Song Book'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.AuthorsTab), self.SongTabWidget.indexOf(self.AuthorsTab),
translate('EditSongForm', 'Authors, Topics && Book')) translate(u'SongsPlugin.EditSongForm', u'Authors, Topics && Book'))
self.ThemeGroupBox.setTitle(translate('EditSongForm', 'Theme')) self.ThemeGroupBox.setTitle(
self.ThemeAddButton.setText(translate('EditSongForm', 'Add a Theme')) translate(u'SongsPlugin.EditSongForm', u'Theme'))
self.CopyrightGroupBox.setTitle(translate('EditSongForm', 'Copyright Information')) self.ThemeAddButton.setText(
self.CopyrightInsertButton.setText(translate('EditSongForm', u'\xa9')) translate(u'SongsPlugin.EditSongForm', u'Add a Theme'))
self.CCLILabel.setText(translate('EditSongForm', 'CCLI Number:')) self.CopyrightGroupBox.setTitle(
self.CommentsGroupBox.setTitle(translate('EditSongForm', 'Comments')) translate(u'SongsPlugin.EditSongForm', u'Copyright Information'))
self.CopyrightInsertButton.setText(
translate(u'SongsPlugin.EditSongForm', u'\xa9'))
self.CCLILabel.setText(
translate(u'SongsPlugin.EditSongForm', u'CCLI Number:'))
self.CommentsGroupBox.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Comments'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.ThemeTab), self.SongTabWidget.indexOf(self.ThemeTab),
translate('EditSongForm', 'Theme, Copyright Info && Comments')) translate(u'SongsPlugin.EditSongForm',
u'Theme, Copyright Info && Comments'))

View File

@ -28,7 +28,7 @@ import re
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate
from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.forms import EditVerseForm
from openlp.plugins.songs.lib.models import Song from openlp.plugins.songs.lib.models import Song
from editsongdialog import Ui_EditSongDialog from editsongdialog import Ui_EditSongDialog
@ -102,7 +102,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
self.previewButton = QtGui.QPushButton() self.previewButton = QtGui.QPushButton()
self.previewButton.setObjectName(u'previewButton') self.previewButton.setObjectName(u'previewButton')
self.previewButton.setText(self.trUtf8('Save && Preview')) self.previewButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Save && Preview'))
self.ButtonBox.addButton( self.ButtonBox.addButton(
self.previewButton, QtGui.QDialogButtonBox.ActionRole) self.previewButton, QtGui.QDialogButtonBox.ActionRole)
QtCore.QObject.connect(self.ButtonBox, QtCore.QObject.connect(self.ButtonBox,
@ -436,12 +437,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if parts.endswith(u'\n'): if parts.endswith(u'\n'):
parts = parts.rstrip(u'\n') parts = parts.rstrip(u'\n')
item = QtGui.QTableWidgetItem(parts) item = QtGui.QTableWidgetItem(parts)
item.setData( item.setData(QtCore.Qt.UserRole,
QtCore.Qt.UserRole, QtCore.QVariant(variant)) QtCore.QVariant(variant))
self.VerseListWidget.setRowCount( self.VerseListWidget.setRowCount(
self.VerseListWidget.rowCount() + 1) self.VerseListWidget.rowCount() + 1)
self.VerseListWidget.setItem( self.VerseListWidget.setItem(
int(self.VerseListWidget.rowCount() - 1), 0, item) int(self.VerseListWidget.rowCount() - 1),
0, item)
self.VerseListWidget.setColumnWidth(0, self.width) self.VerseListWidget.setColumnWidth(0, self.width)
self.VerseListWidget.resizeRowsToContents() self.VerseListWidget.resizeRowsToContents()
self.VerseListWidget.repaint() self.VerseListWidget.repaint()
@ -462,16 +464,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if len(self.TitleEditItem.displayText()) == 0: if len(self.TitleEditItem.displayText()) == 0:
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.TitleEditItem.setFocus() self.TitleEditItem.setFocus()
return False, self.trUtf8('You need to enter a song title.') return False, translate(u'SongsPlugin.EditSongForm',
u'You need to enter a song title.')
if self.VerseListWidget.rowCount() == 0: if self.VerseListWidget.rowCount() == 0:
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.VerseListWidget.setFocus() self.VerseListWidget.setFocus()
return False, self.trUtf8('You need to enter some verses.') return False, translate(u'SongsPlugin.EditSongForm',
u'You need to enter some verses.')
if self.AuthorsListView.count() == 0: if self.AuthorsListView.count() == 0:
self.SongTabWidget.setCurrentIndex(1) self.SongTabWidget.setCurrentIndex(1)
self.AuthorsListView.setFocus() self.AuthorsListView.setFocus()
#split the verse list by space and mark lower case for testing #split the verse list by space and mark lower case for testing
taglist = unicode(self.trUtf8(' bitpeovc')) taglist = unicode(translate(u'SongsPlugin.EditSongForm', u' bitpeovc'))
for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '): for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '):
if len(verse) > 1: if len(verse) > 1:
if taglist.find(verse[0:1]) > -1 \ if taglist.find(verse[0:1]) > -1 \
@ -480,9 +484,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
else: else:
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus() self.VerseOrderEdit.setFocus()
return False, \ return False, translate(u'SongsPlugin.EditSongForm',
self.trUtf8(\ u'Invalid verse entry, values must be I,B,T,P,E,O,V,C '
'Invalid verse entry, values must be I,B,T,P,E,O,V,C followed by a number') u'followed by a number')
return True, u'' return True, u''
def onTitleEditItemLostFocus(self): def onTitleEditItemLostFocus(self):
@ -534,7 +538,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
valid, message = self._validate_song() valid, message = self._validate_song()
if not valid: if not valid:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), message, self, translate(u'SongsPlugin.EditSongForm', u'Error'), message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return False return False
self.song.title = unicode(self.TitleEditItem.text()) self.song.title = unicode(self.TitleEditItem.text())
@ -593,4 +597,3 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.search_title = self.song.search_title.replace(u'}', u'') self.song.search_title = self.song.search_title.replace(u'}', u'')
self.song.search_title = self.song.search_title.replace(u'?', u'') self.song.search_title = self.song.search_title.replace(u'?', u'')

View File

@ -73,33 +73,37 @@ class Ui_EditVerseDialog(object):
self.EditVerseLayout.addLayout(self.VerseTypeLayout) self.EditVerseLayout.addLayout(self.VerseTypeLayout)
self.EditButtonBox = QtGui.QDialogButtonBox(EditVerseDialog) self.EditButtonBox = QtGui.QDialogButtonBox(EditVerseDialog)
self.EditButtonBox.setOrientation(QtCore.Qt.Horizontal) self.EditButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.EditButtonBox.setStandardButtons( self.EditButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Save) QtGui.QDialogButtonBox.Save)
self.EditButtonBox.setObjectName(u'EditButtonBox') self.EditButtonBox.setObjectName(u'EditButtonBox')
self.EditVerseLayout.addWidget(self.EditButtonBox) self.EditVerseLayout.addWidget(self.EditButtonBox)
self.retranslateUi(EditVerseDialog) self.retranslateUi(EditVerseDialog)
QtCore.QObject.connect( QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'accepted()'),
self.EditButtonBox, EditVerseDialog.accept)
QtCore.SIGNAL(u'accepted()'), QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'rejected()'),
EditVerseDialog.accept EditVerseDialog.reject)
)
QtCore.QObject.connect(
self.EditButtonBox,
QtCore.SIGNAL(u'rejected()'),
EditVerseDialog.reject
)
QtCore.QMetaObject.connectSlotsByName(EditVerseDialog) QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
def retranslateUi(self, EditVerseDialog): def retranslateUi(self, EditVerseDialog):
EditVerseDialog.setWindowTitle(translate('EditVerseForm', 'Edit Verse')) EditVerseDialog.setWindowTitle(
self.VerseTypeLabel.setText(translate('EditVerseForm', 'Verse Type:')) translate(u'SongsPlugin.EditVerseForm', u'Edit Verse'))
self.VerseTypeComboBox.setItemText(0, VerseType.to_string(VerseType.Verse)) self.VerseTypeLabel.setText(
self.VerseTypeComboBox.setItemText(1, VerseType.to_string(VerseType.Chorus)) translate(u'SongsPlugin.EditVerseForm', u'Verse Type:'))
self.VerseTypeComboBox.setItemText(2, VerseType.to_string(VerseType.Bridge)) self.VerseTypeComboBox.setItemText(0,
self.VerseTypeComboBox.setItemText(3, VerseType.to_string(VerseType.PreChorus)) VerseType.to_string(VerseType.Verse))
self.VerseTypeComboBox.setItemText(4, VerseType.to_string(VerseType.Intro)) self.VerseTypeComboBox.setItemText(1,
self.VerseTypeComboBox.setItemText(5, VerseType.to_string(VerseType.Ending)) VerseType.to_string(VerseType.Chorus))
self.VerseTypeComboBox.setItemText(6, VerseType.to_string(VerseType.Other)) self.VerseTypeComboBox.setItemText(2,
self.InsertButton.setText(translate('EditVerseForm', 'Insert')) VerseType.to_string(VerseType.Bridge))
self.VerseTypeComboBox.setItemText(3,
VerseType.to_string(VerseType.PreChorus))
self.VerseTypeComboBox.setItemText(4,
VerseType.to_string(VerseType.Intro))
self.VerseTypeComboBox.setItemText(5,
VerseType.to_string(VerseType.Ending))
self.VerseTypeComboBox.setItemText(6,
VerseType.to_string(VerseType.Other))
self.InsertButton.setText(
translate(u'SongsPlugin.EditVerseForm', u'Insert'))

View File

@ -112,7 +112,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
tag=u'%s:1' % VerseType.to_string(VerseType.Verse)): tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):
if single: if single:
verse_type, verse_number = tag.split(u':') verse_type, verse_number = tag.split(u':')
self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type)) self.VerseTypeComboBox.setCurrentIndex(
VerseType.from_string(verse_type))
self.VerseNumberBox.setValue(int(verse_number)) self.VerseNumberBox.setValue(int(verse_number))
self.InsertButton.setVisible(False) self.InsertButton.setVisible(False)
else: else:
@ -133,6 +134,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
def getVerseAll(self): def getVerseAll(self):
text = self.VerseTextEdit.toPlainText() text = self.VerseTextEdit.toPlainText()
if not text.startsWith(u'---['): if not text.startsWith(u'---['):
text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), text) text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse),
text)
return text return text

View File

@ -286,21 +286,41 @@ class Ui_OpenLPExportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenLPExportDialog) QtCore.QMetaObject.connectSlotsByName(OpenLPExportDialog)
def retranslateUi(self, OpenLPExportDialog): def retranslateUi(self, OpenLPExportDialog):
OpenLPExportDialog.setWindowTitle(translate('OpenLPExportForm', 'openlp.org Song Exporter')) OpenLPExportDialog.setWindowTitle(
self.ExportFileLabel.setText(translate('OpenLPExportForm', 'Select openlp.org export filename:')) translate(u'SongsPlugin.OpenLPExportForm',
self.ExportListLabel.setText(translate('OpenLPExportForm', 'Full Song List')) u'openlp.org Song Exporter'))
self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title')) self.ExportFileLabel.setText(
self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author')) translate(u'SongsPlugin.OpenLPExportForm',
self.ExportSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All')) u'Select openlp.org export filename:'))
self.ExportFilterComboBox.setItemText(0, translate('OpenLPExportForm', 'Lyrics')) self.ExportListLabel.setText(
self.ExportFilterComboBox.setItemText(1, translate('OpenLPExportForm', 'Title')) translate(u'SongsPlugin.OpenLPExportForm', u'Full Song List'))
self.ExportFilterComboBox.setItemText(2, translate('OpenLPExportForm', 'Author')) self.ExportListTable.horizontalHeaderItem(0).setText(
self.SelectedListLabel.setText(translate('OpenLPExportForm', 'Song Export List')) translate(u'SongsPlugin.OpenLPExportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title')) self.ExportListTable.horizontalHeaderItem(1).setText(
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author')) translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All')) self.ExportSelectAllPushButton.setText(
self.SelectedRemoveSelectedButton.setText(translate('OpenLPExportForm', 'Remove Selected')) translate(u'SongsPlugin.OpenLPExportForm', u'Select All'))
self.ProgressGroupBox.setTitle(translate('OpenLPExportForm', 'Progress:')) self.ExportFilterComboBox.setItemText(0,
self.ProgressLabel.setText(translate('OpenLPExportForm', 'Ready to export')) translate(u'SongsPlugin.OpenLPExportForm', u'Lyrics'))
self.ExportPushButton.setText(translate('OpenLPExportForm', 'Export')) self.ExportFilterComboBox.setItemText(1,
self.ClosePushButton.setText(translate('OpenLPExportForm', 'Close')) translate(u'SongsPlugin.OpenLPExportForm', u'Title'))
self.ExportFilterComboBox.setItemText(2,
translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.SelectedListLabel.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Song Export List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Select All'))
self.SelectedRemoveSelectedButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Remove Selected'))
self.ProgressGroupBox.setTitle(
translate(u'SongsPlugin.OpenLPExportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Ready to export'))
self.ExportPushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Export'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Close'))

View File

@ -286,21 +286,42 @@ class Ui_OpenLPImportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenLPImportDialog) QtCore.QMetaObject.connectSlotsByName(OpenLPImportDialog)
def retranslateUi(self, OpenLPImportDialog): def retranslateUi(self, OpenLPImportDialog):
OpenLPImportDialog.setWindowTitle(translate('OpenLPImportForm', 'openlp.org Song Importer')) OpenLPImportDialog.setWindowTitle(
self.ImportFileLabel.setText(translate('OpenLPImportForm', 'Select openlp.org songfile to import:')) translate(u'SongsPlugin.OpenLPImportForm',
self.ImportListLabel.setText(translate('OpenLPImportForm', 'Import File Song List')) u'openlp.org Song Importer'))
self.ImportListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title')) self.ImportFileLabel.setText(
self.ImportListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author')) translate(u'SongsPlugin.OpenLPImportForm',
self.ImportSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All')) u'Select openlp.org songfile to import:'))
self.ImportFilterComboBox.setItemText(0, translate('OpenLPImportForm', 'Lyrics')) self.ImportListLabel.setText(
self.ImportFilterComboBox.setItemText(1, translate('OpenLPImportForm', 'Title')) translate(u'SongsPlugin.OpenLPImportForm',
self.ImportFilterComboBox.setItemText(2, translate('OpenLPImportForm', 'Author')) u'Import File Song List'))
self.SelectedListLabel.setText(translate('OpenLPImportForm', 'Song Import List')) self.ImportListTable.horizontalHeaderItem(0).setText(
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title')) translate(u'SongsPlugin.OpenLPImportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author')) self.ImportListTable.horizontalHeaderItem(1).setText(
self.SelectedSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All')) translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.SelectedRemoveSelectedButton.setText(translate('OpenLPImportForm', 'Remove Selected')) self.ImportSelectAllPushButton.setText(
self.ProgressGroupBox.setTitle(translate('OpenLPImportForm', 'Progress:')) translate(u'SongsPlugin.OpenLPImportForm', u'Select All'))
self.ProgressLabel.setText(translate('OpenLPImportForm', 'Ready to import')) self.ImportFilterComboBox.setItemText(0,
self.ImportPushButton.setText(translate('OpenLPImportForm', 'Import')) translate(u'SongsPlugin.OpenLPImportForm', u'Lyrics'))
self.ClosePushButton.setText(translate('OpenLPImportForm', 'Close')) self.ImportFilterComboBox.setItemText(1,
translate(u'SongsPlugin.OpenLPImportForm', u'Title'))
self.ImportFilterComboBox.setItemText(2,
translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.SelectedListLabel.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Song Import List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Select All'))
self.SelectedRemoveSelectedButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Remove Selected'))
self.ProgressGroupBox.setTitle(
translate(u'SongsPlugin.OpenLPImportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Ready to import'))
self.ImportPushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Import'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Close'))

View File

@ -286,21 +286,39 @@ class Ui_OpenSongExportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenSongExportDialog) QtCore.QMetaObject.connectSlotsByName(OpenSongExportDialog)
def retranslateUi(self, OpenSongExportDialog): def retranslateUi(self, OpenSongExportDialog):
OpenSongExportDialog.setWindowTitle(translate('OpenSongExportForm', 'OpenSong Song Exporter')) OpenSongExportDialog.setWindowTitle(
self.ExportFileLabel.setText(translate('OpenSongExportForm', 'Select OpenSong song folder:')) translate(u'SongsPlugin.OpenSongExportForm', u'OpenSong Song Exporter'))
self.ExportListLabel.setText(translate('OpenSongExportForm', 'Full Song List')) self.ExportFileLabel.setText(
self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title')) translate(u'SongsPlugin.OpenSongExportForm', u'Select OpenSong song folder:'))
self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author')) self.ExportListLabel.setText(
self.ExportSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All')) translate(u'SongsPlugin.OpenSongExportForm', u'Full Song List'))
self.ExportFilterComboBox.setItemText(0, translate('OpenSongExportForm', 'Lyrics')) self.ExportListTable.horizontalHeaderItem(0).setText(
self.ExportFilterComboBox.setItemText(1, translate('OpenSongExportForm', 'Title')) translate(u'SongsPlugin.OpenSongExportForm', u'Song Title'))
self.ExportFilterComboBox.setItemText(2, translate('OpenSongExportForm', 'Author')) self.ExportListTable.horizontalHeaderItem(1).setText(
self.SelectedListLabel.setText(translate('OpenSongExportForm', 'Song Export List')) translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title')) self.ExportSelectAllPushButton.setText(
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author')) translate(u'SongsPlugin.OpenSongExportForm', u'Select All'))
self.SelectedSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All')) self.ExportFilterComboBox.setItemText(0,
self.SelectedRemoveSelectedButton.setText(translate('OpenSongExportForm', 'Remove Selected')) translate(u'SongsPlugin.OpenSongExportForm', u'Lyrics'))
self.ProgressGroupBox.setTitle(translate('OpenSongExportForm', 'Progress:')) self.ExportFilterComboBox.setItemText(1,
self.ProgressLabel.setText(translate('OpenSongExportForm', 'Ready to export')) translate(u'SongsPlugin.OpenSongExportForm', u'Title'))
self.ExportPushButton.setText(translate('OpenSongExportForm', 'Export')) self.ExportFilterComboBox.setItemText(2,
self.ClosePushButton.setText(translate('OpenSongExportForm', 'Close')) translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.SelectedListLabel.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Song Export List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Select All'))
self.SelectedRemoveSelectedButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Remove Selected'))
self.ProgressGroupBox.setTitle(
translate(u'SongsPlugin.OpenSongExportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Ready to export'))
self.ExportPushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Export'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Close'))

View File

@ -101,9 +101,15 @@ class Ui_OpenSongImportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenSongImportDialog) QtCore.QMetaObject.connectSlotsByName(OpenSongImportDialog)
def retranslateUi(self, OpenSongImportDialog): def retranslateUi(self, OpenSongImportDialog):
OpenSongImportDialog.setWindowTitle(translate('OpenSongImportForm', 'OpenSong Song Importer')) OpenSongImportDialog.setWindowTitle(
self.ImportFileLabel.setText(translate('OpenSongImportForm', 'OpenSong Folder:')) translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Song Importer'))
self.ProgressGroupBox.setTitle(translate('OpenSongImportForm', 'Progress:')) self.ImportFileLabel.setText(
self.ProgressLabel.setText(translate('OpenSongImportForm', 'Ready to import')) translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Folder:'))
self.ImportPushButton.setText(translate('OpenSongImportForm', 'Import')) self.ProgressGroupBox.setTitle(
self.ClosePushButton.setText(translate('OpenSongImportForm', 'Close')) translate(u'SongsPlugin.OpenSongImportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'Ready to import'))
self.ImportPushButton.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'Import'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'Close'))

View File

@ -66,6 +66,8 @@ class Ui_SongBookDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongBookDialog) QtCore.QMetaObject.connectSlotsByName(SongBookDialog)
def retranslateUi(self, SongBookDialog): def retranslateUi(self, SongBookDialog):
SongBookDialog.setWindowTitle(translate('SongBookForm', 'Edit Book')) SongBookDialog.setWindowTitle(
self.NameLabel.setText(translate('SongBookForm', 'Name:')) translate(u'SongsPlugin.SongBookForm', u'Edit Book'))
self.PublisherLabel.setText(translate('SongBookForm', 'Publisher:')) self.NameLabel.setText(translate(u'SongsPlugin.SongBookForm', u'Name:'))
self.PublisherLabel.setText(
translate(u'SongsPlugin.SongBookForm', u'Publisher:'))

View File

@ -25,8 +25,10 @@
from PyQt4 import QtGui from PyQt4 import QtGui
from openlp.core.lib import translate
from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog
class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
""" """
Class documentation goes here. Class documentation goes here.
@ -48,8 +50,9 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
def accept(self): def accept(self):
if not self.NameEdit.text(): if not self.NameEdit.text():
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongBookForm', u'Error'),
self.trUtf8('You need to type in a book name!'), translate(u'SongsPlugin.SongBookForm',
u'You need to type in a book name!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.NameEdit.setFocus() self.NameEdit.setFocus()
return False return False

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from songimportwizard import Ui_SongImportWizard from songimportwizard import Ui_SongImportWizard
from openlp.core.lib import Receiver, SettingsManager from openlp.core.lib import Receiver, SettingsManager, translate
#from openlp.core.utils import AppLocation, variant_to_unicode #from openlp.core.utils import AppLocation, variant_to_unicode
from openlp.plugins.songs.lib.manager import SongFormat from openlp.plugins.songs.lib.manager import SongFormat
@ -104,36 +104,43 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
if source_format == SongFormat.OpenLyrics: if source_format == SongFormat.OpenLyrics:
if self.OpenLyricsFileListWidget.count() == 0: if self.OpenLyricsFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('No OpenLyrics Files Selected'), translate(u'SongsPlugin.SongImportForm',
self.trUtf8('You need to add at least one OpenLyrics ' u'No OpenLyrics Files Selected'),
'song file to import from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to add at least one OpenLyrics '
u'song file to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.OpenLyricsAddButton.setFocus() self.OpenLyricsAddButton.setFocus()
return False return False
elif source_format == SongFormat.OpenSong: elif source_format == SongFormat.OpenSong:
if self.OpenSongFileListWidget.count() == 0: if self.OpenSongFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('No OpenSong Files Selected'), translate(u'SongsPlugin.SongImportForm',
self.trUtf8('You need to add at least one OpenSong ' u'No OpenSong Files Selected'),
'song file to import from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to add at least one OpenSong '
u'song file to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.OpenSongAddButton.setFocus() self.OpenSongAddButton.setFocus()
return False return False
elif source_format == SongFormat.CCLI: elif source_format == SongFormat.CCLI:
if self.CCLIFileListWidget.count() == 0: if self.CCLIFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('No CCLI Files Selected'), translate(u'SongsPlugin.SongImportForm',
self.trUtf8('You need to add at least one CCLI file ' u'No CCLI Files Selected'),
'to import from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to add at least one CCLI file '
u'to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.CCLIAddButton.setFocus() self.CCLIAddButton.setFocus()
return False return False
elif source_format == SongFormat.CSV: elif source_format == SongFormat.CSV:
if self.CSVFilenameEdit.text().isEmpty(): if self.CSVFilenameEdit.text().isEmpty():
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
self.trUtf8('No CSV File Selected'), translate(u'SongsPlugin.SongImportForm',
self.trUtf8('You need to specify a CSV file to import ' u'No CSV File Selected'),
'from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to specify a CSV file to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.CSVFilenameEdit.setFocus() self.CSVFilenameEdit.setFocus()
return False return False
@ -184,7 +191,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMinimum(0)
self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setMaximum(1188)
self.ImportProgressBar.setValue(0) self.ImportProgressBar.setValue(0)
self.ImportProgressLabel.setText(self.trUtf8('Starting import...')) self.ImportProgressLabel.setText(
translate(u'SongsPlugin.SongImportForm', u'Starting import...'))
Receiver.send_message(u'process_events') Receiver.send_message(u'process_events')
def performImport(self): def performImport(self):
@ -235,10 +243,10 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
# self.manager.save_meta_data(license_version, license_version, # self.manager.save_meta_data(license_version, license_version,
# license_copyright, license_permission) # license_copyright, license_permission)
# self.manager.reload_bibles() # self.manager.reload_bibles()
# self.ImportProgressLabel.setText(self.trUtf8('Finished import.')) # self.ImportProgressLabel.setText(translate(u'SongsPlugin.SongImportForm', u'Finished import.'))
# else: # else:
# self.ImportProgressLabel.setText( # self.ImportProgressLabel.setText(
# self.trUtf8('Your Bible import failed.')) # translate(u'SongsPlugin.SongImportForm', u'Your Bible import failed.'))
# importer.delete() # importer.delete()
def postImport(self): def postImport(self):

View File

@ -25,6 +25,8 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
class Ui_SongImportWizard(object): class Ui_SongImportWizard(object):
def setupUi(self, SongImportWizard): def setupUi(self, SongImportWizard):
SongImportWizard.setObjectName(u'SongImportWizard') SongImportWizard.setObjectName(u'SongImportWizard')
@ -224,32 +226,55 @@ class Ui_SongImportWizard(object):
QtCore.QMetaObject.connectSlotsByName(SongImportWizard) QtCore.QMetaObject.connectSlotsByName(SongImportWizard)
def retranslateUi(self, SongImportWizard): def retranslateUi(self, SongImportWizard):
SongImportWizard.setWindowTitle(self.trUtf8('Song Import Wizard')) SongImportWizard.setWindowTitle(
translate(u'SongsPlugin.SongImportWizard', u'Song Import Wizard'))
self.TitleLabel.setText( self.TitleLabel.setText(
'<span style="font-size:14pt; font-weight:600;">%s</span>' % \ '<span style="font-size:14pt; font-weight:600;">%s</span>' % \
self.trUtf8('Welcome to the Song Import Wizard')) translate(u'SongsPlugin.SongImportWizard',
self.InformationLabel.setText(self.trUtf8('This wizard will help you ' u'Welcome to the Song Import Wizard'))
'to import songs from a variety of formats. Click the next button ' self.InformationLabel.setText(
'below to start the process by selecting a format to import from.')) translate(u'SongsPlugin.SongImportWizard',
self.SourcePage.setTitle(self.trUtf8('Select Import Source')) u'This wizard will help you to import songs from a variety of '
self.SourcePage.setSubTitle(self.trUtf8('Select the import format, ' u'formats. Click the next button below to start the process by '
'and where to import from.')) u'selecting a format to import from.'))
self.FormatLabel.setText(self.trUtf8('Format:')) self.SourcePage.setTitle(
self.FormatComboBox.setItemText(0, self.trUtf8('OpenLyrics')) translate(u'SongsPlugin.SongImportWizard', u'Select Import Source'))
self.FormatComboBox.setItemText(1, self.trUtf8('OpenSong')) self.SourcePage.setSubTitle(
self.FormatComboBox.setItemText(2, self.trUtf8('CCLI')) translate(u'SongsPlugin.SongImportWizard',
self.FormatComboBox.setItemText(3, self.trUtf8('CSV')) u'Select the import format, and where to import from.'))
self.OpenLyricsAddButton.setText(self.trUtf8('Add Files...')) self.FormatLabel.setText(
self.OpenLyricsRemoveButton.setText(self.trUtf8('Remove File(s)')) translate(u'SongsPlugin.SongImportWizard', u'Format:'))
self.OpenSongAddButton.setText(self.trUtf8('Add Files...')) self.FormatComboBox.setItemText(0,
self.OpenSongRemoveButton.setText(self.trUtf8('Remove File(s)')) translate(u'SongsPlugin.SongImportWizard', u'OpenLyrics'))
self.CCLIAddButton.setText(self.trUtf8('Add Files...')) self.FormatComboBox.setItemText(1,
self.CCLIRemoveButton.setText(self.trUtf8('Remove File(s)')) translate(u'SongsPlugin.SongImportWizard', u'OpenSong'))
self.CSVFilenameLabel.setText(self.trUtf8('Filename:')) self.FormatComboBox.setItemText(2,
self.CSVBrowseButton.setText(self.trUtf8('Browse...')) translate(u'SongsPlugin.SongImportWizard', u'CCLI'))
self.ImportPage.setTitle(self.trUtf8('Importing')) self.FormatComboBox.setItemText(3,
self.ImportPage.setSubTitle(self.trUtf8('Please wait while your songs ' translate(u'SongsPlugin.SongImportWizard', u'CSV'))
'are imported.')) self.OpenLyricsAddButton.setText(
self.ImportProgressLabel.setText(self.trUtf8('Ready.')) translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
self.ImportProgressBar.setFormat(self.trUtf8('%p%')) self.OpenLyricsRemoveButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)'))
self.OpenSongAddButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
self.OpenSongRemoveButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)'))
self.CCLIAddButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
self.CCLIRemoveButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)'))
self.CSVFilenameLabel.setText(
translate(u'SongsPlugin.SongImportWizard', u'Filename:'))
self.CSVBrowseButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Browse...'))
self.ImportPage.setTitle(
translate(u'SongsPlugin.SongImportWizard', u'Importing'))
self.ImportPage.setSubTitle(
translate(u'SongsPlugin.SongImportWizard',
u'Please wait while your songs are imported.'))
self.ImportProgressLabel.setText(
translate(u'SongsPlugin.SongImportWizard', u'Ready.'))
self.ImportProgressBar.setFormat(
translate(u'SongsPlugin.SongImportWizard', u'%p%'))

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
class Ui_SongMaintenanceDialog(object): class Ui_SongMaintenanceDialog(object):
def setupUi(self, SongMaintenanceDialog): def setupUi(self, SongMaintenanceDialog):
@ -192,9 +192,11 @@ class Ui_SongMaintenanceDialog(object):
self.TypeStackedWidget.addWidget(self.BooksPage) self.TypeStackedWidget.addWidget(self.BooksPage)
self.ContentLayout.addWidget(self.TypeStackedWidget) self.ContentLayout.addWidget(self.TypeStackedWidget)
self.DialogLayout.addWidget(self.ContentWidget) self.DialogLayout.addWidget(self.ContentWidget)
self.MaintenanceButtonBox = QtGui.QDialogButtonBox(SongMaintenanceDialog) self.MaintenanceButtonBox = QtGui.QDialogButtonBox(
SongMaintenanceDialog)
self.MaintenanceButtonBox.setOrientation(QtCore.Qt.Horizontal) self.MaintenanceButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.MaintenanceButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.MaintenanceButtonBox.setStandardButtons(
QtGui.QDialogButtonBox.Close)
self.MaintenanceButtonBox.setObjectName(u'MaintenanceButtonBox') self.MaintenanceButtonBox.setObjectName(u'MaintenanceButtonBox')
self.DialogLayout.addWidget(self.MaintenanceButtonBox) self.DialogLayout.addWidget(self.MaintenanceButtonBox)
@ -208,16 +210,29 @@ class Ui_SongMaintenanceDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongMaintenanceDialog) QtCore.QMetaObject.connectSlotsByName(SongMaintenanceDialog)
def retranslateUi(self, SongMaintenanceDialog): def retranslateUi(self, SongMaintenanceDialog):
SongMaintenanceDialog.setWindowTitle(translate('SongMaintenanceForm', 'Song Maintenance')) SongMaintenanceDialog.setWindowTitle(
self.TypeListWidget.item(0).setText(translate('SongMaintenanceForm', 'Authors')) translate(u'SongsPlugin.SongMaintenanceForm', u'Song Maintenance'))
self.TypeListWidget.item(1).setText(translate('SongMaintenanceForm', 'Topics')) self.TypeListWidget.item(0).setText(
self.TypeListWidget.item(2).setText(translate('SongMaintenanceForm', 'Books/Hymnals')) translate(u'SongsPlugin.SongMaintenanceForm', u'Authors'))
self.AuthorAddButton.setText(translate('SongMaintenanceForm', 'Add')) self.TypeListWidget.item(1).setText(
self.AuthorEditButton.setText(translate('SongMaintenanceForm', 'Edit')) translate(u'SongsPlugin.SongMaintenanceForm', u'Topics'))
self.AuthorDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) self.TypeListWidget.item(2).setText(
self.TopicAddButton.setText(translate('SongMaintenanceForm', 'Add')) translate(u'SongsPlugin.SongMaintenanceForm', u'Books/Hymnals'))
self.TopicEditButton.setText(translate('SongMaintenanceForm', 'Edit')) self.AuthorAddButton.setText(
self.TopicDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.BookAddButton.setText(translate('SongMaintenanceForm', 'Add')) self.AuthorEditButton.setText(
self.BookEditButton.setText(translate('SongMaintenanceForm', 'Edit')) translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
self.BookDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) self.AuthorDeleteButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete'))
self.TopicAddButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.TopicEditButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
self.TopicDeleteButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete'))
self.BookAddButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.BookEditButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
self.BookDeleteButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete'))

View File

@ -30,6 +30,7 @@ from songmaintenancedialog import Ui_SongMaintenanceDialog
from authorsform import AuthorsForm from authorsform import AuthorsForm
from topicsform import TopicsForm from topicsform import TopicsForm
from songbookform import SongBookForm from songbookform import SongBookForm
from openlp.core.lib import translate
class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
""" """
@ -136,8 +137,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetAuthors() self.resetAuthors()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('Couldn\'t add your author.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your author.'))
def onTopicAddButtonClick(self): def onTopicAddButtonClick(self):
if self.topicform.exec_(): if self.topicform.exec_():
@ -146,8 +149,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('Couldn\'t add your topic.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your topic.'))
def onBookAddButtonClick(self): def onBookAddButtonClick(self):
if self.bookform.exec_(): if self.bookform.exec_():
@ -158,8 +163,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetBooks() self.resetBooks()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('Couldn\'t add your book.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your book.'))
def onAuthorEditButtonClick(self): def onAuthorEditButtonClick(self):
author_id = self._getCurrentItemId(self.AuthorsListWidget) author_id = self._getCurrentItemId(self.AuthorsListWidget)
@ -179,8 +186,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetAuthors() self.resetAuthors()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('Couldn\'t save your author.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your author.'))
def onTopicEditButtonClick(self): def onTopicEditButtonClick(self):
topic_id = self._getCurrentItemId(self.TopicsListWidget) topic_id = self._getCurrentItemId(self.TopicsListWidget)
@ -193,8 +202,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('Couldn\'t save your topic.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your topic.'))
def onBookEditButtonClick(self): def onBookEditButtonClick(self):
book_id = self._getCurrentItemId(self.BooksListWidget) book_id = self._getCurrentItemId(self.BooksListWidget)
@ -209,8 +220,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetBooks() self.resetBooks()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('Couldn\'t save your book.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your book.'))
def onAuthorDeleteButtonClick(self): def onAuthorDeleteButtonClick(self):
""" """
@ -219,11 +232,14 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem( self._deleteItem(
self.AuthorsListWidget, self.songmanager.get_author, self.AuthorsListWidget, self.songmanager.get_author,
self.songmanager.delete_author, self.resetAuthors, self.songmanager.delete_author, self.resetAuthors,
self.trUtf8('Delete Author'), translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Author'),
self.trUtf8('Are you sure you want to delete the selected author?'), translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('This author can\'t be deleted, they are currently ' u'Are you sure you want to delete the selected author?'),
'assigned to at least one song.'), translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('No author selected!')) u'This author can\'t be deleted, they are currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'No author selected!'))
def onTopicDeleteButtonClick(self): def onTopicDeleteButtonClick(self):
""" """
@ -232,11 +248,14 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem( self._deleteItem(
self.TopicsListWidget, self.songmanager.get_topic, self.TopicsListWidget, self.songmanager.get_topic,
self.songmanager.delete_topic, self.resetTopics, self.songmanager.delete_topic, self.resetTopics,
self.trUtf8('Delete Topic'), translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Topic'),
self.trUtf8('Are you sure you want to delete the selected topic?'), translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('This topic can\'t be deleted, it is currently ' u'Are you sure you want to delete the selected topic?'),
'assigned to at least one song.'), translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('No topic selected!')) u'This topic can\'t be deleted, it is currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'No topic selected!'))
def onBookDeleteButtonClick(self): def onBookDeleteButtonClick(self):
""" """
@ -245,8 +264,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem( self._deleteItem(
self.BooksListWidget, self.songmanager.get_book, self.BooksListWidget, self.songmanager.get_book,
self.songmanager.delete_book, self.resetBooks, self.songmanager.delete_book, self.resetBooks,
self.trUtf8('Delete Book'), translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Book'),
self.trUtf8('Are you sure you want to delete the selected book?'), translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('This book can\'t be deleted, it is currently ' u'Are you sure you want to delete the selected book?'),
'assigned to at least one song.'), translate(u'SongsPlugin.SongMaintenanceForm',
self.trUtf8('No book selected!')) u'This book can\'t be deleted, it is currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm', u'No book selected!'))

View File

@ -60,5 +60,7 @@ class Ui_TopicsDialog(object):
QtCore.QMetaObject.connectSlotsByName(TopicsDialog) QtCore.QMetaObject.connectSlotsByName(TopicsDialog)
def retranslateUi(self, TopicsDialog): def retranslateUi(self, TopicsDialog):
TopicsDialog.setWindowTitle(translate('TopicsForm', 'Topic Maintenance')) TopicsDialog.setWindowTitle(
self.NameLabel.setText(translate('TopicsForm', 'Topic name:')) translate(u'SongsPlugin.TopicsForm', u'Topic Maintenance'))
self.NameLabel.setText(
translate(u'SongsPlugin.TopicsForm', u'Topic name:'))

View File

@ -25,8 +25,10 @@
from PyQt4 import QtGui from PyQt4 import QtGui
from openlp.core.lib import translate
from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog
class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
""" """
Class documentation goes here. Class documentation goes here.
@ -47,8 +49,9 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
def accept(self): def accept(self):
if not self.NameEdit.text(): if not self.NameEdit.text():
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), self, translate(u'SongsPlugin.TopicsForm', u'Error'),
self.trUtf8('You need to type in a topic name!'), translate(u'SongsPlugin.TopicsForm',
u'You need to type in a topic name!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.NameEdit.setFocus() self.NameEdit.setFocus()
return False return False

View File

@ -96,8 +96,8 @@ class SongManager(object):
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(u'songs') settings.beginGroup(u'songs')
self.db_url = u'' self.db_url = u''
db_type = unicode( db_type = unicode(settings.value(u'songs/db type',
settings.value(u'songs/db type', QtCore.QVariant(u'sqlite')).toString()) QtCore.QVariant(u'sqlite')).toString())
if db_type == u'sqlite': if db_type == u'sqlite':
self.db_url = u'sqlite:///%s/songs.sqlite' % \ self.db_url = u'sqlite:///%s/songs.sqlite' % \
AppLocation.get_section_data_path(u'songs') AppLocation.get_section_data_path(u'songs')

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, SongXMLParser, \ from openlp.core.lib import MediaManagerItem, SongXMLParser, \
BaseListWithDnD, Receiver, ItemCapabilities BaseListWithDnD, Receiver, ItemCapabilities, translate
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
ImportWizardForm ImportWizardForm
@ -60,17 +60,18 @@ class SongMediaItem(MediaManagerItem):
self.remoteSong = -1 self.remoteSong = -1
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Song') self.PluginNameVisible = translate(u'SongsPlugin.MediaItem', u'Song')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
self.hasFileIcon = False
def addEndHeaderBar(self): def addEndHeaderBar(self):
self.addToolbarSeparator() self.addToolbarSeparator()
## Song Maintenance Button ## ## Song Maintenance Button ##
self.addToolbarButton(self.trUtf8('Song Maintenance'), self.addToolbarButton(
self.trUtf8('Maintain the lists of authors, topics and books'), translate(u'SongsPlugin.MediaItem', u'Song Maintenance'),
translate(u'SongsPlugin.MediaItem',
u'Maintain the lists of authors, topics and books'),
':/songs/song_maintenance.png', self.onSongMaintenanceClick) ':/songs/song_maintenance.png', self.onSongMaintenanceClick)
self.PageLayout.setSpacing(4) self.PageLayout.setSpacing(4)
self.SearchLayout = QtGui.QFormLayout() self.SearchLayout = QtGui.QFormLayout()
@ -139,15 +140,22 @@ class SongMediaItem(MediaManagerItem):
QtCore.QVariant(u'False')).toBool() QtCore.QVariant(u'False')).toBool()
def retranslateUi(self): def retranslateUi(self):
self.SearchTextLabel.setText(self.trUtf8('Search:')) self.SearchTextLabel.setText(
self.SearchTypeLabel.setText(self.trUtf8('Type:')) translate(u'SongsPlugin.MediaItem', u'Search:'))
self.ClearTextButton.setText(self.trUtf8('Clear')) self.SearchTypeLabel.setText(
self.SearchTextButton.setText(self.trUtf8('Search')) translate(u'SongsPlugin.MediaItem', u'Type:'))
self.ClearTextButton.setText(
translate(u'SongsPlugin.MediaItem', u'Clear'))
self.SearchTextButton.setText(
translate(u'SongsPlugin.MediaItem', u'Search'))
def initialise(self): def initialise(self):
self.SearchTypeComboBox.addItem(self.trUtf8('Titles')) self.SearchTypeComboBox.addItem(
self.SearchTypeComboBox.addItem(self.trUtf8('Lyrics')) translate(u'SongsPlugin.MediaItem', u'Titles'))
self.SearchTypeComboBox.addItem(self.trUtf8('Authors')) self.SearchTypeComboBox.addItem(
translate(u'SongsPlugin.MediaItem', u'Lyrics'))
self.SearchTypeComboBox.addItem(
translate(u'SongsPlugin.MediaItem', u'Authors'))
self.configUpdated() self.configUpdated()
def onSearchTextButtonClick(self): def onSearchTextButtonClick(self):
@ -198,7 +206,8 @@ class SongMediaItem(MediaManagerItem):
self.ListView.clear() self.ListView.clear()
for author in searchresults: for author in searchresults:
for song in author.songs: for song in author.songs:
song_detail = unicode(self.trUtf8('%s (%s)')) % \ song_detail = unicode(
translate(u'SongsPlugin.MediaItem', u'%s (%s)')) % \
(author.display_name, song.title) (author.display_name, song.title)
song_name = QtGui.QListWidgetItem(song_detail) song_name = QtGui.QListWidgetItem(song_detail)
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
@ -276,12 +285,15 @@ class SongMediaItem(MediaManagerItem):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
if items: if items:
if len(items) == 1: if len(items) == 1:
del_message = self.trUtf8('Delete song?') del_message = translate(u'SongsPlugin.MediaItem',
u'Delete song?')
else: else:
del_message = unicode( del_message = unicode(
self.trUtf8('Delete %d songs?')) % len(items) translate(u'SongsPlugin.MediaItem',
u'Delete %d songs?')) % len(items)
ans = QtGui.QMessageBox.question(self, ans = QtGui.QMessageBox.question(self,
self.trUtf8('Delete Confirmation'), del_message, translate(u'SongsPlugin.MediaItem', u'Delete Confirmation'),
del_message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok| QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok|
QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Cancel),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
@ -353,7 +365,7 @@ class SongMediaItem(MediaManagerItem):
raw_footer.append(author_list) raw_footer.append(author_list)
raw_footer.append(song.copyright ) raw_footer.append(song.copyright )
raw_footer.append(unicode( raw_footer.append(unicode(
self.trUtf8('CCLI Licence: ') + ccli)) translate(u'SongsPlugin.MediaItem', u'CCLI Licence: ') + ccli))
service_item.raw_footer = raw_footer service_item.raw_footer = raw_footer
service_item.audit = [ service_item.audit = [
song.title, author_audit, song.copyright, song.ccli_number song.title, author_audit, song.copyright, song.ccli_number

View File

@ -97,7 +97,7 @@ class OooImport(object):
loop += 1 loop += 1
manager = ctx.ServiceManager manager = ctx.ServiceManager
self.desktop = manager.createInstanceWithContext( self.desktop = manager.createInstanceWithContext(
"com.sun.star.frame.Desktop", ctx ) "com.sun.star.frame.Desktop", ctx)
def start_ooo_process(self): def start_ooo_process(self):
try: try:
@ -130,10 +130,9 @@ class OooImport(object):
try: try:
self.document = self.desktop.loadComponentFromURL(url, u'_blank', self.document = self.desktop.loadComponentFromURL(url, u'_blank',
0, properties) 0, properties)
if not self.document.supportsService( if not self.document.supportsService(
"com.sun.star.presentation.PresentationDocument") \ "com.sun.star.presentation.PresentationDocument") and not \
and not self.document.supportsService( self.document.supportsService("com.sun.star.text.TextDocument"):
"com.sun.star.text.TextDocument"):
self.close_ooo_file() self.close_ooo_file()
except: except:
pass pass

View File

@ -64,9 +64,9 @@ class SongImport(object):
self.versecount = 0 self.versecount = 0
self.choruscount = 0 self.choruscount = 0
self.copyright_string = unicode(QtGui.QApplication.translate( \ self.copyright_string = unicode(QtGui.QApplication.translate( \
u'SongImport', u'copyright')) u'SongsPlugin.SongImport', u'copyright'))
self.copyright_symbol = unicode(QtGui.QApplication.translate( \ self.copyright_symbol = unicode(QtGui.QApplication.translate( \
u'SongImport', u'©')) u'SongsPlugin.SongImport', u'©'))
@staticmethod @staticmethod
def process_songs_text(manager, text): def process_songs_text(manager, text):

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab, translate
class SongsTab(SettingsTab): class SongsTab(SettingsTab):
""" """
@ -36,7 +36,7 @@ class SongsTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'SongsTab') self.setObjectName(u'SongsTab')
self.tabTitleVisible = self.trUtf8('Songs') self.tabTitleVisible = translate(u'SongsPlugin.SongsTab', u'Songs')
self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout = QtGui.QFormLayout(self)
self.SongsLayout.setObjectName(u'SongsLayout') self.SongsLayout.setObjectName(u'SongsLayout')
self.SongsModeGroupBox = QtGui.QGroupBox(self) self.SongsModeGroupBox = QtGui.QGroupBox(self)
@ -61,11 +61,12 @@ class SongsTab(SettingsTab):
self.SongBarActiveCheckBoxChanged) self.SongBarActiveCheckBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.SongsModeGroupBox.setTitle(self.trUtf8('Songs Mode')) self.SongsModeGroupBox.setTitle(
translate(u'SongsPlugin.SongsTab', u'Songs Mode'))
self.SearchAsTypeCheckBox.setText( self.SearchAsTypeCheckBox.setText(
self.trUtf8('Enable search as you type')) translate(u'SongsPlugin.SongsTab', u'Enable search as you type'))
self.SongBarActiveCheckBox.setText( self.SongBarActiveCheckBox.setText(translate(u'SongsPlugin.SongsTab',
self.trUtf8('Display Verses on Live Tool bar')) u'Display Verses on Live Tool bar'))
def onSearchAsTypeCheckBoxChanged(self, check_state): def onSearchAsTypeCheckBoxChanged(self, check_state):
self.song_search = False self.song_search = False

View File

@ -27,7 +27,8 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \
translate
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \ from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \
SofImport, OooImport SofImport, OooImport
@ -150,7 +151,8 @@ class SongsPlugin(Plugin):
def onImportSofItemClick(self): def onImportSofItemClick(self):
filenames = QtGui.QFileDialog.getOpenFileNames( filenames = QtGui.QFileDialog.getOpenFileNames(
None, self.trUtf8('Open Songs of Fellowship file'), None, translate(u'SongsPlugin.Songsplugin',
u'Open Songs of Fellowship file'),
u'', u'Songs of Fellowship file (*.rtf *.RTF)') u'', u'Songs of Fellowship file (*.rtf *.RTF)')
try: try:
for filename in filenames: for filename in filenames:
@ -170,15 +172,17 @@ class SongsPlugin(Plugin):
def onImportOooItemClick(self): def onImportOooItemClick(self):
filenames = QtGui.QFileDialog.getOpenFileNames( filenames = QtGui.QFileDialog.getOpenFileNames(
None, self.trUtf8('Open documents or presentations'), None, translate(u'SongsPlugin.Songsplugin',
u'Open documents or presentations'),
u'', u'All Files(*.*)') u'', u'All Files(*.*)')
oooimport = OooImport(self.manager) oooimport = OooImport(self.manager)
oooimport.import_docs(filenames) oooimport.import_docs(filenames)
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')
def about(self): def about(self):
about_text = self.trUtf8('<strong>Song Plugin</strong><br />' about_text = translate(u'SongsPlugin.Songsplugin',
'This plugin allows songs to be managed and displayed.') u'<strong>Song Plugin</strong><br />'
u'This plugin allows songs to be managed and displayed.')
return about_text return about_text
def can_delete_theme(self, theme): def can_delete_theme(self, theme):

View File

@ -58,4 +58,5 @@ class Ui_SongUsageDeleteDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongUsageDeleteDialog) QtCore.QMetaObject.connectSlotsByName(SongUsageDeleteDialog)
def retranslateUi(self, SongUsageDeleteDialog): def retranslateUi(self, SongUsageDeleteDialog):
SongUsageDeleteDialog.setWindowTitle(translate('AuditDeleteDialog', 'Song Usage Delete')) SongUsageDeleteDialog.setWindowTitle(
translate(u'SongsPlugin.AuditDeleteDialog', u'Song Usage Delete'))

View File

@ -26,6 +26,7 @@
from PyQt4 import QtGui from PyQt4 import QtGui
from songusagedeletedialog import Ui_SongUsageDeleteDialog from songusagedeletedialog import Ui_SongUsageDeleteDialog
from openlp.core.lib import translate
class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog): class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
""" """
@ -41,8 +42,10 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
def accept(self): def accept(self):
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
self.trUtf8('Delete Selected Song Usage Events?'), translate(u'SongsPlugin.SongUsageDeleteForm',
self.trUtf8('Are you sure you want to delete selected Song Usage data?'), u'Delete Selected Song Usage Events?'),
translate(u'SongsPlugin.SongUsageDeleteForm',
u'Are you sure you want to delete selected Song Usage data?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok | QtGui.QMessageBox.Ok |
QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Cancel),
@ -51,3 +54,4 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
deleteDate = self.DeleteCalendar.selectedDate().toPyDate() deleteDate = self.DeleteCalendar.selectedDate().toPyDate()
self.songusagemanager.delete_to_date(deleteDate) self.songusagemanager.delete_to_date(deleteDate)
self.close() self.close()

View File

@ -70,24 +70,28 @@ class Ui_SongUsageDetailDialog(object):
self.verticalLayout_2.addWidget(self.FileGroupBox) self.verticalLayout_2.addWidget(self.FileGroupBox)
self.verticalLayout.addWidget(self.DateRangeGroupBox) self.verticalLayout.addWidget(self.DateRangeGroupBox)
self.buttonBox = QtGui.QDialogButtonBox(SongUsageDetailDialog) self.buttonBox = QtGui.QDialogButtonBox(SongUsageDetailDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(u'buttonBox') self.buttonBox.setObjectName(u'buttonBox')
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(SongUsageDetailDialog) self.retranslateUi(SongUsageDetailDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
QtCore.SIGNAL(u'accepted()'), SongUsageDetailDialog.accept)
SongUsageDetailDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
QtCore.QObject.connect(self.buttonBox, SongUsageDetailDialog.close)
QtCore.SIGNAL(u'rejected()'),
SongUsageDetailDialog.close)
QtCore.QObject.connect(self.SaveFilePushButton, QtCore.QObject.connect(self.SaveFilePushButton,
QtCore.SIGNAL(u'pressed()'), QtCore.SIGNAL(u'pressed()'),
SongUsageDetailDialog.defineOutputLocation) SongUsageDetailDialog.defineOutputLocation)
QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog) QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog)
def retranslateUi(self, SongUsageDetailDialog): def retranslateUi(self, SongUsageDetailDialog):
SongUsageDetailDialog.setWindowTitle(translate('AuditDetailDialog', 'Song Usage Extraction')) SongUsageDetailDialog.setWindowTitle(
self.DateRangeGroupBox.setTitle(translate('AuditDetailDialog', 'Select Date Range')) translate(u'SongsPlugin.AuditDetailDialog',
self.ToLabel.setText(translate('AuditDetailDialog', 'to')) u'Song Usage Extraction'))
self.FileGroupBox.setTitle(translate('AuditDetailDialog', 'Report Location')) self.DateRangeGroupBox.setTitle(
translate(u'SongsPlugin.AuditDetailDialog', u'Select Date Range'))
self.ToLabel.setText(
translate(u'SongsPlugin.AuditDetailDialog', u'to'))
self.FileGroupBox.setTitle(
translate(u'SongsPlugin.AuditDetailDialog', u'Report Location'))

View File

@ -28,7 +28,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsManager from openlp.core.lib import SettingsManager, translate
from songusagedetaildialog import Ui_SongUsageDetailDialog from songusagedetaildialog import Ui_SongUsageDetailDialog
@ -61,7 +61,8 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
def defineOutputLocation(self): def defineOutputLocation(self):
path = QtGui.QFileDialog.getExistingDirectory(self, path = QtGui.QFileDialog.getExistingDirectory(self,
self.trUtf8('Output File Location'), translate(u'SongsPlugin.SongUsageDetailForm',
u'Output File Location'),
SettingsManager.get_last_dir(self.parent.settingsSection, 1)) SettingsManager.get_last_dir(self.parent.settingsSection, 1))
path = unicode(path) path = unicode(path)
if path != u'': if path != u'':

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, Receiver, build_icon from openlp.core.lib import Plugin, Receiver, build_icon, translate
from openlp.plugins.songusage.lib import SongUsageManager from openlp.plugins.songusage.lib import SongUsageManager
from openlp.plugins.songusage.forms import SongUsageDetailForm, \ from openlp.plugins.songusage.forms import SongUsageDetailForm, \
SongUsageDeleteForm SongUsageDeleteForm
@ -156,7 +156,8 @@ class SongUsagePlugin(Plugin):
self.SongUsagedetailform.exec_() self.SongUsagedetailform.exec_()
def about(self): def about(self):
about_text = self.trUtf8('<b>SongUsage Plugin</b><br>This plugin ' about_text = translate(u'SongsPlugin.SongUsagePlugin',
'records the use of songs and when they have been used during ' u'<b>SongUsage Plugin</b><br>This plugin '
'a live service') u'records the use of songs and when they have been used during '
u'a live service')
return about_text return about_text