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:
if self.icons[title]:
return self.icons[title]
except NameError:
except KeyError:
log.exception(u'getIconFromTitle - no icon for %s' % title)
return QtGui.QIcon()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver
from openlp.core.lib import SettingsTab, Receiver, translate
class GeneralTab(SettingsTab):
"""
@ -54,7 +54,7 @@ class GeneralTab(SettingsTab):
def setupUi(self):
self.setObjectName(u'GeneralTab')
self.tabTitleVisible = self.trUtf8('General')
self.tabTitleVisible = translate(u'GeneralTab', u'General')
self.GeneralLayout = QtGui.QHBoxLayout(self)
self.GeneralLayout.setSpacing(8)
self.GeneralLayout.setMargin(8)
@ -177,25 +177,32 @@ class GeneralTab(SettingsTab):
QtCore.SIGNAL(u'editingFinished()'), self.onPasswordEditLostFocus)
def retranslateUi(self):
self.MonitorGroupBox.setTitle(self.trUtf8('Monitors'))
self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
self.MonitorLabel.setText(
self.trUtf8('Select monitor for output display:'))
translate(u'GeneralTab', u'Select monitor for output display:'))
self.DisplayOnMonitorCheck.setText(
self.trUtf8('Display if a single screen'))
self.StartupGroupBox.setTitle(self.trUtf8('Application Startup'))
self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning'))
translate(u'GeneralTab', u'Display if a single screen'))
self.StartupGroupBox.setTitle(
translate(u'GeneralTab', u'Application Startup'))
self.WarningCheckBox.setText(
translate(u'GeneralTab', u'Show blank screen warning'))
self.AutoOpenCheckBox.setText(
self.trUtf8('Automatically open the last service'))
self.ShowSplashCheckBox.setText(self.trUtf8('Show the splash screen'))
self.SettingsGroupBox.setTitle(self.trUtf8('Application Settings'))
translate(u'GeneralTab', u'Automatically open the last service'))
self.ShowSplashCheckBox.setText(
translate(u'GeneralTab', u'Show the splash screen'))
self.SettingsGroupBox.setTitle(
translate(u'GeneralTab', u'Application Settings'))
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.trUtf8('Preview Next Song from Service Manager'))
self.CCLIGroupBox.setTitle(self.trUtf8('CCLI Details'))
self.NumberLabel.setText(self.trUtf8('CCLI Number:'))
self.UsernameLabel.setText(self.trUtf8('SongSelect Username:'))
self.PasswordLabel.setText(self.trUtf8('SongSelect Password:'))
translate(u'GeneralTab', u'Preview Next Song from Service Manager'))
self.CCLIGroupBox.setTitle(translate(u'GeneralTab', u'CCLI Details'))
self.NumberLabel.setText(translate(u'GeneralTab', u'CCLI Number:'))
self.UsernameLabel.setText(
translate(u'GeneralTab', u'SongSelect Username:'))
self.PasswordLabel.setText(
translate(u'GeneralTab', u'SongSelect Password:'))
def onMonitorComboBoxChanged(self):
self.MonitorNumber = self.MonitorComboBox.currentIndex()
@ -231,10 +238,11 @@ class GeneralTab(SettingsTab):
settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection)
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)
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)
# Get the configs
self.Warning = settings.value(

View File

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

View File

@ -99,13 +99,15 @@ class Ui_PluginViewDialog(object):
QtCore.QMetaObject.connectSlotsByName(PluginViewDialog)
def retranslateUi(self, PluginViewDialog):
PluginViewDialog.setWindowTitle(translate('PluginForm', 'Plugin List'))
PluginViewDialog.setWindowTitle(
translate(u'PluginForm', u'Plugin List'))
self.PluginInfoGroupBox.setTitle(
translate('PluginForm', 'Plugin Details'))
self.VersionLabel.setText(translate('PluginForm', 'Version:'))
self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel'))
self.AboutLabel.setText(translate('PluginForm', 'About:'))
self.StatusLabel.setText(translate('PluginForm', 'Status:'))
self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active'))
self.StatusComboBox.setItemText(1, translate('PluginForm', 'Inactive'))
translate(u'PluginForm', u'Plugin Details'))
self.VersionLabel.setText(
translate(u'PluginForm', u'Version:'))
self.VersionNumberLabel.setText(translate(u'PluginForm', u'TextLabel'))
self.AboutLabel.setText(translate(u'PluginForm', u'About:'))
self.StatusLabel.setText(translate(u'PluginForm', u'Status:'))
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):
ServiceItemEditDialog.setWindowTitle(
translate('ServiceItemEditForm', 'Service Item Maintenance'))
self.upButton.setText(translate('ServiceItemEditForm', 'Up'))
self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete'))
self.downButton.setText(translate('ServiceItemEditForm', 'Down'))
translate(u'ServiceItemEditForm', u'Service Item Maintenance'))
self.upButton.setText(translate(u'ServiceItemEditForm', u'Up'))
self.deleteButton.setText(translate(u'ServiceItemEditForm', u'Delete'))
self.downButton.setText(translate(u'ServiceItemEditForm', u'Down'))

View File

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

View File

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

View File

@ -49,5 +49,4 @@ class Ui_ServiceNoteEdit(object):
def retranslateUi(self, ServiceNoteEdit):
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 servicenotedialog import Ui_ServiceNoteEdit
class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit):
@ -36,9 +37,7 @@ class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit):
"""
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'accepted()'),
self.accept)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'rejected()'),
self.reject)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
self.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
self.reject)

View File

@ -60,4 +60,4 @@ class Ui_SettingsDialog(object):
QtCore.QMetaObject.connectSlotsByName(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.lib import OpenLPToolbar, Receiver, resize_image, \
ItemCapabilities
ItemCapabilities, translate
log = logging.getLogger(__name__)
@ -127,11 +127,11 @@ class SlideController(QtGui.QWidget):
# Type label for the top of the slide controller
self.TypeLabel = QtGui.QLabel(self.Panel)
if self.isLive:
self.TypeLabel.setText(self.trUtf8('Live'))
self.TypeLabel.setText(translate(u'SlideController', u'Live'))
self.split = 1
self.typePrefix = u'live'
else:
self.TypeLabel.setText(self.trUtf8('Preview'))
self.TypeLabel.setText(translate(u'SlideController', u'Preview'))
self.split = 0
self.typePrefix = u'preview'
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
@ -178,75 +178,92 @@ class SlideController(QtGui.QWidget):
if self.isLive:
self.Toolbar.addToolbarButton(
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(
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(
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:
self.Toolbar.addToolbarButton(
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:
self.Toolbar.addToolbarSeparator(u'Close Separator')
self.blankButton = self.Toolbar.addToolbarButton(
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(
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(
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:
self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton(
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.addToolbarButton(
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:
self.Toolbar.addToolbarSeparator(u'Loop Separator')
self.Toolbar.addToolbarButton(
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(
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.setMinimum(1)
self.DelaySpinBox.setMaximum(180)
self.Toolbar.addToolbarWidget(
u'Image SpinBox', self.DelaySpinBox)
self.DelaySpinBox.setSuffix(self.trUtf8('s'))
self.DelaySpinBox.setSuffix(translate(u'SlideController', u's'))
self.DelaySpinBox.setToolTip(
self.trUtf8('Delay between slides in seconds'))
translate(u'SlideController',
u'Delay between slides in seconds'))
self.ControllerLayout.addWidget(self.Toolbar)
#Build a Media ToolBar
self.Mediabar = OpenLPToolbar(self)
self.Mediabar.addToolbarButton(
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(
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(
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:
self.blankButton = self.Mediabar.addToolbarButton(
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(
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(
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:
self.seekSlider = Phonon.SeekSlider()
self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
@ -262,11 +279,11 @@ class SlideController(QtGui.QWidget):
# Build the Song Toolbar
if isLive:
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.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
self.SongMenu.setMenu(QtGui.QMenu(self.trUtf8('Go to Verse'),
self.Toolbar))
self.SongMenu.setMenu(QtGui.QMenu(
translate(u'SlideController', u'Go to Verse'), self.Toolbar))
self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
# Screen preview area
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 tag1 not in self.slideList:
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)
item.setText(frame[u'text'])
else:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver
from openlp.core.lib import Receiver, translate
log = logging.getLogger(__name__)
@ -93,7 +93,8 @@ class AlertsManager(QtCore.QObject):
self.alertList.append(text)
if self.timer_id != 0:
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
Receiver.send_message(u'maindisplay_status_text', u'')
self.generateAlert()

View File

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

View File

@ -27,7 +27,7 @@ import logging
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
log = logging.getLogger(__name__)
@ -88,9 +88,10 @@ class BiblePlugin(Plugin):
self.media_item.onImportClick()
def about(self):
about_text = self.trUtf8('<strong>Bible Plugin</strong><br />This '
'plugin allows bible verses from different sources to be '
'displayed on the screen during the service.')
about_text = translate(u'BiblesPlugin.BiblePlugin',
u'<strong>Bible Plugin</strong><br />This '
u'plugin allows bible verses from different sources to be '
u'displayed on the screen during the service.')
return about_text
def can_delete_theme(self, theme):

View File

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

View File

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

View File

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

View File

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

View File

@ -26,7 +26,7 @@
import logging
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
log = logging.getLogger(__name__)
@ -67,10 +67,11 @@ class CustomPlugin(Plugin):
self.remove_toolbox_item()
def about(self):
about_text = self.trUtf8('<b>Custom Plugin</b><br>This plugin '
'allows slides to be displayed on the screen in the same way '
'songs are. This plugin provides greater freedom over the '
'songs plugin.<br>')
about_text = translate(u'CustomPlugin.CustomPlugin',
u'<b>Custom Plugin</b><br>This plugin '
u'allows slides to be displayed on the screen in the same way '
u'songs are. This plugin provides greater freedom over the '
u'songs plugin.<br>')
return about_text
def can_delete_theme(self, theme):

View File

@ -24,6 +24,7 @@
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
class Ui_customEditDialog(object):
@ -106,8 +107,8 @@ class Ui_customEditDialog(object):
self.SplitButton = QtGui.QPushButton(self.ButtonWidge)
self.SplitButton.setObjectName(u'SplitButton')
self.verticalLayout_2.addWidget(self.SplitButton)
spacerItem1 = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem1)
self.EditLayout_3.addWidget(self.ButtonWidge)
self.gridLayout.addWidget(self.EditWidget, 2, 0, 1, 1)
@ -130,7 +131,8 @@ class Ui_customEditDialog(object):
self.horizontalLayout_2.addWidget(self.CreditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
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.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1)
@ -153,23 +155,44 @@ class Ui_customEditDialog(object):
customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox)
def retranslateUi(self, customEditDialog):
customEditDialog.setWindowTitle(translate('EditCustomForm', 'Edit Custom Slides'))
self.UpButton.setToolTip(translate('EditCustomForm', 'Move slide Up 1'))
self.DownButton.setToolTip(translate('EditCustomForm', 'Move slide down 1'))
self.TitleLabel.setText(translate('EditCustomForm', 'Title:'))
self.AddButton.setText(translate('EditCustomForm', 'Add New'))
self.AddButton.setToolTip(translate('EditCustomForm', 'Add new slide at bottom'))
self.EditButton.setText(translate('EditCustomForm', 'Edit'))
self.EditButton.setToolTip(translate('EditCustomForm', 'Edit selected slide'))
self.EditAllButton.setText(translate('EditCustomForm', 'Edit All'))
self.EditAllButton.setToolTip(translate('EditCustomForm', 'Edit all slides'))
self.SaveButton.setText(translate('EditCustomForm', 'Save'))
self.SaveButton.setToolTip(translate('EditCustomForm', 'Replace edited slide'))
self.DeleteButton.setText(translate('EditCustomForm', 'Delete'))
self.DeleteButton.setToolTip(translate('EditCustomForm', 'Delete selected slide'))
self.ClearButton.setText(translate('EditCustomForm', 'Clear'))
self.ClearButton.setToolTip(translate('EditCustomForm', 'Clear edit area'))
self.SplitButton.setText(translate('EditCustomForm', 'Split Slide'))
self.SplitButton.setToolTip(translate('EditCustomForm', 'Add slide split'))
self.ThemeLabel.setText(translate('EditCustomForm', 'Theme:'))
self.CreditLabel.setText(translate('EditCustomForm', 'Credits:'))
customEditDialog.setWindowTitle(
translate(u'CustomPlugin.EditCustomForm', u'Edit Custom Slides'))
self.UpButton.setToolTip(translate(u'CustomPlugin.EditCustomForm'
u'CustomPlugin.EditCustomForm', u'Move slide Up 1'))
self.DownButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1'))
self.TitleLabel.setText(
translate(u'CustomPlugin.EditCustomForm', u'Title:'))
self.AddButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Add New'))
self.AddButton.setToolTip(translate(u'CustomPlugin.EditCustomForm',
u'Add new slide at bottom'))
self.EditButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Edit'))
self.EditButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Edit selected slide'))
self.EditAllButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Edit All'))
self.EditAllButton.setToolTip(
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 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
log = logging.getLogger(__name__)
@ -47,7 +47,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
self.setupUi(self)
# Connecting signals and slots
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.previewButton, QtGui.QDialogButtonBox.ActionRole)
QtCore.QObject.connect(self.buttonBox,
@ -84,7 +85,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def onPreview(self, button):
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():
Receiver.send_message(u'custom_preview')
@ -147,7 +149,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def saveCustom(self):
valid, message = self._validate()
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))
return False
sxml = SongXMLBuilder()
@ -160,8 +163,10 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
count += 1
self.customSlide.title = unicode(self.TitleEdit.displayText(), 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.theme_name = unicode(self.ThemeComboBox.currentText(), u'utf-8')
self.customSlide.credits = unicode(self.CreditEdit.displayText(),
u'utf-8')
self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(),
u'utf-8')
self.custommanager.save_slide(self.customSlide)
return True
@ -227,7 +232,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def onSaveButtonPressed(self):
if self.editAll:
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)
else:
self.VerseListView.currentItem().setText(
@ -263,12 +269,15 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def _validate(self):
if len(self.TitleEdit.displayText()) == 0:
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
if self.VerseListView.count() == 0:
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():
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''

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,10 +25,11 @@
import logging
from openlp.core.lib import Plugin, build_icon, PluginStatus
from openlp.plugins.media.lib import MediaMediaItem
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__)
class MediaPlugin(Plugin):
@ -46,13 +47,17 @@ class MediaPlugin(Plugin):
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype)
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/')
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-')
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/')
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):
if len(value) == 2:
@ -76,6 +81,8 @@ class MediaPlugin(Plugin):
return MediaMediaItem(self, self.icon, self.name)
def about(self):
about_text = self.trUtf8('<b>Media Plugin</b><br>This plugin '
'allows the playing of audio and video media')
about_text = translate(u'MediaPlugin.MediaPlugin',
u'<b>Media Plugin</b><br>This plugin '
u'allows the playing of audio and video media')
return about_text

View File

@ -106,20 +106,23 @@ class ImpressController(PresentationController):
loop = 0
log.debug(u'get UNO Desktop Openoffice - 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(
u'com.sun.star.bridge.UnoUrlResolver', context)
while ctx is None and loop < 3:
try:
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:
log.exception(u'Unable to find running instance ')
self.start_process()
loop += 1
try:
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(
"com.sun.star.frame.Desktop", ctx )
return desktop
@ -201,7 +204,8 @@ class ImpressDocument(PresentationDocument):
if desktop is None:
self.controller.start_process()
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:
desktop = self.controller.get_uno_desktop()
url = uno.systemPathToFileUrl(self.filepath)
@ -219,7 +223,8 @@ class ImpressDocument(PresentationDocument):
log.exception(u'Failed to load presentation')
return
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.create_thumbnails()
@ -332,12 +337,14 @@ class ImpressDocument(PresentationDocument):
log.debug(u'start presentation OpenOffice')
if self.control is None or not self.control.isRunning():
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
while self.desktop.getCurrentComponent() is None and i < 50:
time.sleep(0.1)
i = i + 1
self.control = self.desktop.getCurrentComponent().Presentation.getController()
self.control = \
self.desktop.getCurrentComponent().Presentation.getController()
else:
self.control.activate()
self.goto_slide(1)
@ -383,7 +390,7 @@ class ImpressDocument(PresentationDocument):
Returns the text on the slide
``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
pages = doc.getDrawPages()
@ -412,3 +419,4 @@ class ImpressDocument(PresentationDocument):
if shape.supportsService("com.sun.star.drawing.Text"):
text += shape.getString() + '\n'
return text

View File

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

View File

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

View File

@ -125,7 +125,8 @@ class PptviewDocument(PresentationDocument):
filepath = str(self.filepath.replace(u'/', u'\\'))
try:
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()
except:
log.exception(u'Failed to load presentation')
@ -233,3 +234,4 @@ class PptviewDocument(PresentationDocument):
return path
else:
return None

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -75,8 +75,10 @@ class Ui_AuthorsDialog(object):
def retranslateUi(self, AuthorsDialog):
AuthorsDialog.setWindowTitle(
translate('AuthorsForm', 'Author Maintenance'))
self.DisplayLabel.setText(translate('AuthorsForm', 'Display name:'))
self.FirstNameLabel.setText(translate('AuthorsForm', 'First name:'))
self.LastNameLabel.setText(translate('AuthorsForm', 'Last name:'))
translate(u'SongsPlugin.AuthorsForm', u'Author Maintenance'))
self.DisplayLabel.setText(
translate(u'SongsPlugin.AuthorsForm', u'Display 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 openlp.core.lib import translate
from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog
class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
"""
Class to control the Maintenance of Authors Dialog
@ -77,21 +79,28 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
def accept(self):
if not self.FirstNameEdit.text():
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), self.trUtf8(
'You need to type in the first name of the author.'))
QtGui.QMessageBox.critical(
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()
return False
elif not self.LastNameEdit.text():
QtGui.QMessageBox.critical(self, self.trUtf8('Error'),
self.trUtf8('You need to type in the last name of the author.'))
QtGui.QMessageBox.critical(
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()
return False
elif not self.DisplayEdit.text():
if QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('You haven\'t set a display name for the '
'author, would you like me to combine the first and '
'last names for you?'),
self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
translate(u'SongsPlugin.AuthorsForm',
u'You haven\'t set a display name for the '
u'author, would you like me to combine the first and '
u'last names for you?'),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
) == QtGui.QMessageBox.Yes:

View File

@ -116,7 +116,8 @@ class Ui_EditSongDialog(object):
self.AuthorsTabLayout.setObjectName(u'AuthorsTabLayout')
self.AuthorsMaintenanceWidget = QtGui.QWidget(self.AuthorsTab)
self.AuthorsMaintenanceWidget.setObjectName(u'AuthorsMaintenanceWidget')
self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(self.AuthorsMaintenanceWidget)
self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(
self.AuthorsMaintenanceWidget)
self.AuthorsMaintenanceLayout.setSpacing(8)
self.AuthorsMaintenanceLayout.setMargin(0)
self.AuthorsMaintenanceLayout.setObjectName(u'AuthorsMaintenanceLayout')
@ -146,7 +147,8 @@ class Ui_EditSongDialog(object):
self.AuthorsSelectionComboItem.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength)
self.AuthorsSelectionComboItem.setMinimumContentsLength(8)
self.AuthorsSelectionComboItem.setObjectName(u'AuthorsSelectionComboItem')
self.AuthorsSelectionComboItem.setObjectName(
u'AuthorsSelectionComboItem')
self.AuthorAddLayout.addWidget(self.AuthorsSelectionComboItem)
self.AuthorAddButton = QtGui.QPushButton(self.AuthorAddWidget)
self.AuthorAddButton.setMaximumSize(QtCore.QSize(110, 16777215))
@ -261,7 +263,8 @@ class Ui_EditSongDialog(object):
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongbookCombo.sizePolicy().hasHeightForWidth())
sizePolicy.setHeightForWidth(
self.SongbookCombo.sizePolicy().hasHeightForWidth())
self.SongbookCombo.setEditable(True)
self.SongbookCombo.setSizePolicy(sizePolicy)
self.SongbookCombo.setObjectName(u'SongbookCombo')
@ -277,7 +280,8 @@ class Ui_EditSongDialog(object):
self.ThemeTabLayout.setObjectName(u'ThemeTabLayout')
self.ThemeCopyCommentsWidget = QtGui.QWidget(self.ThemeTab)
self.ThemeCopyCommentsWidget.setObjectName(u'ThemeCopyCommentsWidget')
self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(self.ThemeCopyCommentsWidget)
self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(
self.ThemeCopyCommentsWidget)
self.ThemeCopyCommentsLayout.setSpacing(8)
self.ThemeCopyCommentsLayout.setMargin(0)
self.ThemeCopyCommentsLayout.setObjectName(u'ThemeCopyCommentsLayout')
@ -286,7 +290,8 @@ class Ui_EditSongDialog(object):
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.TextWidget.sizePolicy().hasHeightForWidth())
sizePolicy.setHeightForWidth(
self.TextWidget.sizePolicy().hasHeightForWidth())
self.TextWidget.setSizePolicy(sizePolicy)
self.TextWidget.setObjectName(u'TextWidget')
self.DetailsLayout = QtGui.QVBoxLayout(self.TextWidget)
@ -401,58 +406,91 @@ class Ui_EditSongDialog(object):
EditSongDialog.setTabOrder(self.AlternativeEdit, self.VerseListWidget)
EditSongDialog.setTabOrder(self.VerseListWidget, self.VerseAddButton)
EditSongDialog.setTabOrder(self.VerseAddButton, self.VerseEditButton)
EditSongDialog.setTabOrder(self.VerseEditButton, self.VerseEditAllButton)
EditSongDialog.setTabOrder(self.VerseEditAllButton, self.VerseDeleteButton)
EditSongDialog.setTabOrder(self.VerseEditButton,
self.VerseEditAllButton)
EditSongDialog.setTabOrder(self.VerseEditAllButton,
self.VerseDeleteButton)
EditSongDialog.setTabOrder(self.VerseDeleteButton, self.VerseOrderEdit)
EditSongDialog.setTabOrder(self.VerseOrderEdit, self.AuthorsSelectionComboItem)
EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem, self.AuthorAddButton)
EditSongDialog.setTabOrder(self.VerseOrderEdit,
self.AuthorsSelectionComboItem)
EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem,
self.AuthorAddButton)
EditSongDialog.setTabOrder(self.AuthorAddButton, self.AuthorsListView)
EditSongDialog.setTabOrder(self.AuthorsListView, self.AuthorRemoveButton)
EditSongDialog.setTabOrder(self.AuthorRemoveButton, self.MaintenanceButton)
EditSongDialog.setTabOrder(self.AuthorsListView,
self.AuthorRemoveButton)
EditSongDialog.setTabOrder(self.AuthorRemoveButton,
self.MaintenanceButton)
EditSongDialog.setTabOrder(self.MaintenanceButton, self.SongTopicCombo)
EditSongDialog.setTabOrder(self.SongTopicCombo, self.TopicAddButton)
EditSongDialog.setTabOrder(self.TopicAddButton, self.TopicsListView)
EditSongDialog.setTabOrder(self.TopicsListView, self.TopicRemoveButton)
EditSongDialog.setTabOrder(self.TopicRemoveButton, self.SongbookCombo)
EditSongDialog.setTabOrder(self.SongbookCombo, self.ThemeSelectionComboItem)
EditSongDialog.setTabOrder(self.ThemeSelectionComboItem, self.ThemeAddButton)
EditSongDialog.setTabOrder(self.SongbookCombo,
self.ThemeSelectionComboItem)
EditSongDialog.setTabOrder(self.ThemeSelectionComboItem,
self.ThemeAddButton)
EditSongDialog.setTabOrder(self.ThemeAddButton, self.CopyrightEditItem)
EditSongDialog.setTabOrder(self.CopyrightEditItem, self.CopyrightInsertButton)
EditSongDialog.setTabOrder(self.CopyrightInsertButton, self.CCLNumberEdit)
EditSongDialog.setTabOrder(self.CopyrightEditItem,
self.CopyrightInsertButton)
EditSongDialog.setTabOrder(self.CopyrightInsertButton,
self.CCLNumberEdit)
EditSongDialog.setTabOrder(self.CCLNumberEdit, self.CommentsEdit)
EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox)
def retranslateUi(self, EditSongDialog):
EditSongDialog.setWindowTitle(translate('EditSongForm', 'Song Editor'))
self.TitleLabel.setText(translate('EditSongForm', 'Title:'))
self.AlternativeTitleLabel.setText(translate('EditSongForm', 'Alternative Title:'))
self.LyricsLabel.setText(translate('EditSongForm', 'Lyrics:'))
self.VerseOrderLabel.setText(translate('EditSongForm', 'Verse Order:'))
self.VerseAddButton.setText(translate('EditSongForm', 'Add'))
self.VerseEditButton.setText(translate('EditSongForm', 'Edit'))
self.VerseEditAllButton.setText(translate('EditSongForm', 'Edit All'))
self.VerseDeleteButton.setText(translate('EditSongForm', 'Delete'))
EditSongDialog.setWindowTitle(
translate(u'SongsPlugin.EditSongForm', u'Song Editor'))
self.TitleLabel.setText(
translate(u'SongsPlugin.EditSongForm', u'Title:'))
self.AlternativeTitleLabel.setText(
translate(u'SongsPlugin.EditSongForm', u'Alternative Title:'))
self.LyricsLabel.setText(
translate(u'SongsPlugin.EditSongForm', u'Lyrics:'))
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.indexOf(self.LyricsTab),
translate('EditSongForm', 'Title && Lyrics'))
self.AuthorsGroupBox.setTitle(translate('EditSongForm', 'Authors'))
self.AuthorAddButton.setText(translate('EditSongForm', '&Add to Song'))
self.AuthorRemoveButton.setText(translate('EditSongForm', '&Remove'))
self.MaintenanceButton.setText(
translate('EditSongForm', '&Manage Authors, Topics, Books'))
self.TopicGroupBox.setTitle(translate('EditSongForm', 'Topic'))
self.TopicAddButton.setText(translate('EditSongForm', 'A&dd to Song'))
self.TopicRemoveButton.setText(translate('EditSongForm', 'R&emove'))
self.SongBookGroup.setTitle(translate('EditSongForm', 'Song Book'))
translate(u'SongsPlugin.EditSongForm', u'Title && Lyrics'))
self.AuthorsGroupBox.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Authors'))
self.AuthorAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'&Add to Song'))
self.AuthorRemoveButton.setText(
translate(u'SongsPlugin.EditSongForm', u'&Remove'))
self.MaintenanceButton.setText(translate(u'SongsPlugin.EditSongForm',
u'&Manage Authors, Topics, Books'))
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.indexOf(self.AuthorsTab),
translate('EditSongForm', 'Authors, Topics && Book'))
self.ThemeGroupBox.setTitle(translate('EditSongForm', 'Theme'))
self.ThemeAddButton.setText(translate('EditSongForm', 'Add a Theme'))
self.CopyrightGroupBox.setTitle(translate('EditSongForm', 'Copyright Information'))
self.CopyrightInsertButton.setText(translate('EditSongForm', u'\xa9'))
self.CCLILabel.setText(translate('EditSongForm', 'CCLI Number:'))
self.CommentsGroupBox.setTitle(translate('EditSongForm', 'Comments'))
translate(u'SongsPlugin.EditSongForm', u'Authors, Topics && Book'))
self.ThemeGroupBox.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Theme'))
self.ThemeAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Add a Theme'))
self.CopyrightGroupBox.setTitle(
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.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 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.lib.models import Song
from editsongdialog import Ui_EditSongDialog
@ -102,7 +102,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
self.previewButton = QtGui.QPushButton()
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.previewButton, QtGui.QDialogButtonBox.ActionRole)
QtCore.QObject.connect(self.ButtonBox,
@ -436,12 +437,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if parts.endswith(u'\n'):
parts = parts.rstrip(u'\n')
item = QtGui.QTableWidgetItem(parts)
item.setData(
QtCore.Qt.UserRole, QtCore.QVariant(variant))
item.setData(QtCore.Qt.UserRole,
QtCore.QVariant(variant))
self.VerseListWidget.setRowCount(
self.VerseListWidget.rowCount() + 1)
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.resizeRowsToContents()
self.VerseListWidget.repaint()
@ -462,16 +464,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if len(self.TitleEditItem.displayText()) == 0:
self.SongTabWidget.setCurrentIndex(0)
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:
self.SongTabWidget.setCurrentIndex(0)
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:
self.SongTabWidget.setCurrentIndex(1)
self.AuthorsListView.setFocus()
#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' '):
if len(verse) > 1:
if taglist.find(verse[0:1]) > -1 \
@ -480,9 +484,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
else:
self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus()
return False, \
self.trUtf8(\
'Invalid verse entry, values must be I,B,T,P,E,O,V,C followed by a number')
return False, translate(u'SongsPlugin.EditSongForm',
u'Invalid verse entry, values must be I,B,T,P,E,O,V,C '
u'followed by a number')
return True, u''
def onTitleEditItemLostFocus(self):
@ -534,7 +538,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
valid, message = self._validate_song()
if not valid:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'), message,
self, translate(u'SongsPlugin.EditSongForm', u'Error'), message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return False
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'')

View File

@ -73,33 +73,37 @@ class Ui_EditVerseDialog(object):
self.EditVerseLayout.addLayout(self.VerseTypeLayout)
self.EditButtonBox = QtGui.QDialogButtonBox(EditVerseDialog)
self.EditButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.EditButtonBox.setStandardButtons(
QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Save)
self.EditButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Save)
self.EditButtonBox.setObjectName(u'EditButtonBox')
self.EditVerseLayout.addWidget(self.EditButtonBox)
self.retranslateUi(EditVerseDialog)
QtCore.QObject.connect(
self.EditButtonBox,
QtCore.SIGNAL(u'accepted()'),
EditVerseDialog.accept
)
QtCore.QObject.connect(
self.EditButtonBox,
QtCore.SIGNAL(u'rejected()'),
EditVerseDialog.reject
)
QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'accepted()'),
EditVerseDialog.accept)
QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'rejected()'),
EditVerseDialog.reject)
QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
def retranslateUi(self, EditVerseDialog):
EditVerseDialog.setWindowTitle(translate('EditVerseForm', 'Edit Verse'))
self.VerseTypeLabel.setText(translate('EditVerseForm', 'Verse Type:'))
self.VerseTypeComboBox.setItemText(0, VerseType.to_string(VerseType.Verse))
self.VerseTypeComboBox.setItemText(1, VerseType.to_string(VerseType.Chorus))
self.VerseTypeComboBox.setItemText(2, 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('EditVerseForm', 'Insert'))
EditVerseDialog.setWindowTitle(
translate(u'SongsPlugin.EditVerseForm', u'Edit Verse'))
self.VerseTypeLabel.setText(
translate(u'SongsPlugin.EditVerseForm', u'Verse Type:'))
self.VerseTypeComboBox.setItemText(0,
VerseType.to_string(VerseType.Verse))
self.VerseTypeComboBox.setItemText(1,
VerseType.to_string(VerseType.Chorus))
self.VerseTypeComboBox.setItemText(2,
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)):
if single:
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.InsertButton.setVisible(False)
else:
@ -133,6 +134,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
def getVerseAll(self):
text = self.VerseTextEdit.toPlainText()
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

View File

@ -286,21 +286,41 @@ class Ui_OpenLPExportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenLPExportDialog)
def retranslateUi(self, OpenLPExportDialog):
OpenLPExportDialog.setWindowTitle(translate('OpenLPExportForm', 'openlp.org Song Exporter'))
self.ExportFileLabel.setText(translate('OpenLPExportForm', 'Select openlp.org export filename:'))
self.ExportListLabel.setText(translate('OpenLPExportForm', 'Full Song List'))
self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title'))
self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author'))
self.ExportSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All'))
self.ExportFilterComboBox.setItemText(0, translate('OpenLPExportForm', 'Lyrics'))
self.ExportFilterComboBox.setItemText(1, translate('OpenLPExportForm', 'Title'))
self.ExportFilterComboBox.setItemText(2, translate('OpenLPExportForm', 'Author'))
self.SelectedListLabel.setText(translate('OpenLPExportForm', 'Song Export List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author'))
self.SelectedSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All'))
self.SelectedRemoveSelectedButton.setText(translate('OpenLPExportForm', 'Remove Selected'))
self.ProgressGroupBox.setTitle(translate('OpenLPExportForm', 'Progress:'))
self.ProgressLabel.setText(translate('OpenLPExportForm', 'Ready to export'))
self.ExportPushButton.setText(translate('OpenLPExportForm', 'Export'))
self.ClosePushButton.setText(translate('OpenLPExportForm', 'Close'))
OpenLPExportDialog.setWindowTitle(
translate(u'SongsPlugin.OpenLPExportForm',
u'openlp.org Song Exporter'))
self.ExportFileLabel.setText(
translate(u'SongsPlugin.OpenLPExportForm',
u'Select openlp.org export filename:'))
self.ExportListLabel.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Full Song List'))
self.ExportListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Song Title'))
self.ExportListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.ExportSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Select All'))
self.ExportFilterComboBox.setItemText(0,
translate(u'SongsPlugin.OpenLPExportForm', u'Lyrics'))
self.ExportFilterComboBox.setItemText(1,
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)
def retranslateUi(self, OpenLPImportDialog):
OpenLPImportDialog.setWindowTitle(translate('OpenLPImportForm', 'openlp.org Song Importer'))
self.ImportFileLabel.setText(translate('OpenLPImportForm', 'Select openlp.org songfile to import:'))
self.ImportListLabel.setText(translate('OpenLPImportForm', 'Import File Song List'))
self.ImportListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title'))
self.ImportListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author'))
self.ImportSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All'))
self.ImportFilterComboBox.setItemText(0, translate('OpenLPImportForm', 'Lyrics'))
self.ImportFilterComboBox.setItemText(1, translate('OpenLPImportForm', 'Title'))
self.ImportFilterComboBox.setItemText(2, translate('OpenLPImportForm', 'Author'))
self.SelectedListLabel.setText(translate('OpenLPImportForm', 'Song Import List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author'))
self.SelectedSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All'))
self.SelectedRemoveSelectedButton.setText(translate('OpenLPImportForm', 'Remove Selected'))
self.ProgressGroupBox.setTitle(translate('OpenLPImportForm', 'Progress:'))
self.ProgressLabel.setText(translate('OpenLPImportForm', 'Ready to import'))
self.ImportPushButton.setText(translate('OpenLPImportForm', 'Import'))
self.ClosePushButton.setText(translate('OpenLPImportForm', 'Close'))
OpenLPImportDialog.setWindowTitle(
translate(u'SongsPlugin.OpenLPImportForm',
u'openlp.org Song Importer'))
self.ImportFileLabel.setText(
translate(u'SongsPlugin.OpenLPImportForm',
u'Select openlp.org songfile to import:'))
self.ImportListLabel.setText(
translate(u'SongsPlugin.OpenLPImportForm',
u'Import File Song List'))
self.ImportListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Song Title'))
self.ImportListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.ImportSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Select All'))
self.ImportFilterComboBox.setItemText(0,
translate(u'SongsPlugin.OpenLPImportForm', u'Lyrics'))
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)
def retranslateUi(self, OpenSongExportDialog):
OpenSongExportDialog.setWindowTitle(translate('OpenSongExportForm', 'OpenSong Song Exporter'))
self.ExportFileLabel.setText(translate('OpenSongExportForm', 'Select OpenSong song folder:'))
self.ExportListLabel.setText(translate('OpenSongExportForm', 'Full Song List'))
self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title'))
self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author'))
self.ExportSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All'))
self.ExportFilterComboBox.setItemText(0, translate('OpenSongExportForm', 'Lyrics'))
self.ExportFilterComboBox.setItemText(1, translate('OpenSongExportForm', 'Title'))
self.ExportFilterComboBox.setItemText(2, translate('OpenSongExportForm', 'Author'))
self.SelectedListLabel.setText(translate('OpenSongExportForm', 'Song Export List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author'))
self.SelectedSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All'))
self.SelectedRemoveSelectedButton.setText(translate('OpenSongExportForm', 'Remove Selected'))
self.ProgressGroupBox.setTitle(translate('OpenSongExportForm', 'Progress:'))
self.ProgressLabel.setText(translate('OpenSongExportForm', 'Ready to export'))
self.ExportPushButton.setText(translate('OpenSongExportForm', 'Export'))
self.ClosePushButton.setText(translate('OpenSongExportForm', 'Close'))
OpenSongExportDialog.setWindowTitle(
translate(u'SongsPlugin.OpenSongExportForm', u'OpenSong Song Exporter'))
self.ExportFileLabel.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Select OpenSong song folder:'))
self.ExportListLabel.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Full Song List'))
self.ExportListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Song Title'))
self.ExportListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.ExportSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Select All'))
self.ExportFilterComboBox.setItemText(0,
translate(u'SongsPlugin.OpenSongExportForm', u'Lyrics'))
self.ExportFilterComboBox.setItemText(1,
translate(u'SongsPlugin.OpenSongExportForm', u'Title'))
self.ExportFilterComboBox.setItemText(2,
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)
def retranslateUi(self, OpenSongImportDialog):
OpenSongImportDialog.setWindowTitle(translate('OpenSongImportForm', 'OpenSong Song Importer'))
self.ImportFileLabel.setText(translate('OpenSongImportForm', 'OpenSong Folder:'))
self.ProgressGroupBox.setTitle(translate('OpenSongImportForm', 'Progress:'))
self.ProgressLabel.setText(translate('OpenSongImportForm', 'Ready to import'))
self.ImportPushButton.setText(translate('OpenSongImportForm', 'Import'))
self.ClosePushButton.setText(translate('OpenSongImportForm', 'Close'))
OpenSongImportDialog.setWindowTitle(
translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Song Importer'))
self.ImportFileLabel.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Folder:'))
self.ProgressGroupBox.setTitle(
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)
def retranslateUi(self, SongBookDialog):
SongBookDialog.setWindowTitle(translate('SongBookForm', 'Edit Book'))
self.NameLabel.setText(translate('SongBookForm', 'Name:'))
self.PublisherLabel.setText(translate('SongBookForm', 'Publisher:'))
SongBookDialog.setWindowTitle(
translate(u'SongsPlugin.SongBookForm', u'Edit Book'))
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 openlp.core.lib import translate
from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog
class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
"""
Class documentation goes here.
@ -48,8 +50,9 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
def accept(self):
if not self.NameEdit.text():
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('You need to type in a book name!'),
self, translate(u'SongsPlugin.SongBookForm', u'Error'),
translate(u'SongsPlugin.SongBookForm',
u'You need to type in a book name!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.NameEdit.setFocus()
return False

View File

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

View File

@ -25,6 +25,8 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
class Ui_SongImportWizard(object):
def setupUi(self, SongImportWizard):
SongImportWizard.setObjectName(u'SongImportWizard')
@ -224,32 +226,55 @@ class Ui_SongImportWizard(object):
QtCore.QMetaObject.connectSlotsByName(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(
'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
self.trUtf8('Welcome to the Song Import Wizard'))
self.InformationLabel.setText(self.trUtf8('This wizard will help you '
'to import songs from a variety of formats. Click the next button '
'below to start the process by selecting a format to import from.'))
self.SourcePage.setTitle(self.trUtf8('Select Import Source'))
self.SourcePage.setSubTitle(self.trUtf8('Select the import format, '
'and where to import from.'))
self.FormatLabel.setText(self.trUtf8('Format:'))
self.FormatComboBox.setItemText(0, self.trUtf8('OpenLyrics'))
self.FormatComboBox.setItemText(1, self.trUtf8('OpenSong'))
self.FormatComboBox.setItemText(2, self.trUtf8('CCLI'))
self.FormatComboBox.setItemText(3, self.trUtf8('CSV'))
self.OpenLyricsAddButton.setText(self.trUtf8('Add Files...'))
self.OpenLyricsRemoveButton.setText(self.trUtf8('Remove File(s)'))
self.OpenSongAddButton.setText(self.trUtf8('Add Files...'))
self.OpenSongRemoveButton.setText(self.trUtf8('Remove File(s)'))
self.CCLIAddButton.setText(self.trUtf8('Add Files...'))
self.CCLIRemoveButton.setText(self.trUtf8('Remove File(s)'))
self.CSVFilenameLabel.setText(self.trUtf8('Filename:'))
self.CSVBrowseButton.setText(self.trUtf8('Browse...'))
self.ImportPage.setTitle(self.trUtf8('Importing'))
self.ImportPage.setSubTitle(self.trUtf8('Please wait while your songs '
'are imported.'))
self.ImportProgressLabel.setText(self.trUtf8('Ready.'))
self.ImportProgressBar.setFormat(self.trUtf8('%p%'))
translate(u'SongsPlugin.SongImportWizard',
u'Welcome to the Song Import Wizard'))
self.InformationLabel.setText(
translate(u'SongsPlugin.SongImportWizard',
u'This wizard will help you to import songs from a variety of '
u'formats. Click the next button below to start the process by '
u'selecting a format to import from.'))
self.SourcePage.setTitle(
translate(u'SongsPlugin.SongImportWizard', u'Select Import Source'))
self.SourcePage.setSubTitle(
translate(u'SongsPlugin.SongImportWizard',
u'Select the import format, and where to import from.'))
self.FormatLabel.setText(
translate(u'SongsPlugin.SongImportWizard', u'Format:'))
self.FormatComboBox.setItemText(0,
translate(u'SongsPlugin.SongImportWizard', u'OpenLyrics'))
self.FormatComboBox.setItemText(1,
translate(u'SongsPlugin.SongImportWizard', u'OpenSong'))
self.FormatComboBox.setItemText(2,
translate(u'SongsPlugin.SongImportWizard', u'CCLI'))
self.FormatComboBox.setItemText(3,
translate(u'SongsPlugin.SongImportWizard', u'CSV'))
self.OpenLyricsAddButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
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 openlp.core.lib import build_icon, translate
from openlp.core.lib import build_icon, translate
class Ui_SongMaintenanceDialog(object):
def setupUi(self, SongMaintenanceDialog):
@ -192,9 +192,11 @@ class Ui_SongMaintenanceDialog(object):
self.TypeStackedWidget.addWidget(self.BooksPage)
self.ContentLayout.addWidget(self.TypeStackedWidget)
self.DialogLayout.addWidget(self.ContentWidget)
self.MaintenanceButtonBox = QtGui.QDialogButtonBox(SongMaintenanceDialog)
self.MaintenanceButtonBox = QtGui.QDialogButtonBox(
SongMaintenanceDialog)
self.MaintenanceButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.MaintenanceButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
self.MaintenanceButtonBox.setStandardButtons(
QtGui.QDialogButtonBox.Close)
self.MaintenanceButtonBox.setObjectName(u'MaintenanceButtonBox')
self.DialogLayout.addWidget(self.MaintenanceButtonBox)
@ -208,16 +210,29 @@ class Ui_SongMaintenanceDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongMaintenanceDialog)
def retranslateUi(self, SongMaintenanceDialog):
SongMaintenanceDialog.setWindowTitle(translate('SongMaintenanceForm', 'Song Maintenance'))
self.TypeListWidget.item(0).setText(translate('SongMaintenanceForm', 'Authors'))
self.TypeListWidget.item(1).setText(translate('SongMaintenanceForm', 'Topics'))
self.TypeListWidget.item(2).setText(translate('SongMaintenanceForm', 'Books/Hymnals'))
self.AuthorAddButton.setText(translate('SongMaintenanceForm', 'Add'))
self.AuthorEditButton.setText(translate('SongMaintenanceForm', 'Edit'))
self.AuthorDeleteButton.setText(translate('SongMaintenanceForm', 'Delete'))
self.TopicAddButton.setText(translate('SongMaintenanceForm', 'Add'))
self.TopicEditButton.setText(translate('SongMaintenanceForm', 'Edit'))
self.TopicDeleteButton.setText(translate('SongMaintenanceForm', 'Delete'))
self.BookAddButton.setText(translate('SongMaintenanceForm', 'Add'))
self.BookEditButton.setText(translate('SongMaintenanceForm', 'Edit'))
self.BookDeleteButton.setText(translate('SongMaintenanceForm', 'Delete'))
SongMaintenanceDialog.setWindowTitle(
translate(u'SongsPlugin.SongMaintenanceForm', u'Song Maintenance'))
self.TypeListWidget.item(0).setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Authors'))
self.TypeListWidget.item(1).setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Topics'))
self.TypeListWidget.item(2).setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Books/Hymnals'))
self.AuthorAddButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.AuthorEditButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
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 topicsform import TopicsForm
from songbookform import SongBookForm
from openlp.core.lib import translate
class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
"""
@ -136,8 +137,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetAuthors()
else:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('Couldn\'t add your author.'))
self, translate(u'SongsPlugin.SongMaintenanceForm',
u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your author.'))
def onTopicAddButtonClick(self):
if self.topicform.exec_():
@ -146,8 +149,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics()
else:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('Couldn\'t add your topic.'))
self, translate(u'SongsPlugin.SongMaintenanceForm',
u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your topic.'))
def onBookAddButtonClick(self):
if self.bookform.exec_():
@ -158,8 +163,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetBooks()
else:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('Couldn\'t add your book.'))
self, translate(u'SongsPlugin.SongMaintenanceForm',
u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your book.'))
def onAuthorEditButtonClick(self):
author_id = self._getCurrentItemId(self.AuthorsListWidget)
@ -179,8 +186,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetAuthors()
else:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('Couldn\'t save your author.'))
self, translate(u'SongsPlugin.SongMaintenanceForm',
u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your author.'))
def onTopicEditButtonClick(self):
topic_id = self._getCurrentItemId(self.TopicsListWidget)
@ -193,8 +202,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics()
else:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('Couldn\'t save your topic.'))
self, translate(u'SongsPlugin.SongMaintenanceForm',
u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your topic.'))
def onBookEditButtonClick(self):
book_id = self._getCurrentItemId(self.BooksListWidget)
@ -209,8 +220,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetBooks()
else:
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('Couldn\'t save your book.'))
self, translate(u'SongsPlugin.SongMaintenanceForm',
u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your book.'))
def onAuthorDeleteButtonClick(self):
"""
@ -219,11 +232,14 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem(
self.AuthorsListWidget, self.songmanager.get_author,
self.songmanager.delete_author, self.resetAuthors,
self.trUtf8('Delete Author'),
self.trUtf8('Are you sure you want to delete the selected author?'),
self.trUtf8('This author can\'t be deleted, they are currently '
'assigned to at least one song.'),
self.trUtf8('No author selected!'))
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Author'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Are you sure you want to delete the selected author?'),
translate(u'SongsPlugin.SongMaintenanceForm',
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):
"""
@ -232,11 +248,14 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem(
self.TopicsListWidget, self.songmanager.get_topic,
self.songmanager.delete_topic, self.resetTopics,
self.trUtf8('Delete Topic'),
self.trUtf8('Are you sure you want to delete the selected topic?'),
self.trUtf8('This topic can\'t be deleted, it is currently '
'assigned to at least one song.'),
self.trUtf8('No topic selected!'))
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Topic'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Are you sure you want to delete the selected topic?'),
translate(u'SongsPlugin.SongMaintenanceForm',
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):
"""
@ -245,8 +264,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem(
self.BooksListWidget, self.songmanager.get_book,
self.songmanager.delete_book, self.resetBooks,
self.trUtf8('Delete Book'),
self.trUtf8('Are you sure you want to delete the selected book?'),
self.trUtf8('This book can\'t be deleted, it is currently '
'assigned to at least one song.'),
self.trUtf8('No book selected!'))
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Book'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Are you sure you want to delete the selected book?'),
translate(u'SongsPlugin.SongMaintenanceForm',
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)
def retranslateUi(self, TopicsDialog):
TopicsDialog.setWindowTitle(translate('TopicsForm', 'Topic Maintenance'))
self.NameLabel.setText(translate('TopicsForm', 'Topic name:'))
TopicsDialog.setWindowTitle(
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 openlp.core.lib import translate
from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog
class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
"""
Class documentation goes here.
@ -47,8 +49,9 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
def accept(self):
if not self.NameEdit.text():
QtGui.QMessageBox.critical(
self, self.trUtf8('Error'),
self.trUtf8('You need to type in a topic name!'),
self, translate(u'SongsPlugin.TopicsForm', u'Error'),
translate(u'SongsPlugin.TopicsForm',
u'You need to type in a topic name!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.NameEdit.setFocus()
return False

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,7 +27,8 @@ import logging
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, \
SofImport, OooImport
@ -150,7 +151,8 @@ class SongsPlugin(Plugin):
def onImportSofItemClick(self):
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)')
try:
for filename in filenames:
@ -170,15 +172,17 @@ class SongsPlugin(Plugin):
def onImportOooItemClick(self):
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(*.*)')
oooimport = OooImport(self.manager)
oooimport.import_docs(filenames)
Receiver.send_message(u'songs_load_list')
def about(self):
about_text = self.trUtf8('<strong>Song Plugin</strong><br />'
'This plugin allows songs to be managed and displayed.')
about_text = translate(u'SongsPlugin.Songsplugin',
u'<strong>Song Plugin</strong><br />'
u'This plugin allows songs to be managed and displayed.')
return about_text
def can_delete_theme(self, theme):

View File

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

View File

@ -70,24 +70,28 @@ class Ui_SongUsageDetailDialog(object):
self.verticalLayout_2.addWidget(self.FileGroupBox)
self.verticalLayout.addWidget(self.DateRangeGroupBox)
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.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(SongUsageDetailDialog)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'accepted()'),
SongUsageDetailDialog.accept)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'rejected()'),
SongUsageDetailDialog.close)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
SongUsageDetailDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
SongUsageDetailDialog.close)
QtCore.QObject.connect(self.SaveFilePushButton,
QtCore.SIGNAL(u'pressed()'),
SongUsageDetailDialog.defineOutputLocation)
QtCore.SIGNAL(u'pressed()'),
SongUsageDetailDialog.defineOutputLocation)
QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog)
def retranslateUi(self, SongUsageDetailDialog):
SongUsageDetailDialog.setWindowTitle(translate('AuditDetailDialog', 'Song Usage Extraction'))
self.DateRangeGroupBox.setTitle(translate('AuditDetailDialog', 'Select Date Range'))
self.ToLabel.setText(translate('AuditDetailDialog', 'to'))
self.FileGroupBox.setTitle(translate('AuditDetailDialog', 'Report Location'))
SongUsageDetailDialog.setWindowTitle(
translate(u'SongsPlugin.AuditDetailDialog',
u'Song Usage Extraction'))
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 openlp.core.lib import SettingsManager
from openlp.core.lib import SettingsManager, translate
from songusagedetaildialog import Ui_SongUsageDetailDialog
@ -61,7 +61,8 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
def defineOutputLocation(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))
path = unicode(path)
if path != u'':

View File

@ -28,7 +28,7 @@ import logging
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.forms import SongUsageDetailForm, \
SongUsageDeleteForm
@ -156,7 +156,8 @@ class SongUsagePlugin(Plugin):
self.SongUsagedetailform.exec_()
def about(self):
about_text = self.trUtf8('<b>SongUsage Plugin</b><br>This plugin '
'records the use of songs and when they have been used during '
'a live service')
about_text = translate(u'SongsPlugin.SongUsagePlugin',
u'<b>SongUsage Plugin</b><br>This plugin '
u'records the use of songs and when they have been used during '
u'a live service')
return about_text