Compare commits

...

199 Commits

Author SHA1 Message Date
Raoul Snyman f90bb9f14a Release 2.4.6
bzr-revno: 2684
2017-03-31 11:32:27 -07:00
Tim Bentley 6b37313288 Last set
bzr-revno: 2683
2017-03-31 11:16:56 -07:00
Tim Bentley 54cba7bec7 trans31032017 2017-03-31 08:24:49 +01:00
simon.hanna@serve-me.info 991296d8e3 Backport songbeamer fix
bzr-revno: 2682
2017-03-30 17:59:54 +01:00
Raoul Snyman 950afd08e7 Disable the shortcut controls when an action has not been selected
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/custom-shortcuts-2.4 (revision 2681)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1952/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1863/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1804/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1530/
[SUCCESS] https://ci.openlp.io/job...

bzr-revno: 2681
2017-03-29 18:47:59 -07:00
Simon Hanna 80bb6f713e Restore previously deleted import 2017-03-30 00:04:59 +02:00
Raoul Snyman ca53095d5a Update changelog 2017-03-29 11:45:02 -07:00
Raoul Snyman 594af69414 Disable the shortcut controls when an action has not been selected 2017-03-29 10:23:52 -07:00
Simon Hanna b371e73acc Fix songbeamer import bug 2017-03-29 14:05:08 +02:00
Raoul Snyman bd9eb0058a Fix the author_type import properly
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/fix-author-type-2.4 (revision 2681)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1947/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1858/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1799/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1525/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Te...

bzr-revno: 2680
2017-03-28 11:39:35 -07:00
Raoul Snyman 6ca65fd758 Fix a problem with loading Qt's translation files
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/fix-translations-2.4 (revision 2680)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1943/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1854/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1795/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1521/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windo...

bzr-revno: 2679
2017-03-28 11:37:08 -07:00
Raoul Snyman 12cfe103b7 Add a test 2017-03-27 21:53:46 -07:00
Raoul Snyman a62d9c6a41 Fix one test and remove another that wasn't going to ever work 2017-03-27 21:39:45 -07:00
Raoul Snyman ddd9d4d865 Fix the author_type import properly 2017-03-27 21:08:50 -07:00
Raoul Snyman 336ec0b54f Removed a forgotten print 2017-03-27 17:32:56 -07:00
Raoul Snyman a204d8a06d Update changelog 2017-03-27 16:25:12 -07:00
Raoul Snyman 867c718c89 Fix a problem with loading Qt's translation files
Fixes: https://launchpad.net/bugs/1676163
2017-03-27 16:23:14 -07:00
tim.bentley@gmail.com 419b3e46d8 Next set of translations
bzr-revno: 2678
2017-03-25 07:03:59 +00:00
Tim Bentley 62ff38d989 Translation updates 2017-03-23 19:36:29 +00:00
raoul@snyman.info 28e0399856 Revert the database upgrade, fix a few more bugs, and add some tests.
Bugs fixed:
- Sometimes the timer goes off as OpenLP is shutting down, and the application has already been deleted (reported via support system)
- Fix opening the data folder (KDE thought the old way was an SMB share)
- Fix a problem with the new QMediaPlayer not controlling the playlist anymore


Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/fix-db-upgrade-2.4 (revision 2681)
[...

bzr-revno: 2677
2017-03-22 17:45:47 +00:00
Raoul Snyman d9d9b4f62c Update changelog 2017-03-21 23:21:02 -07:00
Raoul Snyman 296d9534a8 Remove some extra whitespace 2017-03-21 23:13:12 -07:00
Raoul Snyman cfbe212a32 Revert the database upgrade, fix a few more bugs, and add some tests. 2017-03-21 23:05:16 -07:00
Raoul Snyman dc37dad251 Fix opening the data folder (KDE thought the old way was an SMB share) 2017-03-16 21:27:16 -07:00
Raoul Snyman f759bda9e7 Fix a problem with the new QMediaPlayer not controlling the playlist anymore 2017-03-16 21:26:49 -07:00
Raoul Snyman e5c6938577 Move upgrade 4 to 6 so that people who encounter the problem are fixed. 2017-03-16 21:26:12 -07:00
Raoul Snyman c4162fdf1e Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/db-upgrades-2.4 (revision 2681)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1929/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1840/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1781/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1511/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/1101/
[SUCCESS] https://ci.openlp.io/...

bzr-revno: 2676
2017-03-11 20:20:26 -07:00
Raoul Snyman 91a32d33a7 Fix a linting issue 2017-03-08 22:36:11 -07:00
Raoul Snyman 808875b683 Added a (long overdue) changelog 2017-03-08 22:36:03 -07:00
Raoul Snyman 3635cc3603 Write some tests 2017-03-08 22:23:37 -07:00
Raoul Snyman c5835a7362 Fix a bunch of errors in the song database upgrades 2017-03-08 22:20:27 -07:00
Raoul Snyman 8850ab2fe3 Add support for author types to the OpenLP importer 2017-03-08 16:32:16 -07:00
Raoul Snyman 3ff851b064 Fix an issue with invalid songbook entries being created 2017-03-08 16:31:57 -07:00
Raoul Snyman 1ec27e8b05 - Fix SongSelect so that it detects the login URL
- Fix PresentationManager importer to handle weird XML
- Pull in OpenLP song importer fixes from Olli's branch

bzr-revno: 2675
2017-03-02 14:54:45 -07:00
Raoul Snyman 090de0d987 Fix some tests that were causing issues 2017-03-02 11:54:18 -07:00
raoul@snyman.info 1a442e7f3c Fix bug #1666005 and bug #1668994
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/off-by-one-2.4 (revision 2676)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1915/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1826/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1767/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1500/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/109...

bzr-revno: 2674
2017-03-02 17:52:11 +00:00
raoul@snyman.info 0d6f015eec Fix bug #1668669 by reducing the height of the widget.
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/bug-1668669-2.4 (revision 2673)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1908/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1819/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1759/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1493/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windo...

bzr-revno: 2673
2017-03-02 17:49:44 +00:00
Raoul Snyman bef7c9df13 Forgot a few things 2017-03-01 22:02:21 -07:00
Raoul Snyman 678a42263d Fixed a test 2017-03-01 19:51:15 -07:00
Raoul Snyman 35af0af211 Some tests to go with it 2017-03-01 19:35:04 -07:00
Raoul Snyman 9e6ffe5d43 Make the settings dialog as small as possible
Fixes: https://launchpad.net/bugs/1668669
2017-03-01 16:26:58 -07:00
Raoul Snyman 77d36b607c Hopefully, for one and for all, fix the off-by-one issues on all platforms
Fixes: https://launchpad.net/bugs/1669007, https://launchpad.net/bugs/1668994
2017-03-01 14:54:38 -07:00
Raoul Snyman 2748f1e6c5 Pull in OpenLP song importer fixes from Olli's branch 2017-03-01 11:24:27 -07:00
Raoul Snyman 70532e444a Fix a linting issue 2017-02-25 16:40:42 -07:00
Raoul Snyman c000ba4b4f Fix SongSelect so that it detects the login URL; Fix PresentationManager importer to handle weird XML; Tests 2017-02-25 15:18:54 -07:00
Raoul Snyman 561f272e86 Release 2.4.5
bzr-revno: 2672
2017-02-03 11:57:32 -07:00
Tim Bentley 90e5e3c9ed Translations 03022017
bzr-revno: 2671
2017-02-03 18:29:48 +00:00
Tim Bentley 408abb06ff trans 2017-02-03 18:12:42 +00:00
raoul@snyman.info ea8aa7588c Fix some bugs in the songsusage plugin:
* Bug 1532193
 * Bug 1661416

Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/fix-songusage-2.4 (revision 2671)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1899/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1810/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1749/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1485/
[SUCCESS] https://ci.openlp.io/jo...

bzr-revno: 2670
2017-02-03 09:57:54 -07:00
tim.bentley@gmail.com 4cb992fbd7 Fix incorrect menu link
lp:~trb143/openlp/fixes245 (revision 2670)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1898/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1809/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1748/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1484/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/1074/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1142/
[SUCCESS] https://...

bzr-revno: 2669
2017-02-03 09:55:58 -07:00
Raoul Snyman 3fd1f43536 Fix initialisation of song usage dates
Fixes: https://launchpad.net/bugs/1661416
2017-02-02 21:38:07 -07:00
Raoul Snyman e3ca228723 Removed a print statement 2017-02-02 20:15:02 -07:00
Raoul Snyman ed8304bfb6 Fix the names of the songusage default settings
Fixes: https://launchpad.net/bugs/1532193
2017-02-02 18:39:59 -07:00
Tim Bentley a5c9ded757 fix tests 2017-01-31 19:07:54 +00:00
Tim Bentley bd5dfe920b fix bug 1660473 2017-01-31 17:41:35 +00:00
raoul@snyman.info a0fb528ba7 We're getting quite a few support tickets from people who think the Projector Manager is for setting up OpenLP's display. Hiding the projector manager by default should prevent this from happening as often as it currently is.
bzr-revno: 2668
2017-01-24 21:01:58 -07:00
tim.bentley@gmail.com 793d7460f2 Updated translations
fix the script
fix the utf8 blocker for updates

bzr-revno: 2667
2017-01-24 20:53:57 +00:00
Tim Bentley ef205e677a fix the translations 2017-01-23 18:03:19 +00:00
second@tgc.dk ab5b69eb0c Fixes:
Bug #1487788: Importing photos does not give focus to OpenLP
Bug #1512040: Loop tooltip gets stuck to "Stop playing..."
Bug #1624661: Missing DB in unmounted disk results in Traceback
Clean search lyrics for formatting tags. Fixes bug #1655988.
Fix an issue with easyslide import not handling verse order correctly. Fixes bug #1655985.
Improve the songbeamer encoding detection. Fixes bug #1530597.
Handle a few videopsalm quirks. Fixes bug #1652851.

bzr-revno: 2666
2017-01-22 22:21:47 +01:00
Tomas Groth 3cb1dae0f0 Bug #1487788: Importing photos does not give focus to OpenLP
Bug #1512040: Loop tooltip gets stuck to "Stop playing..."
Bug #1624661: Missing DB in unmounted disk results in Traceback

Fixes: https://launchpad.net/bugs/1487788, https://launchpad.net/bugs/1512040, https://launchpad.net/bugs/1624661
2017-01-22 21:01:53 +01:00
Tomas Groth dc5de9a54d Clean search lyrics for formatting tags. Fixes bug #1655988.
Fix an issue with easyslide import not handling verse order correctly. Fixes bug #1655985.
Improve the songbeamer encoding detection. Fixes bug #1530597.
Handle a few videopsalm quirks. Fixes bug #1652851.

Fixes: https://launchpad.net/bugs/1655988, https://launchpad.net/bugs/1655985, https://launchpad.net/bugs/1530597, https://launchpad.net/bugs/1652851
2017-01-22 18:04:32 +01:00
Raoul Snyman f13f473bec Hide the Projectors manager by default so that it doesn't confuse people 2017-01-21 13:50:30 -07:00
tim.bentley@gmail.com 93b10bb6e7 More Translations
bzr-revno: 2665
2017-01-20 21:54:51 +00:00
Tim Bentley b197e62818 updates 2017-01-10 22:23:23 +00:00
tim.bentley@gmail.com 5f0273fbec Update the year in headers and about form.
bzr-revno: 2664
2017-01-04 17:52:40 +00:00
Tim Bentley c5c98157ba Missed about form 2016-12-31 11:11:47 +00:00
Tim Bentley 93955495a7 Yet another year goes by 2016-12-31 11:05:48 +00:00
raoul@snyman.info 21b8aaa1ac Fix bug #1645867 by setting an application attribute related to OpenGL
Set the width of the Theme wizard so that it doesn't resize by itself
Hide the splash screen when the backup dialog shows and when the exception form shows
Add icons back into the media library tabs

Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/mac-niggles-2.4 (revision 2666)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1875/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Fun...

bzr-revno: 2663
2016-12-18 13:53:03 +00:00
Raoul Snyman 36008338b2 Too many open lines 2016-12-16 23:02:11 +02:00
Raoul Snyman 203ebde628 Move the shortcut test to a better place and add another test for the about form 2016-12-16 22:56:38 +02:00
Raoul Snyman 5fbbb1ae9e HEAD 2016-12-16 22:14:18 +02:00
Raoul Snyman d47c66f833 Add icons back into the media library tabs 2016-12-16 22:11:24 +02:00
Raoul Snyman 5620e73c90 Hide the splash screen when the backup dialog shows and when the exception form shows 2016-12-16 22:06:42 +02:00
Raoul Snyman df900b3e9e Set the width of the Theme wizard so that it doesn't resize by itself 2016-12-16 22:03:26 +02:00
Raoul Snyman e58669e769 Fix web remote for once and for all
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/upgrade-jquery-2.4 (revision 2648)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1870/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1781/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1719/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1459/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tes...

bzr-revno: 2662
2016-12-15 23:25:21 +02:00
Raoul Snyman f4f0b3d035 Fix the QSize bug.
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/qsize-2.4 (revision 2664)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1866/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1777/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1715/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1455/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/1045/
[SUCCESS] https:/...

bzr-revno: 2661
2016-12-15 23:22:28 +02:00
Raoul Snyman 1de246e00f Fix an off-by-one problem when using the autocompletion on macOS
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/bug-1642684-2.4 (revision 2660)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1868/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1779/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1717/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1457/
[SUCCESS] https://ci.openlp.io/job/Branch...

bzr-revno: 2660
2016-12-15 20:37:10 +02:00
Raoul Snyman cd90f5ca68 Not sure how those console.logs got in there, but they don't belong there. 2016-12-15 20:08:21 +02:00
Raoul Snyman 432f813edb Fix a blank line that wasn't supposed to be there 2016-12-15 14:10:48 +02:00
Raoul Snyman b06542c637 HEAD 2016-12-15 14:05:45 +02:00
Raoul Snyman e1a87cf74d Add a test 2016-12-15 14:05:19 +02:00
Raoul Snyman 7bfdc7deef Add some tests around the fix 2016-12-15 13:18:02 +02:00
Raoul Snyman bd5056fb09 Added a test but forgot the actual fix 2016-12-15 13:01:51 +02:00
Raoul Snyman 47f20598d5 Only need __init__.py files for directories with Python files in them 2016-12-15 12:30:16 +02:00
Raoul Snyman a399517e3d Add a test 2016-12-14 23:41:01 +02:00
Raoul Snyman 27400290ba HEAD 2016-12-14 22:32:21 +02:00
Raoul Snyman e96281c1c0 Make the test resources directories into Python modules for some of the tests that need it 2016-12-10 22:59:32 +02:00
Raoul Snyman 7931eb1d17 Fix a problem with the incorrect parent module for QSize 2016-12-10 22:59:06 +02:00
Raoul Snyman 41593f73ff Fix bug #1645867 by setting an application attribute related to OpenGL
Fixes: https://launchpad.net/bugs/1645867
2016-11-30 00:12:46 +02:00
Raoul Snyman 04fe94e533 Release 2.4.4
bzr-revno: 2659
2016-11-26 17:09:53 +02:00
tim.bentley@gmail.com ac3859c0b8 trans
bzr-revno: 2658
2016-11-26 14:38:41 +00:00
Tim Bentley 1c75c07e4c trans2611 2016-11-26 14:10:55 +00:00
Raoul Snyman 18c3d99f29 Fix bug #1642684 by removing the unnecessary blank item. 2016-11-18 00:02:58 +02:00
phill.ridout@gmail.com d466fde45c lp:~phill-ridout/openlp/bug1623711-2.4 (revision 2653)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1810/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1721/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1659/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1415/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/1005/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1073/
[SUCCESS] https://ci.openlp.io/j...

bzr-revno: 2657
2016-11-07 22:43:35 +00:00
Philip Ridout 73c441399f Test 2016-11-01 19:41:21 +00:00
Philip Ridout 0d54103a7a Fixes #1623711 2016-11-01 07:05:26 +00:00
Raoul Snyman c1d4d59471 HEAD 2016-10-23 00:17:02 +02:00
raoul@snyman.info fb585d683a Fix bug #1629079: Attribute error when importing from SongSelect
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/bug-1629079-2.4 (revision 2657)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1784/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1695/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1633/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1389/
[SUCCESS] https://ci.openlp.io/job/Branch...

bzr-revno: 2656
2016-10-03 22:44:43 +02:00
raoul@snyman.info 4f36d6e12a Fix up the last of the packaging issues and increase test coverage of systemplayer to 100%
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/re-enable-version-checking-2.4 (revision 2656)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1783/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1694/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1632/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1388/
...

bzr-revno: 2655
2016-10-03 22:39:18 +02:00
Raoul Snyman b789a7809d Fix up the topics problem and split it into its own test 2016-10-01 20:45:05 +02:00
Raoul Snyman 358667356f Bulk up the tests 2016-09-30 14:18:50 +02:00
Raoul Snyman 13eb461f5b Fix bug #1629079 and add some more tests 2016-09-30 12:01:10 +02:00
Raoul Snyman 7c1c0475c6 Increase test coverage to 100% 2016-09-26 23:38:25 +02:00
Raoul Snyman 8526e8287f Fix up the last of the packaging issues 2016-09-26 21:06:19 +02:00
Raoul Snyman 577a27eb66 Release 2.4.3
bzr-revno: 2654
2016-09-24 12:20:25 +02:00
second@tgc.dk 92ccb1681c Fixes getting bible texts from CrossWalk
Fix to handling of form feed char and vertical tab char.

bzr-revno: 2653
2016-09-24 12:15:07 +02:00
Tomas Groth 1e3bc35390 Fix handling special chars in MediaShout import. Fixes bug 1618489.
Fixes: https://launchpad.net/bugs/1618489
2016-09-24 00:06:59 +02:00
Tomas Groth 6fcfe1aecd Fix getting text from crosswalk bibles. 2016-09-24 00:06:15 +02:00
tim.bentley@gmail.com c62c167d66 Translation updates
bzr-revno: 2652
2016-09-21 20:32:49 +01:00
Tim Bentley 59cc42e666 trans2109 2016-09-21 18:57:29 +01:00
raoul@snyman.info 0ba881b5e2 Fix bug #1547964 by ignoring the exception (it's harmless)
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/disconnect-slots-2.4 (revision 2652)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1741/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1652/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1590/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1346/
[SUCCESS] https://ci.openlp.io/job/Branch...

bzr-revno: 2651
Fixes: https://launchpad.net/bugs/1547964
2016-08-14 10:33:04 +02:00
Raoul Snyman 4a7d06ca33 Don't need that line anymore 2016-08-14 09:39:57 +02:00
Raoul Snyman 33c5f7674e Fix bug #1547964 by ignoring the exception (it's harmless)
Fixes: https://launchpad.net/bugs/1547964
2016-08-14 09:31:19 +02:00
Raoul Snyman 7d5a640a16 Disconnect the slots for a signal before assigning new ones 2016-08-14 09:03:40 +02:00
tim.bentley@gmail.com cdf6a4cbff Translation updates
bzr-revno: 2650
2016-08-14 06:43:46 +01:00
Tim Bentley 9c7dbecd45 trans 1308 2016-08-13 22:21:07 +01:00
tim.bentley@gmail.com 47dff51d00 Fix bug and fully test it.
lp:~trb143/openlp/themecombo-24 (revision 2649)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1730/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1641/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1579/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1339/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/929/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/997/
[SUCCESS] htt...

bzr-revno: 2649
Fixes: https://launchpad.net/bugs/1596668
2016-08-13 21:58:27 +01:00
Tim Bentley a7dd65245a Fix bug and test it 2016-08-13 05:45:37 +01:00
raoul@snyman.info 585321376d Fix SongSelect.
Do updated tests count?

Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/bug-1608194-2.4 (revision 2650)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1724/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1635/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1573/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1334/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_T...

bzr-revno: 2648
Fixes: https://launchpad.net/bugs/1608194
2016-08-12 18:32:11 +01:00
raoul@snyman.info 120b299372 Update slot signatures to comply with PyQt5.6's stricter checks.
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/stricter-slot-signatures-2.4 (revision 2649)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1722/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1633/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1571/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1332/
[SUCCESS] https://ci.openlp....

bzr-revno: 2647
2016-08-12 18:30:27 +01:00
Raoul Snyman d2866a1e9c Removed a log I forgot to take out earlier 2016-08-12 13:52:35 +02:00
Raoul Snyman c4a257c9dd Remove a logging line I never wrote, and move a variable in a test that I need to mock 2016-08-12 11:23:56 +02:00
Raoul Snyman 912849b22c Fix some pep8 issues 2016-08-11 23:43:13 +02:00
Raoul Snyman b3893c2c1b Fix the tests 2016-08-11 23:13:12 +02:00
Raoul Snyman ae93a6e33d Fix bug #1608194: Adapt the importer to the new CCLI SongSelect website
Fixes: https://launchpad.net/bugs/1608194
2016-08-11 16:18:49 +02:00
Raoul Snyman c3bb167b32 Fix some under-indented lines 2016-08-10 11:32:57 +02:00
Raoul Snyman e4468573dc Fix some slot signatures that were the incorrect type 2016-08-10 10:58:55 +02:00
raoul@snyman.info 989356c24e Fix a permission error that we should have fixed ages ago.
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/permission-error-2.4 (revision 2645)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1676/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1587/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1525/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1290/
[SUCCESS] https://ci.openlp.io/job/Branch-...

bzr-revno: 2646
2016-08-02 23:13:13 +02:00
raoul@snyman.info 01c6cb0f8b Fix a permission error that we should have fixed ages ago.
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/permission-error-2.4 (revision 2645)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1676/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1587/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1525/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1290/
[SUCCESS] https://ci.openlp.io/job/Branch-...

bzr-revno: 2645
2016-08-02 22:22:31 +02:00
Raoul Snyman 66d7c8fca6 HEAD 2016-07-27 22:48:16 +02:00
second@tgc.dk 7d52332074 Use BibleGateway standard site instead of the legacy site. Fixes bug 1562384.
Update Crosswalk webpage parser to match new layout. Fixes bug 1599999.

bzr-revno: 2644
Fixes: https://launchpad.net/bugs/1562384, https://launchpad.net/bugs/1599999
2016-07-27 22:42:37 +02:00
Tomas Groth a3a113021b Use BibleGateway standard site instead of the legacy site, fixes bug 1562384. Update Crosswalk webpage parser to match new layout, fixes bug 1599999.
Fixes: https://launchpad.net/bugs/1562384, https://launchpad.net/bugs/1599999
2016-07-27 21:27:14 +02:00
Raoul Snyman 00ede5aeae [remotes] Upgrade jQuery and jQuery Mobile, add jQuery Migrate because Mobile needs it 2016-07-22 22:49:20 +02:00
Raoul Snyman f3796fa3d2 Fix the permission error for once and for all 2016-07-19 22:56:31 +02:00
Raoul Snyman 37e92d00a2 Release 2.4.2
bzr-revno: 2643
2016-06-25 20:20:19 +02:00
Ken Roberts 0e8ab10daf "Bugfix 1588369 - projectorNetwork signal/slot signature mismatch
- Fix projectorNetwork signal signature
- Fix projector manager projectorNetwork signature and method call
- Updated pjlink1 test
- Merge 2.4 base and fix conflicts

--------------------------------
lp:~alisonken1/openlp/bug-1588369-2.4-projectorNetwork-signal (revision 2639)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1636/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1547/
[SUCCESS] https://ci.openlp.io..."

bzr-revno: 2642
Fixes: https://launchpad.net/bugs/1588369
2016-06-25 20:11:47 +02:00
Ken Roberts 319870aa83 Merge 2.4 base - fix conflicts 2016-06-25 10:32:32 -07:00
tim.bentley@gmail.com b19fe349d8 right translations this time
bzr-revno: 2641
2016-06-24 20:50:50 +01:00
Tim Bentley 3cede5cc63 trans 2016-06-24 19:32:18 +01:00
second@tgc.dk a0ac63c31c Fix handeling of control chars and escaped chars in VideoPsalm import. Fixes bug 1594945.
bzr-revno: 2640
Fixes: https://launchpad.net/bugs/1594945
2016-06-22 22:22:26 +02:00
Ken Roberts ecdb379082 Bugfix 1593882 and 1593883 - projector authorization backport
- Fix exception when authenticated connection requested and pin is None
- Fix pjlink authentication (use python hash instead of qt hash)
- Fix md5_hash functions
- Fix qmd5_hash functions
- Added tests for bugfixes

--------------------------------
lp:~alisonken1/openlp/2.4-bug-1593883-projector-authentication (revision 2637)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1630/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Funct...

bzr-revno: 2639
Fixes: https://launchpad.net/bugs/1593882, https://launchpad.net/bugs/1593883
2016-06-22 22:19:24 +02:00
Tomas Groth 867c32165a merge trunk 2016-06-21 23:01:53 +02:00
second@tgc.dk 9d2da2307f Fix traceback in VideoPsalm importers traceback handler.
Skip PresentationManager files we do not support.
Fix MediaShout import issue when an expected table is missing. Fixes bug 1590657.
Fix traceback during songshowplus import. Fixes bug 1585489.

bzr-revno: 2638
Fixes: https://launchpad.net/bugs/1585489, https://launchpad.net/bugs/1590657
2016-06-21 22:50:45 +02:00
Tomas Groth db0cdd372b Fix handeling of control chars and escaped chars in VideoPsalm import. Fixes bug 1594945.
Fixes: https://launchpad.net/bugs/1594945
2016-06-21 22:06:10 +02:00
Ken Roberts 7abbb2abb3 bugfix 1593882 and 1593883 backports 2016-06-17 20:18:52 -07:00
Tomas Groth cadc21b5c0 Fix traceback in VideoPsalm importers traceback handler. 2016-06-16 23:00:13 +02:00
Tomas Groth 7265065906 Skip PresentationManager files we do not support. 2016-06-16 22:59:31 +02:00
Tomas Groth 8f04f587ec Fix MediaShout import issue when an expected table is missing. Fixes bug 1590657.
Fixes: https://launchpad.net/bugs/1590657
2016-06-16 22:58:11 +02:00
Tomas Groth 8057d13db6 Fix traceback during songshowplus import. Fixes bug 1585489.
Fixes: https://launchpad.net/bugs/1585489
2016-06-16 22:54:10 +02:00
raoul@snyman.info 7ad464d43e Fix bug #1589815 by first reducing the string to digits only and then checking if there's anything left.
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/bug-1589815-2.4 (revision 2637)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1604/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1515/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1453/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1226/
[...

bzr-revno: 2637
2016-06-14 22:09:52 +01:00
Raoul Snyman 19a5272e5a Fix bug #1589815 by first reducing the string to digits only and then checking if there's anything left. 2016-06-08 11:09:56 +02:00
Ken Roberts 9ba66f29da pep8 2016-06-02 23:36:38 -07:00
Ken Roberts 2dd4c87dde Bugfix 1588369 - projectorNetwork signal/slot signature mismatch 2016-06-02 23:26:04 -07:00
Tim Bentley 2a1786ec00 Translations
bzr-revno: 2636
2016-05-26 17:24:29 +01:00
Tim Bentley a050e41589 trans242505 2016-05-25 20:11:36 +01:00
second@tgc.dk d8d6917b7d Fix of tracback during SongPro import. Fixes bug 1582152.
Backport of song-search-fix from trunk
Added support for using the new mutool in mudraw mode
Fix crosswalk bible list download
Fix traceback if bible list download fails.

bzr-revno: 2635
Fixes: https://launchpad.net/bugs/1579648, https://launchpad.net/bugs/1582152
2016-05-24 17:16:57 +01:00
tim.bentley@gmail.com d6a433c2fc Fix Android SSL
Fix Service Manager
Fix Formatting Tags
Add test

bzr-revno: 2634
2016-05-24 17:15:49 +01:00
Tomas Groth 505e6de924 Merge 2.4.x trunk 2016-05-24 12:58:51 +02:00
Tomas Groth 8a53e4a991 pep8 fixes
bzr-revno: 2633
2016-05-24 12:56:51 +02:00
Tomas Groth d5c9fd33c5 Merge 2.4.x trunk 2016-05-24 12:53:47 +02:00
Tim Bentley ff541f36ed with test 2016-05-23 19:26:03 +01:00
Tim Bentley d78ed92c4e fixes 2016-05-23 19:15:07 +01:00
Tomas Groth a2b19858b9 pep8 fix 2016-05-16 22:30:33 +02:00
Tomas Groth 935200731c Fix a backported test. 2016-05-16 22:07:11 +02:00
Tomas Groth eb15f09a47 Fix of tracback during SongPro import. Fixes bug 1582152.
Fixes: https://launchpad.net/bugs/1582152
2016-05-16 12:15:53 +02:00
Tomas Groth 94a8057a6a Backport of fix from trunk 2016-05-16 12:14:37 +02:00
raoul@snyman.info 8a6955fda1 Fix the Transifex API URL
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/transifex-api-2.4 (revision 2632)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1536/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1447/
[FAILURE] https://ci.openlp.io/job/Branch-03-Interface-Tests/1385/

bzr-revno: 2632
2016-05-13 17:32:46 +01:00
raoul@snyman.info af54780de5 "Fix the Transifex API URL
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/transifex-api-2.4 (revision 2632)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1536/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1447/
[FAILURE] https://ci.openlp.io/job/Branch-03-Interface-Tests/1385/"

bzr-revno: 2631
2016-05-12 22:30:52 +02:00
Tomas Groth df840d7705 fix backport error 2016-05-10 21:11:14 +02:00
Tomas Groth a34cbab35c Added support for using the new mutool in mudraw mode 2016-05-09 21:44:14 +02:00
Tomas Groth f843236059 Fix crosswalk bible list download 2016-05-09 21:41:23 +02:00
Tomas Groth 2e41c5e6fa Fix traceback if bible list download fails. 2016-05-09 21:40:09 +02:00
Raoul Snyman 150ced331b Fix test after backport from trunk 2016-05-07 18:15:02 +02:00
Raoul Snyman dcf78ae592 Update the Transifex API URL 2016-05-05 22:35:04 +02:00
Raoul Snyman 4ee29b0e3d Release 2.4.1
bzr-revno: 2630
2016-04-30 21:20:28 +02:00
raoul@snyman.info 654241246d Show a message asking the user if they want to remove a file that doesn't exist
bzr-revno: 2629
Fixes: https://launchpad.net/bugs/1559336
2016-04-29 22:19:27 +01:00
Raoul Snyman a75953c3d8 Add a test 2016-04-29 22:52:37 +02:00
Raoul Snyman e505950d3f HEAD 2016-04-29 22:15:41 +02:00
s.mehrbrodt@gmail.com f32d95c200 Fix performance regression with Songbook search
The problem was that in each iteration the database was accessed (the song object).
Fixed this by loading all neccessary information directly in the query.

Also this reintroduces natural sorting.

bzr-revno: 2628
Fixes: https://launchpad.net/bugs/1552563
2016-04-29 19:42:14 +01:00
Samuel Mehrbrodt ef89796e33 pep8 2016-04-29 19:48:40 +02:00
Samuel Mehrbrodt 6e901e336c Fix performance regression in songbook search
Fixes: https://launchpad.net/bugs/1552563
2016-04-29 19:39:52 +02:00
Raoul Snyman 79285ce759 Show a message asking the user if they want to remove a file that doesn't exist
Fixes: https://launchpad.net/bugs/1559336
2016-04-28 23:12:50 +02:00
Tim Bentley c744a9fa59 tranlations
bzr-revno: 2627
2016-04-28 19:19:47 +01:00
raoul@snyman.info 475ab2af3a "Fix bug #1557514 by auto-detecting the columns of the tables in the songs database
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/bug-1557514-2.4 (revision 2625)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1502/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1413/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1351/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1147/
[SUCCESS] https://ci.op..."

bzr-revno: 2626
Fixes: https://launchpad.net/bugs/1557514
2016-04-27 23:26:14 +02:00
Raoul Snyman 411953285d Fix bug #1557514 by autodetecting the columns of the tables in the songs database
Fixes: https://launchpad.net/bugs/1557514
2016-04-27 20:45:39 +02:00
ian@knightly.xyz 76f8349e34 Adds QR code and links to the remotes settings for the new iOS app and test to HTML Builder.
lp:~knightrider0xd/openlp/ios-app-2.4 (revision 2627)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1500/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1411/
Currently failing Jenkins interface tests due to unrelated bug, but tested & pep8 passing.

bzr-revno: 2625
2016-04-27 18:00:36 +01:00
Tim Bentley 78e6ece7fe trans241 2016-04-26 21:47:41 +01:00
Ian Knight 8b893767f8 Testing 2016-04-26 12:17:45 +09:30
Ian Knight fea43c46b9 Added Test to HTML Builder 2016-04-26 12:13:17 +09:30
second@tgc.dk 07323e50a6 "Fix slide order change when splitting custom slides. Fixes bug 1554748.
Fix EasyWorship import issues with missing verses and traceback on unknown chars. Fixes bug 1553922 and 1547234.
Fix traceback in the bug-report dialog. Fixes bug 1554428.
Fix weird test bug in test_pluginmanager.py.
Fix traceback when searching for book that doesn't exists in second bible. Fixes bug 1553863.
Set progress bar steps to number of chapters in zefania import.
Fix song tag detection. Fixes bug 1549549.
Fix a m..."

bzr-revno: 2624
Fixes: https://launchpad.net/bugs/1547234, https://launchpad.net/bugs/1549549, https://launchpad.net/bugs/1553863, https://launchpad.net/bugs/1553922, https://launchpad.net/bugs/1554428, https://launchpad.net/bugs/1554748
2016-04-22 23:30:54 +02:00
Tomas Groth 895b3bf9b5 Fix slide order change when splitting custom slides. Fixes bug 1554748. Fix EasyWorship import issues with missing verses and traceback on unknown chars. Fix traceback in the bug-report dialog. Fixes bug 1554428. Fix weird test bug in test_pluginmanager.py. 2016-04-21 21:57:00 +02:00
Tomas Groth 2c640389f1 Fix traceback when searching for book that doesn't exists in second bible. Fixes bug 1553863. Set progress bar steps to number of chapters in zefania import. Fix song tag detection. Fixes bug 1549549. Fix a method call with too many parentheses, which fixes getting bible books from crosswalk. Fix bug that prevents song book entries to be imported. 2016-04-21 21:49:22 +02:00
Ian Knight 61ffd29cad Added QR code 2016-04-18 17:19:23 +09:30
Ian Knight ff60d9c271 Added QR code and link for iOS app to remote plugin ui 2016-04-18 17:18:59 +09:30
tim.bentley@gmail.com 7b1a61a0e6 "Fix the service when the theme changes"
bzr-revno: 2623
2016-04-03 18:07:20 +02:00
Tim Bentley 82dae6b128 Add tests 2016-04-03 17:00:12 +01:00
Tim Bentley f46f3e835c theme update 2016-04-02 18:58:27 +01:00
Ken Roberts 8a8695dc50 "Bugfix #1550891 Projector manager rejecting replies as invalid (backport from trunk)
--------------------------------
lp:~alisonken1/openlp/2.4-bug-1550891 (revision 2622)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1306/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1228/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1167/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1002/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_I..."

bzr-revno: 2622
2016-03-03 20:35:58 +02:00
Ken Roberts 045744dc17 Backport fix for non-standard reply for PJLink class request 2016-03-03 09:15:58 -08:00
503 changed files with 35624 additions and 25790 deletions

View File

@ -45,3 +45,4 @@ cover
*.kdev4
coverage
tags
output

12
CHANGELOG.rst Normal file
View File

@ -0,0 +1,12 @@
OpenLP 2.4.6
============
* Fix a bug where the author type upgrade was being ignore because it was looking at the wrong table
* Fix a bug where the songs_songbooks table was not being created because the if expression was the wrong way round
* Change the songs_songbooks migration SQL slightly to take into account a bug that has (hopefully) been fixed
* Sometimes the timer goes off as OpenLP is shutting down, and the application has already been deleted (reported via support system)
* Fix opening the data folder (KDE thought the old way was an SMB share)
* Fix a problem with the new QMediaPlayer not controlling the playlist anymore
* Add importing of author types to the OpenLP 2 song importer
* Fix a problem with loading Qt's translation files, bug #1676163
* Disable the controls in the shortcut dialog unless a shortcut is actually selected

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -5,7 +5,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -1 +1 @@
2.4
2.4.6

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -129,21 +129,21 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
application_stylesheet += WIN_REPAIR_STYLESHEET
if application_stylesheet:
self.setStyleSheet(application_stylesheet)
show_splash = Settings().value('core/show splash')
if show_splash:
can_show_splash = Settings().value('core/show splash')
if can_show_splash:
self.splash = SplashScreen()
self.splash.show()
# make sure Qt really display the splash screen
self.processEvents()
# Check if OpenLP has been upgrade and if a backup of data should be created
self.backup_on_upgrade(has_run_wizard)
self.backup_on_upgrade(has_run_wizard, can_show_splash)
# start the main app window
self.main_window = MainWindow()
Registry().execute('bootstrap_initialise')
Registry().execute('bootstrap_post_set_up')
Registry().initialise = False
self.main_window.show()
if show_splash:
if can_show_splash:
# now kill the splashscreen
self.splash.finish(self.main_window)
log.debug('Splashscreen closed')
@ -153,10 +153,10 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
self.processEvents()
if not has_run_wizard:
self.main_window.first_time()
# update_check = Settings().value('core/update check')
# if update_check:
# version = VersionThread(self.main_window)
# version.start()
update_check = Settings().value('core/update check')
if update_check:
version = VersionThread(self.main_window)
version.start()
self.main_window.is_display_blank()
self.main_window.app_startup()
return self.exec()
@ -177,6 +177,38 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
self.shared_memory.create(1)
return False
def is_data_path_missing(self):
"""
Check if the data folder path exists.
"""
data_folder_path = AppLocation.get_data_path()
if not os.path.exists(data_folder_path):
log.critical('Database was not found in: ' + data_folder_path)
status = QtWidgets.QMessageBox.critical(None, translate('OpenLP', 'Data Directory Error'),
translate('OpenLP', 'OpenLP data folder was not found in:\n\n{path}'
'\n\nThe location of the data folder was '
'previously changed from the OpenLP\'s '
'default location. If the data was stored on '
'removable device, that device needs to be '
'made available.\n\nYou may reset the data '
'location back to the default location, '
'or you can try to make the current location '
'available.\n\nDo you want to reset to the '
'default data location? If not, OpenLP will be '
'closed so you can try to fix the the problem.')
.format(path=data_folder_path),
QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
QtWidgets.QMessageBox.No),
QtWidgets.QMessageBox.No)
if status == QtWidgets.QMessageBox.No:
# If answer was "No", return "True", it will shutdown OpenLP in def main
log.info('User requested termination')
return True
# If answer was "Yes", remove the custom data path thus resetting the default location.
Settings().remove('advanced/data path')
log.info('Database location has been reset to the default settings.')
return False
def hook_exception(self, exc_type, value, traceback):
"""
Add an exception hook so that any uncaught exceptions are displayed in this window rather than somewhere where
@ -192,9 +224,15 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
self.exception_form = ExceptionForm()
self.exception_form.exception_text_edit.setPlainText(''.join(format_exception(exc_type, value, traceback)))
self.set_normal_cursor()
is_splash_visible = False
if hasattr(self, 'splash') and self.splash.isVisible():
is_splash_visible = True
self.splash.hide()
self.exception_form.exec()
if is_splash_visible:
self.splash.show()
def backup_on_upgrade(self, has_run_wizard):
def backup_on_upgrade(self, has_run_wizard, can_show_splash):
"""
Check if OpenLP has been upgraded, and ask if a backup of data should be made
@ -207,6 +245,8 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
Settings().setValue('core/application version', openlp_version)
# If data_version is different from the current version ask if we should backup the data folder
elif data_version != openlp_version:
if can_show_splash and self.splash.isVisible():
self.splash.hide()
if QtWidgets.QMessageBox.question(None, translate('OpenLP', 'Backup'),
translate('OpenLP', 'OpenLP has been upgraded, do you want to create '
'a backup of OpenLPs data folder?'),
@ -228,6 +268,8 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
% data_folder_backup_path)
# Update the version in the settings
Settings().setValue('core/application version', openlp_version)
if can_show_splash:
self.splash.show()
def process_events(self):
"""
@ -275,7 +317,7 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication):
return QtWidgets.QApplication.event(self, event)
def parse_options(args):
def parse_options(args=None):
"""
Parse the command line arguments
@ -342,6 +384,7 @@ def main(args=None):
application.setOrganizationName('OpenLP')
application.setOrganizationDomain('openlp.org')
application.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)
application.setAttribute(QtCore.Qt.AA_DontCreateNativeWidgetSiblings, True)
if args and args.portable:
application.setApplicationName('OpenLPPortable')
Settings.setDefaultFormat(Settings.IniFormat)
@ -367,9 +410,13 @@ def main(args=None):
Registry.create()
Registry().register('application', application)
application.setApplicationVersion(get_application_version()['version'])
# Instance check
# Check if an instance of OpenLP is already running. Quit if there is a running instance and the user only wants one
if application.is_already_running():
sys.exit()
# If the custom data path is missing and the user wants to restore the data path, quit OpenLP.
if application.is_data_path_missing():
application.shared_memory.detach()
sys.exit()
# Remove/convert obsolete settings.
Settings().remove_obsolete_settings()
# First time checks in settings
@ -379,13 +426,12 @@ def main(args=None):
sys.exit()
# i18n Set Language
language = LanguageManager.get_language()
application_translator, default_translator = LanguageManager.get_translator(language)
if not application_translator.isEmpty():
application.installTranslator(application_translator)
if not default_translator.isEmpty():
application.installTranslator(default_translator)
else:
log.debug('Could not find default_translator.')
translators = LanguageManager.get_translator(language)
for translator in translators:
if not translator.isEmpty():
application.installTranslator(translator)
if not translators:
log.debug('Could not find translators.')
if args and not args.no_error_form:
sys.excepthook = application.hook_exception
sys.exit(application.run(qt_args))

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -219,7 +219,8 @@ def qmd5_hash(salt, data=None):
log.debug('qmd5_hash(salt="%s"' % salt)
hash_obj = QHash(QHash.Md5)
hash_obj.addData(salt)
hash_obj.addData(data)
if data:
hash_obj.addData(data)
hash_value = hash_obj.result().toHex()
log.debug('qmd5_hash() returning "%s"' % hash_value)
return hash_value.data()

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -297,7 +297,11 @@ PJLINK_ERST_STATUS = {'0': ERROR_STRING[E_OK],
PJLINK_POWR_STATUS = {'0': S_STANDBY,
'1': S_ON,
'2': S_COOLDOWN,
'3': S_WARMUP}
'3': S_WARMUP,
S_STANDBY: '0',
S_ON: '1',
S_COOLDOWN: '2',
S_WARMUP: '3'}
PJLINK_DEFAULT_SOURCES = {'1': translate('OpenLP.DB', 'RGB'),
'2': translate('OpenLP.DB', 'Video'),

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -49,7 +49,7 @@ from codecs import decode
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PyQt5.QtNetwork import QAbstractSocket, QTcpSocket
from openlp.core.common import translate, qmd5_hash
from openlp.core.common import translate, md5_hash
from openlp.core.lib.projector.constants import *
# Shortcuts
@ -58,7 +58,7 @@ SocketSTate = QAbstractSocket.SocketState
PJLINK_PREFIX = '%'
PJLINK_CLASS = '1'
PJLINK_HEADER = '%s%s' % (PJLINK_PREFIX, PJLINK_CLASS)
PJLINK_HEADER = '{prefix}{linkclass}'.format(prefix=PJLINK_PREFIX, linkclass=PJLINK_CLASS)
PJLINK_SUFFIX = CR
@ -68,7 +68,7 @@ class PJLink1(QTcpSocket):
"""
# Signals sent by this module
changeStatus = pyqtSignal(str, int, str)
projectorNetwork = pyqtSignal(int) # Projector network activity
projectorNetwork = pyqtSignal(str, int) # Projector network activity
projectorStatus = pyqtSignal(int) # Status update
projectorAuthentication = pyqtSignal(str) # Authentication error
projectorNoAuthentication = pyqtSignal(str) # PIN set and no authentication needed
@ -91,7 +91,7 @@ class PJLink1(QTcpSocket):
:param poll_time: Time (in seconds) to poll connected projector
:param socket_timeout: Time (in seconds) to abort the connection if no response
"""
log.debug('PJlink(args="%s" kwargs="%s")' % (args, kwargs))
log.debug('PJlink(args={args} kwargs={kwargs})'.format(args=args, kwargs=kwargs))
self.name = name
self.ip = ip
self.port = port
@ -147,7 +147,7 @@ class PJLink1(QTcpSocket):
"""
Reset projector-specific information to default
"""
log.debug('(%s) reset_information() connect status is %s' % (self.ip, self.state()))
log.debug('({ip}) reset_information() connect status is {state}'.format(ip=self.ip, state=self.state()))
self.power = S_OFF
self.pjlink_name = None
self.manufacturer = None
@ -160,8 +160,10 @@ class PJLink1(QTcpSocket):
self.source = None
self.other_info = None
if hasattr(self, 'timer'):
log.debug('({ip}): Calling timer.stop()'.format(ip=self.ip))
self.timer.stop()
if hasattr(self, 'socket_timer'):
log.debug('({ip}): Calling socket_timer.stop()'.format(ip=self.ip))
self.socket_timer.stop()
self.send_queue = []
self.send_busy = False
@ -170,7 +172,7 @@ class PJLink1(QTcpSocket):
"""
Connects signals to methods when thread is started.
"""
log.debug('(%s) Thread starting' % self.ip)
log.debug('({ip}) Thread starting'.format(ip=self.ip))
self.i_am_running = True
self.connected.connect(self.check_login)
self.disconnected.connect(self.disconnect_from_host)
@ -180,7 +182,7 @@ class PJLink1(QTcpSocket):
"""
Cleanups when thread is stopped.
"""
log.debug('(%s) Thread stopped' % self.ip)
log.debug('({ip}) Thread stopped'.format(ip=self.ip))
try:
self.connected.disconnect(self.check_login)
except TypeError:
@ -206,7 +208,7 @@ class PJLink1(QTcpSocket):
Aborts connection and closes socket in case of brain-dead projectors.
Should normally be called by socket_timer().
"""
log.debug('(%s) socket_abort() - Killing connection' % self.ip)
log.debug('({ip}) socket_abort() - Killing connection'.format(ip=self.ip))
self.disconnect_from_host(abort=True)
def poll_loop(self):
@ -216,7 +218,7 @@ class PJLink1(QTcpSocket):
"""
if self.state() != self.ConnectedState:
return
log.debug('(%s) Updating projector status' % self.ip)
log.debug('({ip}) Updating projector status'.format(ip=self.ip))
# Reset timer in case we were called from a set command
if self.timer.interval() < self.poll_time:
# Reset timer to 5 seconds
@ -276,11 +278,17 @@ class PJLink1(QTcpSocket):
self.status_connect = S_CONNECTED
self.projector_status = status
(status_code, status_message) = self._get_status(self.status_connect)
log.debug('(%s) status_connect: %s: %s' % (self.ip, status_code, status_message if msg is None else msg))
log.debug('({ip}) status_connect: {code}: "{message}"'.format(ip=self.ip,
code=status_code,
message=status_message if msg is None else msg))
(status_code, status_message) = self._get_status(self.projector_status)
log.debug('(%s) projector_status: %s: %s' % (self.ip, status_code, status_message if msg is None else msg))
log.debug('({ip}) projector_status: {code}: "{message}"'.format(ip=self.ip,
code=status_code,
message=status_message if msg is None else msg))
(status_code, status_message) = self._get_status(self.error_status)
log.debug('(%s) error_status: %s: %s' % (self.ip, status_code, status_message if msg is None else msg))
log.debug('({ip}) error_status: {code}: "{message}"'.format(ip=self.ip,
code=status_code,
message=status_message if msg is None else msg))
self.changeStatus.emit(self.ip, status, message)
@pyqtSlot()
@ -289,29 +297,31 @@ class PJLink1(QTcpSocket):
Processes the initial connection and authentication (if needed).
Starts poll timer if connection is established.
NOTE: Qt md5 hash function doesn't work with projector authentication. Use the python md5 hash function.
:param data: Optional data if called from another routine
"""
log.debug('(%s) check_login(data="%s")' % (self.ip, data))
log.debug('({ip}) check_login(data="{data}")'.format(ip=self.ip, data=data))
if data is None:
# Reconnected setup?
if not self.waitForReadyRead(2000):
# Possible timeout issue
log.error('(%s) Socket timeout waiting for login' % self.ip)
log.error('({ip}) Socket timeout waiting for login'.format(ip=self.ip))
self.change_status(E_SOCKET_TIMEOUT)
return
read = self.readLine(self.maxSize)
dontcare = self.readLine(self.maxSize) # Clean out the trailing \r\n
if read is None:
log.warn('(%s) read is None - socket error?' % self.ip)
log.warning('({ip}) read is None - socket error?'.format(ip=self.ip))
return
elif len(read) < 8:
log.warn('(%s) Not enough data read)' % self.ip)
log.warning('({ip}) Not enough data read)'.format(ip=self.ip))
return
data = decode(read, 'ascii')
# Possibility of extraneous data on input when reading.
# Clean out extraneous characters in buffer.
dontcare = self.readLine(self.maxSize)
log.debug('(%s) check_login() read "%s"' % (self.ip, data.strip()))
log.debug('({ip}) check_login() read "{data}"'.format(ip=self.ip, data=data.strip()))
# At this point, we should only have the initial login prompt with
# possible authentication
# PJLink initial login will be:
@ -326,26 +336,35 @@ class PJLink1(QTcpSocket):
else:
# Process initial connection
data_check = data.strip().split(' ')
log.debug('(%s) data_check="%s"' % (self.ip, data_check))
log.debug('({ip}) data_check="{data}"'.format(ip=self.ip, data=data_check))
# Check for projector reporting an error
if data_check[1].upper() == 'ERRA':
# Authentication error
self.disconnect_from_host()
self.change_status(E_AUTHENTICATION)
log.debug('(%s) emitting projectorAuthentication() signal' % self.name)
log.debug('({ip}) emitting projectorAuthentication() signal'.format(ip=self.name))
return
elif data_check[1] == '0' and self.pin is not None:
# Pin set and no authentication needed
log.warning('({ip}) Regular connection but PIN set'.format(ip=self.name))
self.disconnect_from_host()
self.change_status(E_AUTHENTICATION)
log.debug('(%s) emitting projectorNoAuthentication() signal' % self.name)
log.debug('({ip}) Emitting projectorNoAuthentication() signal'.format(ip=self.name))
self.projectorNoAuthentication.emit(self.name)
return
elif data_check[1] == '1':
# Authenticated login with salt
log.debug('(%s) Setting hash with salt="%s"' % (self.ip, data_check[2]))
log.debug('(%s) pin="%s"' % (self.ip, self.pin))
salt = qmd5_hash(salt=data_check[2].encode('ascii'), data=self.pin.encode('ascii'))
if self.pin is None:
log.warning('({ip}) Authenticated connection but no pin set'.format(ip=self.name))
self.disconnect_from_host()
self.change_status(E_AUTHENTICATION)
log.debug('({ip}) Emitting projectorAuthentication() signal'.format(ip=self.name))
self.projectorAuthentication.emit(self.name)
return
else:
log.debug('({ip}) Setting hash with salt="{data}"'.format(ip=self.ip, data=data_check[2]))
log.debug('({ip}) pin="{data}"'.format(ip=self.ip, data=self.pin))
salt = md5_hash(salt=data_check[2].encode('ascii'), data=self.pin.encode('ascii'))
else:
salt = None
# We're connected at this point, so go ahead and do regular I/O
@ -355,7 +374,7 @@ class PJLink1(QTcpSocket):
self.send_command(cmd='CLSS', salt=salt)
self.waitForReadyRead()
if (not self.no_poll) and (self.state() == self.ConnectedState):
log.debug('(%s) Starting timer' % self.ip)
log.debug('({ip}) Starting timer'.format(ip=self.ip))
self.timer.setInterval(2000) # Set 2 seconds for initial information
self.timer.start()
@ -364,29 +383,29 @@ class PJLink1(QTcpSocket):
"""
Socket interface to retrieve data.
"""
log.debug('(%s) get_data(): Reading data' % self.ip)
log.debug('({ip}) get_data(): Reading data'.format(ip=self.ip))
if self.state() != self.ConnectedState:
log.debug('(%s) get_data(): Not connected - returning' % self.ip)
log.debug('({ip}) get_data(): Not connected - returning'.format(ip=self.ip))
self.send_busy = False
return
read = self.readLine(self.maxSize)
if read == -1:
# No data available
log.debug('(%s) get_data(): No data available (-1)' % self.ip)
log.debug('({ip}) get_data(): No data available (-1)'.format(ip=self.ip))
self.send_busy = False
self.projectorReceivedData.emit()
return
self.socket_timer.stop()
self.projectorNetwork.emit(S_NETWORK_RECEIVED)
self.projectorNetwork.emit(self.ip, S_NETWORK_RECEIVED)
data_in = decode(read, 'ascii')
data = data_in.strip()
if len(data) < 7:
# Not enough data for a packet
log.debug('(%s) get_data(): Packet length < 7: "%s"' % (self.ip, data))
log.debug('({ip}) get_data(): Packet length < 7: "{data}"'.format(ip=self.ip, data=data))
self.send_busy = False
self.projectorReceivedData.emit()
return
log.debug('(%s) get_data(): Checking new data "%s"' % (self.ip, data))
log.debug('({ip}) get_data(): Checking new data "{data}"'.format(ip=self.ip, data=data))
if data.upper().startswith('PJLINK'):
# Reconnected from remote host disconnect ?
self.check_login(data)
@ -394,7 +413,7 @@ class PJLink1(QTcpSocket):
self.projectorReceivedData.emit()
return
elif '=' not in data:
log.warn('(%s) get_data(): Invalid packet received' % self.ip)
log.warning('({ip}) get_data(): Invalid packet received'.format(ip=self.ip))
self.send_busy = False
self.projectorReceivedData.emit()
return
@ -402,21 +421,21 @@ class PJLink1(QTcpSocket):
try:
(prefix, class_, cmd, data) = (data_split[0][0], data_split[0][1], data_split[0][2:], data_split[1])
except ValueError as e:
log.warn('(%s) get_data(): Invalid packet - expected header + command + data' % self.ip)
log.warn('(%s) get_data(): Received data: "%s"' % (self.ip, read))
log.warning('({ip}) get_data(): Invalid packet - expected header + command + data'.format(ip=self.ip))
log.warning('({ip}) get_data(): Received data: "{data}"'.format(ip=self.ip, data=data_in.strip()))
self.change_status(E_INVALID_DATA)
self.send_busy = False
self.projectorReceivedData.emit()
return
if not (self.pjlink_class in PJLINK_VALID_CMD and cmd in PJLINK_VALID_CMD[self.pjlink_class]):
log.warn('(%s) get_data(): Invalid packet - unknown command "%s"' % (self.ip, cmd))
log.warning('({ip}) get_data(): Invalid packet - unknown command "{data}"'.format(ip=self.ip, data=cmd))
self.send_busy = False
self.projectorReceivedData.emit()
return
return self.process_command(cmd, data)
@pyqtSlot(int)
@pyqtSlot(QAbstractSocket.SocketError)
def get_error(self, err):
"""
Process error from SocketError signal.
@ -424,7 +443,7 @@ class PJLink1(QTcpSocket):
:param err: Error code
"""
log.debug('(%s) get_error(err=%s): %s' % (self.ip, err, self.errorString()))
log.debug('({ip}) get_error(err={error}): {data}'.format(ip=self.ip, error=err, data=self.errorString()))
if err <= 18:
# QSocket errors. Redefined in projector.constants so we don't mistake
# them for system errors
@ -453,10 +472,10 @@ class PJLink1(QTcpSocket):
:param queue: Option to force add to queue rather than sending directly
"""
if self.state() != self.ConnectedState:
log.warn('(%s) send_command(): Not connected - returning' % self.ip)
log.warning('({ip}) send_command(): Not connected - returning'.format(ip=self.ip))
self.send_queue = []
return
self.projectorNetwork.emit(S_NETWORK_SENDING)
self.projectorNetwork.emit(self.ip, S_NETWORK_SENDING)
log.debug('(%s) send_command(): Building cmd="%s" opts="%s" %s' % (self.ip,
cmd,
opts,
@ -467,18 +486,19 @@ class PJLink1(QTcpSocket):
out = '%s%s%s %s%s' % (salt, PJLINK_HEADER, cmd, opts, CR)
if out in self.send_queue:
# Already there, so don't add
log.debug('(%s) send_command(out="%s") Already in queue - skipping' % (self.ip, out.strip()))
log.debug('({ip}) send_command(out="{data}") Already in queue - skipping'.format(ip=self.ip,
data=out.strip()))
elif not queue and len(self.send_queue) == 0:
# Nothing waiting to send, so just send it
log.debug('(%s) send_command(out="%s") Sending data' % (self.ip, out.strip()))
log.debug('({ip}) send_command(out="{data}") Sending data'.format(ip=self.ip, data=out.strip()))
return self._send_command(data=out)
else:
log.debug('(%s) send_command(out="%s") adding to queue' % (self.ip, out.strip()))
log.debug('({ip}) send_command(out="{data}") adding to queue'.format(ip=self.ip, data=out.strip()))
self.send_queue.append(out)
self.projectorReceivedData.emit()
log.debug('(%s) send_command(): send_busy is %s' % (self.ip, self.send_busy))
log.debug('({ip}) send_command(): send_busy is {data}'.format(ip=self.ip, data=self.send_busy))
if not self.send_busy:
log.debug('(%s) send_command() calling _send_string()')
log.debug('({ip}) send_command() calling _send_string()'.format(ip=self.ip))
self._send_command()
@pyqtSlot()
@ -488,10 +508,10 @@ class PJLink1(QTcpSocket):
:param data: Immediate data to send
"""
log.debug('(%s) _send_string()' % self.ip)
log.debug('(%s) _send_string(): Connection status: %s' % (self.ip, self.state()))
log.debug('({ip}) _send_string()'.format(ip=self.ip))
log.debug('({ip}) _send_string(): Connection status: {data}'.format(ip=self.ip, data=self.state()))
if self.state() != self.ConnectedState:
log.debug('(%s) _send_string() Not connected - abort' % self.ip)
log.debug('({ip}) _send_string() Not connected - abort'.format(ip=self.ip))
self.send_queue = []
self.send_busy = False
return
@ -500,22 +520,22 @@ class PJLink1(QTcpSocket):
return
if data is not None:
out = data
log.debug('(%s) _send_string(data=%s)' % (self.ip, out.strip()))
log.debug('({ip}) _send_string(data="{data}")'.format(ip=self.ip, data=out.strip()))
elif len(self.send_queue) != 0:
out = self.send_queue.pop(0)
log.debug('(%s) _send_string(queued data=%s)' % (self.ip, out.strip()))
log.debug('({ip}) _send_string(queued data="{data}"%s)'.format(ip=self.ip, data=out.strip()))
else:
# No data to send
log.debug('(%s) _send_string(): No data to send' % self.ip)
log.debug('({ip}) _send_string(): No data to send'.format(ip=self.ip))
self.send_busy = False
return
self.send_busy = True
log.debug('(%s) _send_string(): Sending "%s"' % (self.ip, out.strip()))
log.debug('(%s) _send_string(): Queue = %s' % (self.ip, self.send_queue))
log.debug('({ip}) _send_string(): Sending "{data}"'.format(ip=self.ip, data=out.strip()))
log.debug('({ip}) _send_string(): Queue = {data}'.format(ip=self.ip, data=self.send_queue))
self.socket_timer.start()
try:
self.projectorNetwork.emit(S_NETWORK_SENDING)
sent = self.write(out)
self.projectorNetwork.emit(self.ip, S_NETWORK_SENDING)
sent = self.write(out.encode('ascii'))
self.waitForBytesWritten(2000) # 2 seconds should be enough
if sent == -1:
# Network error?
@ -523,7 +543,9 @@ class PJLink1(QTcpSocket):
translate('OpenLP.PJLink1', 'Error while sending data to projector'))
except SocketError as e:
self.disconnect_from_host(abort=True)
self.changeStatus(E_NETWORK, '%s : %s' % (e.error(), e.errorString()))
self.changeStatus(E_NETWORK,
translate('OpenLP.PJLink1', '{code} : {string}').format(code=e.error(),
string=e.errorString()))
def process_command(self, cmd, data):
"""
@ -532,19 +554,21 @@ class PJLink1(QTcpSocket):
:param cmd: Command to process
:param data: Data being processed
"""
log.debug('(%s) Processing command "%s"' % (self.ip, cmd))
log.debug('({ip}) Processing command "{data}"'.format(ip=self.ip, data=cmd))
if data in PJLINK_ERRORS:
# Oops - projector error
log.error('({ip}) Projector returned error "{data}"'.format(ip=self.ip, data=data))
if data.upper() == 'ERRA':
# Authentication error
self.disconnect_from_host()
self.change_status(E_AUTHENTICATION)
log.debug('(%s) emitting projectorAuthentication() signal' % self.ip)
log.debug('({ip}) emitting projectorAuthentication() signal'.format(ip=self.ip))
self.projectorAuthentication.emit(self.name)
elif data.upper() == 'ERR1':
# Undefined command
self.change_status(E_UNDEFINED, '%s "%s"' %
(translate('OpenLP.PJLink1', 'Undefined command:'), cmd))
self.change_status(E_UNDEFINED, '{error} "{data}"'.format(error=translate('OpenLP.PJLink1',
'Undefined command:'),
data=cmd))
elif data.upper() == 'ERR2':
# Invalid parameter
self.change_status(E_PARAMETER)
@ -559,7 +583,7 @@ class PJLink1(QTcpSocket):
return
# Command succeeded - no extra information
elif data.upper() == 'OK':
log.debug('(%s) Command returned OK' % self.ip)
log.debug('({ip}) Command returned OK'.format(ip=self.ip))
# A command returned successfully, recheck data
self.send_busy = False
self.projectorReceivedData.emit()
@ -568,7 +592,7 @@ class PJLink1(QTcpSocket):
if cmd in self.PJLINK1_FUNC:
self.PJLINK1_FUNC[cmd](data)
else:
log.warn('(%s) Invalid command %s' % (self.ip, cmd))
log.warning('({ip}) Invalid command {data}'.format(ip=self.ip, data=cmd))
self.send_busy = False
self.projectorReceivedData.emit()
@ -587,7 +611,7 @@ class PJLink1(QTcpSocket):
fill = {'Hours': int(data_dict[0]), 'On': False if data_dict[1] == '0' else True}
except ValueError:
# In case of invalid entry
log.warn('(%s) process_lamp(): Invalid data "%s"' % (self.ip, data))
log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
return
lamps.append(fill)
data_dict.pop(0) # Remove lamp hours
@ -614,7 +638,7 @@ class PJLink1(QTcpSocket):
self.send_command('INST')
else:
# Log unknown status response
log.warn('Unknown power response: %s' % data)
log.warning('({ip}) Unknown power response: {data}'.format(ip=self.ip, data=data))
return
def process_avmt(self, data):
@ -639,7 +663,7 @@ class PJLink1(QTcpSocket):
shutter = True
mute = True
else:
log.warn('Unknown shutter response: %s' % data)
log.warning('({ip}) Unknown shutter response: {data}'.format(ip=self.ip, data=data))
update_icons = shutter != self.shutter
update_icons = update_icons or mute != self.mute
self.shutter = shutter
@ -656,6 +680,7 @@ class PJLink1(QTcpSocket):
:param data: Currently selected source
"""
self.source = data
log.info('({ip}) Setting data source to "{data}"'.format(ip=self.ip, data=self.source))
return
def process_clss(self, data):
@ -665,8 +690,17 @@ class PJLink1(QTcpSocket):
:param data: Class that projector supports.
"""
self.pjlink_class = data
log.debug('(%s) Setting pjlink_class for this projector to "%s"' % (self.ip, self.pjlink_class))
# bug 1550891: Projector returns non-standard class response:
# : Expected: %1CLSS=1
# : Received: %1CLSS=Class 1
if len(data) > 1:
# Split non-standard information from response
clss = data.split()[-1]
else:
clss = data
self.pjlink_class = clss
log.debug('({ip}) Setting pjlink_class for this projector to "{data}"'.format(ip=self.ip,
data=self.pjlink_class))
return
def process_name(self, data):
@ -677,6 +711,7 @@ class PJLink1(QTcpSocket):
:param data: Projector name
"""
self.pjlink_name = data
log.debug('({ip}) Setting projector PJLink name to "{data}"'.format(ip=self.ip, data=self.pjlink_name))
return
def process_inf1(self, data):
@ -687,6 +722,7 @@ class PJLink1(QTcpSocket):
:param data: Projector manufacturer
"""
self.manufacturer = data
log.debug('({ip}) Setting projector manufacturer data to "{data}"'.format(ip=self.ip, data=self.manufacturer))
return
def process_inf2(self, data):
@ -697,6 +733,7 @@ class PJLink1(QTcpSocket):
:param data: Model name
"""
self.model = data
log.debug('({ip}) Setting projector model to "{data}"'.format(ip=self.ip, data=self.model))
return
def process_info(self, data):
@ -707,6 +744,7 @@ class PJLink1(QTcpSocket):
:param data: Projector other info
"""
self.other_info = data
log.debug('({ip}) Setting projector other_info to "{data}"'.format(ip=self.ip, data=self.other_info))
return
def process_inst(self, data):
@ -723,6 +761,8 @@ class PJLink1(QTcpSocket):
sources.sort()
self.source_available = sources
self.projectorUpdateIcons.emit()
log.debug('({ip}) Setting projector sources_available to "{data}"'.format(ip=self.ip,
data=self.source_available))
return
def process_erst(self, data):
@ -772,7 +812,7 @@ class PJLink1(QTcpSocket):
Initiate connection to projector.
"""
if self.state() == self.ConnectedState:
log.warn('(%s) connect_to_host(): Already connected - returning' % self.ip)
log.warning('({ip}) connect_to_host(): Already connected - returning'.format(ip=self.ip))
return
self.change_status(S_CONNECTING)
self.connectToHost(self.ip, self.port if type(self.port) is int else int(self.port))
@ -784,9 +824,9 @@ class PJLink1(QTcpSocket):
"""
if abort or self.state() != self.ConnectedState:
if abort:
log.warn('(%s) disconnect_from_host(): Aborting connection' % self.ip)
log.warning('({ip}) disconnect_from_host(): Aborting connection'.format(ip=self.ip))
else:
log.warn('(%s) disconnect_from_host(): Not connected - returning' % self.ip)
log.warning('({ip}) disconnect_from_host(): Not connected - returning'.format(ip=self.ip))
self.reset_information()
self.disconnectFromHost()
try:
@ -796,8 +836,8 @@ class PJLink1(QTcpSocket):
if abort:
self.change_status(E_NOT_CONNECTED)
else:
log.debug('(%s) disconnect_from_host() Current status %s' % (self.ip,
self._get_status(self.status_connect)[0]))
log.debug('({ip}) disconnect_from_host() '
'Current status {data}'.format(ip=self.ip, data=self._get_status(self.status_connect)[0]))
if self.status_connect != E_NOT_CONNECTED:
self.change_status(S_NOT_CONNECTED)
self.reset_information()
@ -807,60 +847,70 @@ class PJLink1(QTcpSocket):
"""
Send command to retrieve available source inputs.
"""
log.debug('({ip}) Sending INST command'.format(ip=self.ip))
return self.send_command(cmd='INST')
def get_error_status(self):
"""
Send command to retrieve currently known errors.
"""
log.debug('({ip}) Sending ERST command'.format(ip=self.ip))
return self.send_command(cmd='ERST')
def get_input_source(self):
"""
Send command to retrieve currently selected source input.
"""
log.debug('({ip}) Sending INPT command'.format(ip=self.ip))
return self.send_command(cmd='INPT')
def get_lamp_status(self):
"""
Send command to return the lap status.
"""
log.debug('({ip}) Sending LAMP command'.format(ip=self.ip))
return self.send_command(cmd='LAMP')
def get_manufacturer(self):
"""
Send command to retrieve manufacturer name.
"""
log.debug('({ip}) Sending INF1 command'.format(ip=self.ip))
return self.send_command(cmd='INF1')
def get_model(self):
"""
Send command to retrieve the model name.
"""
log.debug('({ip}) Sending INF2 command'.format(ip=self.ip))
return self.send_command(cmd='INF2')
def get_name(self):
"""
Send command to retrieve name as set by end-user (if set).
"""
log.debug('({ip}) Sending NAME command'.format(ip=self.ip))
return self.send_command(cmd='NAME')
def get_other_info(self):
"""
Send command to retrieve extra info set by manufacturer.
"""
log.debug('({ip}) Sending INFO command'.format(ip=self.ip))
return self.send_command(cmd='INFO')
def get_power_status(self):
"""
Send command to retrieve power status.
"""
log.debug('({ip}) Sending POWR command'.format(ip=self.ip))
return self.send_command(cmd='POWR')
def get_shutter_status(self):
"""
Send command to retrieve shutter status.
"""
log.debug('({ip}) Sending AVMT command'.format(ip=self.ip))
return self.send_command(cmd='AVMT')
def set_input_source(self, src=None):
@ -870,12 +920,12 @@ class PJLink1(QTcpSocket):
:param src: Video source to select in projector
"""
log.debug('(%s) set_input_source(src=%s)' % (self.ip, src))
log.debug('({ip}) set_input_source(src="{data}")'.format(ip=self.ip, data=src))
if self.source_available is None:
return
elif src not in self.source_available:
return
log.debug('(%s) Setting input source to %s' % (self.ip, src))
log.debug('({ip}) Setting input source to "{data}"'.format(ip=self.ip, data=src))
self.send_command(cmd='INPT', opts=src)
self.poll_loop()
@ -883,6 +933,7 @@ class PJLink1(QTcpSocket):
"""
Send command to turn power to on.
"""
log.debug('({ip}) Setting POWR to 1 (on)'.format(ip=self.ip))
self.send_command(cmd='POWR', opts='1')
self.poll_loop()
@ -890,6 +941,7 @@ class PJLink1(QTcpSocket):
"""
Send command to turn power to standby.
"""
log.debug('({ip}) Setting POWR to 0 (standby)'.format(ip=self.ip))
self.send_command(cmd='POWR', opts='0')
self.poll_loop()
@ -897,6 +949,7 @@ class PJLink1(QTcpSocket):
"""
Send command to set shutter to closed position.
"""
log.debug('({ip}) Setting AVMT to 11 (shutter closed)'.format(ip=self.ip))
self.send_command(cmd='AVMT', opts='11')
self.poll_loop()
@ -904,5 +957,6 @@ class PJLink1(QTcpSocket):
"""
Send command to set shutter to open position.
"""
log.debug('({ip}) Setting AVMT to "10" (shutter open)'.format(ip=self.ip))
self.send_command(cmd='AVMT', opts='10')
self.poll_loop()

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -142,6 +142,7 @@ class SpellTextEdit(QtWidgets.QPlainTextEdit):
"""
Replaces the selected text with word.
"""
tag = tag.replace('&', '')
for html in FormattingTags.get_html_tags():
if tag == html['desc']:
cursor = self.textCursor()

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -26,7 +26,7 @@ import os
from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import Registry
from openlp.core.common import Registry, is_win
class TreeWidgetWithDnD(QtWidgets.QTreeWidget):
@ -108,6 +108,11 @@ class TreeWidgetWithDnD(QtWidgets.QTreeWidget):
:param event: Handle of the event pint passed
"""
# If we are on Windows, OpenLP window will not be set on top. For example, user can drag images to Library and
# the folder stays on top of the group creation box. This piece of code fixes this issue.
if is_win():
self.setWindowState(self.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
self.setWindowState(QtCore.Qt.WindowNoState)
if event.mimeData().hasUrls():
event.setDropAction(QtCore.Qt.CopyAction)
event.accept()

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -298,8 +298,8 @@ class UiAboutDialog(object):
self.about_notebook.setTabText(self.about_notebook.indexOf(self.credits_tab),
translate('OpenLP.AboutForm', 'Credits'))
copyright_note = translate('OpenLP.AboutForm',
'Copyright \xa9 2004-2016 %s\n'
'Portions copyright \xa9 2004-2016 %s') % \
'Copyright (c) 2004-2017 %s\n'
'Portions copyright (c) 2004-2017 %s') % \
('Raoul Snyman',
'Tim Bentley, Gerald Britton, Jonathan Corwin, Samuel Findlay, '
'Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, '

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -180,11 +180,13 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties):
if ':' in line:
exception = line.split('\n')[-1].split(':')[0]
subject = 'Bug report: %s in %s' % (exception, source)
mail_to_url = QtCore.QUrlQuery('mailto:bugs@openlp.org')
mail_to_url.addQueryItem('subject', subject)
mail_to_url.addQueryItem('body', self.report_text % content)
mail_urlquery = QtCore.QUrlQuery()
mail_urlquery.addQueryItem('subject', subject)
mail_urlquery.addQueryItem('body', self.report_text % content)
if self.file_attachment:
mail_to_url.addQueryItem('attach', self.file_attachment)
mail_urlquery.addQueryItem('attach', self.file_attachment)
mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org')
mail_to_url.setQuery(mail_urlquery)
QtGui.QDesktopServices.openUrl(mail_to_url)
def on_description_updated(self):

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -159,7 +159,6 @@ class GeneralTab(SettingsTab):
self.startup_layout.addWidget(self.show_splash_check_box)
self.check_for_updates_check_box = QtWidgets.QCheckBox(self.startup_group_box)
self.check_for_updates_check_box.setObjectName('check_for_updates_check_box')
self.check_for_updates_check_box.setVisible(False)
self.startup_layout.addWidget(self.check_for_updates_check_box)
self.right_layout.addWidget(self.startup_group_box)
# Application Settings

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -672,7 +672,7 @@ class AudioPlayer(OpenLPMixin, QtCore.QObject):
"""
Skip forward to the next track in the list
"""
self.player.next()
self.playlist.next()
def go_to(self, index):
"""

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -52,21 +52,17 @@ from openlp.core.ui.printserviceform import PrintServiceForm
log = logging.getLogger(__name__)
MEDIA_MANAGER_STYLE = """
QToolBox {
padding-bottom: 2px;
}
QToolBox::tab {
::tab#media_tool_box {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 palette(button), stop: 1.0 palette(mid));
border: 1px solid palette(mid);
border-radius: 3px;
}
QToolBox::tab:selected {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 palette(light), stop: 1.0 palette(button));
border: 1px solid palette(mid);
font-weight: bold;
border: 0;
border-radius: 2px;
margin-bottom: 0;
margin-top: 0;
text-align: left;
}
/* This is here to make the tabs on KDE with the Breeze theme work */
::tab:selected {}
"""
PROGRESSBAR_STYLE = """
@ -180,6 +176,7 @@ class Ui_MainWindow(object):
self.projector_manager_contents = ProjectorManager(self.projector_manager_dock)
self.projector_manager_contents.setObjectName('projector_manager_contents')
self.projector_manager_dock.setWidget(self.projector_manager_contents)
self.projector_manager_dock.setVisible(False)
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.projector_manager_dock)
# Create the menu items
action_list = ActionList.get_instance()
@ -192,7 +189,7 @@ class Ui_MainWindow(object):
triggers=self.service_manager_contents.on_load_service_clicked)
self.file_save_item = create_action(main_window, 'fileSaveItem', icon=':/general/general_save.png',
can_shortcuts=True, category=UiStrings().File,
triggers=self.service_manager_contents.save_file)
triggers=self.service_manager_contents.decide_save_method)
self.file_save_as_item = create_action(main_window, 'fileSaveAsItem', can_shortcuts=True,
category=UiStrings().File,
triggers=self.service_manager_contents.save_file_as)
@ -799,7 +796,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
Open data folder
"""
path = AppLocation.get_data_path()
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
QtGui.QDesktopServices.openUrl(QtCore.QUrl.fromLocalFile(path))
def on_update_theme_images(self):
"""
@ -1379,7 +1376,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
if event.timerId() == self.timer_id:
self.timer_id = 0
self.load_progress_bar.hide()
self.application.process_events()
# Sometimes the timer goes off as OpenLP is shutting down, and the application has already been deleted
if self.application:
self.application.process_events()
def set_new_data_path(self, new_data_path):
"""

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -100,7 +100,7 @@ class SystemPlayer(MediaPlayer):
ext = '*%s' % extension
if ext not in mime_type_list:
mime_type_list.append(ext)
log.info('MediaPlugin: %s extensions: %s' % (mimetype, ' '.join(extensions)))
log.info('MediaPlugin: %s extensions: %s', mimetype, ' '.join(extensions))
def setup(self, display):
"""
@ -160,6 +160,13 @@ class SystemPlayer(MediaPlayer):
if start_time > 0:
self.seek(display, controller.media_info.start_time * 1000)
self.volume(display, controller.media_info.volume)
display.media_player.blockSignals(True)
try:
display.media_player.durationChanged.disconnect()
except TypeError:
# We get a type error if there are no slots attached to this signal, so ignore it
pass
display.media_player.blockSignals(False)
display.media_player.durationChanged.connect(functools.partial(self.set_duration, controller))
self.state = MediaState.Playing
display.video_widget.raise_()
@ -178,7 +185,11 @@ class SystemPlayer(MediaPlayer):
Stop the current media item
"""
display.media_player.blockSignals(True)
display.media_player.durationChanged.disconnect()
try:
display.media_player.durationChanged.disconnect()
except TypeError:
# We get a type error if there are no slots attached to this signal, so ignore it
pass
display.media_player.blockSignals(False)
display.media_player.stop()
self.set_visible(display, False)
@ -216,6 +227,9 @@ class SystemPlayer(MediaPlayer):
@staticmethod
def set_duration(controller, duration):
"""
Set the length of the seek slider
"""
controller.media_info.length = int(duration / 1000)
controller.seek_slider.setMaximum(controller.media_info.length * 1000)
@ -261,33 +275,34 @@ class SystemPlayer(MediaPlayer):
:return: True if file can be played otherwise False
"""
thread = QtCore.QThread()
check_media_player = CheckMedia(path)
check_media_player.setVolume(0)
check_media_player.moveToThread(thread)
check_media_player.finished.connect(thread.quit)
thread.started.connect(check_media_player.play)
check_media_worker = CheckMediaWorker(path)
check_media_worker.setVolume(0)
check_media_worker.moveToThread(thread)
check_media_worker.finished.connect(thread.quit)
thread.started.connect(check_media_worker.play)
thread.start()
while thread.isRunning():
self.application.processEvents()
return check_media_player.result
return check_media_worker.result
class CheckMedia(QtMultimedia.QMediaPlayer):
class CheckMediaWorker(QtMultimedia.QMediaPlayer):
"""
Class used to check if a media file is playable
"""
finished = QtCore.pyqtSignal()
def __init__(self, path):
super(CheckMedia, self).__init__(None, QtMultimedia.QMediaPlayer.VideoSurface)
super(CheckMediaWorker, self).__init__(None, QtMultimedia.QMediaPlayer.VideoSurface)
self.result = None
self.error.connect(functools.partial(self.signals, 'error'))
self.mediaStatusChanged.connect(functools.partial(self.signals, 'media'))
self.setMedia(QtMultimedia.QMediaContent(QtCore.QUrl.fromLocalFile(path)))
def signals(self, origin, status):
"""
Exit the worker and stop the thread when either an error or a media change is encountered
"""
if origin == 'media' and status == self.BufferedMedia:
self.result = True
self.stop()

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -54,7 +54,7 @@ class MediaDockManager(object):
match = True
break
if not match:
self.media_dock.addItem(media_item, visible_title['title'])
self.media_dock.addItem(media_item, media_item.plugin.icon, visible_title['title'])
def remove_dock(self, media_item):
"""

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -61,6 +61,9 @@ STATUS_ICONS = {S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
}
STATUS_NETWORK_BUSY = [S_CONNECTING, S_NETWORK_SENDING]
STATUS_NETWORK_FREE = [E_NETWORK, E_UNKNOWN_SOCKET_ERROR, E_NOT_CONNECTED, S_NETWORK_RECEIVED]
class Ui_ProjectorManager(object):
"""
@ -288,6 +291,8 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QWidget, Ui_ProjectorManager,
self.projectordb = projectordb
self.projector_list = []
self.source_select_form = None
self.network_list = {} # Currently active network communications keyed on IP
self.network_busy = False
def bootstrap_initialise(self):
"""
@ -482,7 +487,7 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QWidget, Ui_ProjectorManager,
if ans == msg.Cancel:
return
try:
projector.link.projectorNetwork.disconnect(self.update_status)
projector.link.projectorNetwork.disconnect(self.update_network_status)
except (AttributeError, TypeError):
pass
try:
@ -720,7 +725,7 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QWidget, Ui_ProjectorManager,
thread.started.connect(item.link.thread_started)
thread.finished.connect(item.link.thread_stopped)
thread.finished.connect(thread.deleteLater)
item.link.projectorNetwork.connect(self.update_status)
item.link.projectorNetwork.connect(self.update_network_status)
item.link.changeStatus.connect(self.update_status)
item.link.projectorAuthentication.connect(self.authentication_error)
item.link.projectorNoAuthentication.connect(self.no_authentication_error)
@ -790,6 +795,39 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QWidget, Ui_ProjectorManager,
"""
return self.projector_list
@pyqtSlot(str, int)
def update_network_status(self, ip, status):
"""
Update network busy icon
NOTE: Placeholder for bugfix 1588369. Permanent fix will be in trunk for 2.6.
:param ip: IP of destination
:param status: Status code
"""
log.debug('update_network_status(ip="%s" status=%d)' % (ip, status))
# Keep track of what connections are currently being chatty
if status in STATUS_NETWORK_BUSY:
if ip not in self.network_list:
log.debug('Adding %s to network list' % ip)
self.network_list[ip] = status
elif status in STATUS_NETWORK_FREE:
if ip in self.network_list:
log.debug('Removing %s from network list' % ip)
self.network_list.pop(ip)
else:
log.warn('"%s" not in network list - something got dropped in setting?')
else:
log.warn('Unknown network status update: ip="%s" stutus: %s' % (ip, status))
# Check for turnin on/off network busy icon
if self.network_list:
log.debug('network list: %s' % self.network_list)
log.debug('Turning on network busy icon')
self.network_busy = True
else:
log.debug('No network chatter - turning off network busy icon')
self.network_busy = False
@pyqtSlot(str, int, str)
def update_status(self, ip, status=None, msg=None):
"""

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -20,24 +20,21 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
:mod: `openlp.core.ui.projector.sourceselectform` module
:mod: `openlp.core.ui.projector.sourceselectform` module
Provides the dialog window for selecting video source for projector.
Provides the dialog window for selecting video source for projector.
"""
import logging
log = logging.getLogger(__name__)
log.debug('editform loaded')
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import pyqtSlot, QSize
from PyQt5.QtWidgets import QDialog, QButtonGroup, QDialogButtonBox, QFormLayout, QLineEdit, QRadioButton, \
QStyle, QStylePainter, QStyleOptionTab, QTabBar, QTabWidget, QVBoxLayout, QWidget
from openlp.core.common import translate, is_macosx
from openlp.core.lib import build_icon
from openlp.core.lib.projector.db import ProjectorSource
from openlp.core.lib.projector.constants import PJLINK_DEFAULT_SOURCES, PJLINK_DEFAULT_CODES
log = logging.getLogger(__name__)
def source_group(inputs, source_text):
"""
@ -64,9 +61,8 @@ def source_group(inputs, source_text):
"""
groupdict = {}
keydict = {}
checklist = inputs
key = checklist[0][0]
for item in checklist:
key = inputs[0][0]
for item in inputs:
if item[0] == key:
groupdict[item] = source_text[item]
continue
@ -78,7 +74,7 @@ def source_group(inputs, source_text):
return keydict
def Build_Tab(group, source_key, default, projector, projectordb, edit=False):
def build_tab(group, source_key, default, projector, projectordb, edit=False):
"""
Create the radio button page for a tab.
Dictionary will be a 1-key entry where key=tab to setup, val=list of inputs.
@ -104,8 +100,8 @@ def Build_Tab(group, source_key, default, projector, projectordb, edit=False):
:param edit: If we're editing the source text
"""
buttonchecked = False
widget = QWidget()
layout = QFormLayout() if edit else QVBoxLayout()
widget = QtWidgets.QWidget()
layout = QtWidgets.QFormLayout() if edit else QtWidgets.QVBoxLayout()
layout.setSpacing(10)
widget.setLayout(layout)
tempkey = list(source_key.keys())[0] # Should only be 1 key
@ -114,7 +110,7 @@ def Build_Tab(group, source_key, default, projector, projectordb, edit=False):
button_count = len(sourcelist)
if edit:
for key in sourcelist:
item = QLineEdit()
item = QtWidgets.QLineEdit()
item.setObjectName('source_key_%s' % key)
source_item = projectordb.get_source_by_code(code=key, projector_id=projector.db_item.id)
if source_item is None:
@ -130,7 +126,7 @@ def Build_Tab(group, source_key, default, projector, projectordb, edit=False):
text = source_key[tempkey][key]
else:
text = source_item.text
itemwidget = QRadioButton(text)
itemwidget = QtWidgets.QRadioButton(text)
itemwidget.setAutoExclusive(True)
if default == key:
itemwidget.setChecked(True)
@ -141,30 +137,30 @@ def Build_Tab(group, source_key, default, projector, projectordb, edit=False):
return widget, button_count, buttonchecked
def set_button_tooltip(bar):
def set_button_tooltip(button_bar):
"""
Set the toolip for the standard buttons used
:param bar: QDialogButtonBar instance to update
"""
for button in bar.buttons():
if bar.standardButton(button) == QDialogButtonBox.Cancel:
for button in button_bar.buttons():
if button_bar.standardButton(button) == QtWidgets.QDialogButtonBox.Cancel:
button.setToolTip(translate('OpenLP.SourceSelectForm',
'Ignoring current changes and return to OpenLP'))
elif bar.standardButton(button) == QDialogButtonBox.Reset:
elif button_bar.standardButton(button) == QtWidgets.QDialogButtonBox.Reset:
button.setToolTip(translate('OpenLP.SourceSelectForm',
'Delete all user-defined text and revert to PJLink default text'))
elif bar.standardButton(button) == QDialogButtonBox.Discard:
elif button_bar.standardButton(button) == QtWidgets.QDialogButtonBox.Discard:
button.setToolTip(translate('OpenLP.SourceSelectForm',
'Discard changes and reset to previous user-defined text'))
elif bar.standardButton(button) == QDialogButtonBox.Ok:
elif button_bar.standardButton(button) == QtWidgets.QDialogButtonBox.Ok:
button.setToolTip(translate('OpenLP.SourceSelectForm',
'Save changes and return to OpenLP'))
else:
log.debug('No tooltip for button {}'.format(button.text()))
log.debug('No tooltip for button %s', button.text())
class FingerTabBarWidget(QTabBar):
class FingerTabBarWidget(QtWidgets.QTabBar):
"""
Realign west -orientation tabs to left-right text rather than south-north text
Borrowed from
@ -177,8 +173,8 @@ class FingerTabBarWidget(QTabBar):
:param width: Remove default width parameter in kwargs
:param height: Remove default height parameter in kwargs
"""
self.tabSize = QSize(kwargs.pop('width', 100), kwargs.pop('height', 25))
QTabBar.__init__(self, parent, *args, **kwargs)
self.tabSize = QtCore.QSize(kwargs.pop('width', 100), kwargs.pop('height', 25))
QtWidgets.QTabBar.__init__(self, parent, *args, **kwargs)
def paintEvent(self, event):
"""
@ -186,14 +182,14 @@ class FingerTabBarWidget(QTabBar):
:param event: Repaint event signal
"""
painter = QStylePainter(self)
option = QStyleOptionTab()
painter = QtWidgets.QStylePainter(self)
option = QtWidgets.QStyleOptionTab()
for index in range(self.count()):
self.initStyleOption(option, index)
tabRect = self.tabRect(index)
tabRect.moveLeft(10)
painter.drawControl(QStyle.CE_TabBarTabShape, option)
painter.drawControl(QtWidgets.QStyle.CE_TabBarTabShape, option)
painter.drawText(tabRect, QtCore.Qt.AlignVCenter |
QtCore.Qt.TextDontClip,
self.tabText(index))
@ -209,7 +205,7 @@ class FingerTabBarWidget(QTabBar):
return self.tabSize
class FingerTabWidget(QTabWidget):
class FingerTabWidget(QtWidgets.QTabWidget):
"""
A QTabWidget equivalent which uses our FingerTabBarWidget
@ -220,11 +216,11 @@ class FingerTabWidget(QTabWidget):
"""
Initialize FingerTabWidget instance
"""
QTabWidget.__init__(self, parent, *args)
QtWidgets.QTabWidget.__init__(self, parent, *args)
self.setTabBar(FingerTabBarWidget(self))
class SourceSelectTabs(QDialog):
class SourceSelectTabs(QtWidgets.QDialog):
"""
Class for handling selecting the source for the projector to use.
Uses tabbed interface.
@ -248,18 +244,18 @@ class SourceSelectTabs(QDialog):
self.setObjectName('source_select_tabs')
self.setWindowIcon(build_icon(':/icon/openlp-log-32x32.png'))
self.setModal(True)
self.layout = QVBoxLayout()
self.layout = QtWidgets.QVBoxLayout()
self.layout.setObjectName('source_select_tabs_layout')
if is_macosx():
self.tabwidget = QTabWidget(self)
self.tabwidget = QtWidgets.QTabWidget(self)
else:
self.tabwidget = FingerTabWidget(self)
self.tabwidget.setObjectName('source_select_tabs_tabwidget')
self.tabwidget.setUsesScrollButtons(False)
if is_macosx():
self.tabwidget.setTabPosition(QTabWidget.North)
self.tabwidget.setTabPosition(QtWidgets.QTabWidget.North)
else:
self.tabwidget.setTabPosition(QTabWidget.West)
self.tabwidget.setTabPosition(QtWidgets.QTabWidget.West)
self.layout.addWidget(self.tabwidget)
self.setLayout(self.layout)
@ -273,12 +269,12 @@ class SourceSelectTabs(QDialog):
self.source_text = self.projectordb.get_source_list(projector=projector)
self.source_group = source_group(projector.source_available, self.source_text)
# self.source_group = {'4': {'41': 'Storage 1'}, '5': {"51": 'Network 1'}}
self.button_group = [] if self.edit else QButtonGroup()
self.button_group = [] if self.edit else QtWidgets.QButtonGroup()
keys = list(self.source_group.keys())
keys.sort()
if self.edit:
for key in keys:
(tab, button_count, buttonchecked) = Build_Tab(group=self.button_group,
(tab, button_count, buttonchecked) = build_tab(group=self.button_group,
source_key={key: self.source_group[key]},
default=self.projector.source,
projector=self.projector,
@ -287,13 +283,13 @@ class SourceSelectTabs(QDialog):
thistab = self.tabwidget.addTab(tab, PJLINK_DEFAULT_SOURCES[key])
if buttonchecked:
self.tabwidget.setCurrentIndex(thistab)
self.button_box = QDialogButtonBox(QtWidgets.QDialogButtonBox.Reset |
QtWidgets.QDialogButtonBox.Discard |
QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Reset |
QtWidgets.QDialogButtonBox.Discard |
QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
else:
for key in keys:
(tab, button_count, buttonchecked) = Build_Tab(group=self.button_group,
(tab, button_count, buttonchecked) = build_tab(group=self.button_group,
source_key={key: self.source_group[key]},
default=self.projector.source,
projector=self.projector,
@ -302,15 +298,15 @@ class SourceSelectTabs(QDialog):
thistab = self.tabwidget.addTab(tab, PJLINK_DEFAULT_SOURCES[key])
if buttonchecked:
self.tabwidget.setCurrentIndex(thistab)
self.button_box = QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
self.button_box.clicked.connect(self.button_clicked)
self.layout.addWidget(self.button_box)
set_button_tooltip(self.button_box)
selected = super(SourceSelectTabs, self).exec()
return selected
@pyqtSlot(object)
@QtCore.pyqtSlot(QtWidgets.QAbstractButton)
def button_clicked(self, button):
"""
Checks which button was clicked
@ -333,6 +329,9 @@ class SourceSelectTabs(QDialog):
return 100
def delete_sources(self):
"""
Delete the source
"""
msg = QtWidgets.QMessageBox()
msg.setText(translate('OpenLP.SourceSelectForm', 'Delete entries for this projector'))
msg.setInformativeText(translate('OpenLP.SourceSelectForm',
@ -359,20 +358,20 @@ class SourceSelectTabs(QDialog):
continue
item = self.projectordb.get_source_by_code(code=code, projector_id=projector.id)
if item is None:
log.debug("(%s) Adding new source text %s: %s" % (projector.ip, code, text))
log.debug("(%s) Adding new source text %s: %s", projector.ip, code, text)
item = ProjectorSource(projector_id=projector.id, code=code, text=text)
else:
item.text = text
log.debug('(%s) Updating source code %s with text="%s"' % (projector.ip, item.code, item.text))
log.debug('(%s) Updating source code %s with text="%s"', projector.ip, item.code, item.text)
self.projectordb.add_source(item)
selected = 0
else:
selected = self.button_group.checkedId()
log.debug('SourceSelectTabs().accepted() Setting source to %s' % selected)
log.debug('SourceSelectTabs().accepted() Setting source to %s', selected)
self.done(selected)
class SourceSelectSingle(QDialog):
class SourceSelectSingle(QtWidgets.QDialog):
"""
Class for handling selecting the source for the projector to use.
Uses single dialog interface.
@ -393,6 +392,7 @@ class SourceSelectSingle(QDialog):
title = translate('OpenLP.SourceSelectForm', 'Select Projector Source')
self.setObjectName('source_select_single')
self.setWindowIcon(build_icon(':/icon/openlp-log-32x32.png'))
self.setWindowTitle(title)
self.setModal(True)
self.edit = edit
@ -403,12 +403,12 @@ class SourceSelectSingle(QDialog):
:param projector: Projector instance to build source list from
"""
self.projector = projector
self.layout = QFormLayout() if self.edit else QVBoxLayout()
self.layout = QtWidgets.QFormLayout() if self.edit else QtWidgets.QVBoxLayout()
self.layout.setObjectName('source_select_tabs_layout')
self.layout.setSpacing(10)
self.setLayout(self.layout)
self.setMinimumWidth(350)
self.button_group = [] if self.edit else QButtonGroup()
self.button_group = [] if self.edit else QtWidgets.QButtonGroup()
self.source_text = self.projectordb.get_source_list(projector=projector)
keys = list(self.source_text.keys())
keys.sort()
@ -416,7 +416,7 @@ class SourceSelectSingle(QDialog):
button_list = []
if self.edit:
for key in keys:
item = QLineEdit()
item = QtWidgets.QLineEdit()
item.setObjectName('source_key_%s' % key)
source_item = self.projectordb.get_source_by_code(code=key, projector_id=self.projector.db_item.id)
if source_item is None:
@ -426,10 +426,10 @@ class SourceSelectSingle(QDialog):
item.setText(source_item.text)
self.layout.addRow(PJLINK_DEFAULT_CODES[key], item)
self.button_group.append(item)
self.button_box = QDialogButtonBox(QtWidgets.QDialogButtonBox.Reset |
QtWidgets.QDialogButtonBox.Discard |
QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Reset |
QtWidgets.QDialogButtonBox.Discard |
QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
else:
for key in keys:
source_text = self.projectordb.get_source_by_code(code=key, projector_id=self.projector.db_item.id)
@ -439,8 +439,8 @@ class SourceSelectSingle(QDialog):
self.layout.addWidget(button)
self.button_group.addButton(button, int(key))
button_list.append(key)
self.button_box = QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok |
QtWidgets.QDialogButtonBox.Cancel)
self.button_box.clicked.connect(self.button_clicked)
self.layout.addWidget(self.button_box)
self.setMinimumHeight(key_count * 25)
@ -448,7 +448,7 @@ class SourceSelectSingle(QDialog):
selected = super(SourceSelectSingle, self).exec()
return selected
@pyqtSlot(object)
@QtCore.pyqtSlot(QtWidgets.QAbstractButton)
def button_clicked(self, button):
"""
Checks which button was clicked
@ -471,6 +471,9 @@ class SourceSelectSingle(QDialog):
return 100
def delete_sources(self):
"""
Delete all the entries for this projector
"""
msg = QtWidgets.QMessageBox()
msg.setText(translate('OpenLP.SourceSelectForm', 'Delete entries for this projector'))
msg.setInformativeText(translate('OpenLP.SourceSelectForm',
@ -484,7 +487,7 @@ class SourceSelectSingle(QDialog):
self.projectordb.delete_all_objects(ProjectorSource, ProjectorSource.projector_id == self.projector.db_item.id)
self.done(100)
@pyqtSlot()
@QtCore.pyqtSlot()
def accept_me(self):
"""
Slot to accept 'OK' button
@ -498,14 +501,14 @@ class SourceSelectSingle(QDialog):
continue
item = self.projectordb.get_source_by_code(code=code, projector_id=projector.id)
if item is None:
log.debug("(%s) Adding new source text %s: %s" % (projector.ip, code, text))
log.debug('(%s) Adding new source text %s: %s', projector.ip, code, text)
item = ProjectorSource(projector_id=projector.id, code=code, text=text)
else:
item.text = text
log.debug('(%s) Updating source code %s with text="%s"' % (projector.ip, item.code, item.text))
log.debug('(%s) Updating source code %s with text="%s"', projector.ip, item.code, item.text)
self.projectordb.add_source(item)
selected = 0
else:
selected = self.button_group.checkedId()
log.debug('SourceSelectDialog().accepted() Setting source to %s' % selected)
log.debug('SourceSelectDialog().accepted() Setting source to %s', selected)
self.done(selected)

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -594,7 +594,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ServiceMa
if success:
try:
shutil.copy(temp_file_name, path_file_name)
except shutil.Error:
except (shutil.Error, PermissionError):
return self.save_file_as()
except OSError as ose:
QtWidgets.QMessageBox.critical(self, translate('OpenLP.ServiceManager', 'Error Saving File'),
@ -655,7 +655,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ServiceMa
if success:
try:
shutil.copy(temp_file_name, path_file_name)
except shutil.Error:
except (shutil.Error, PermissionError):
return self.save_file_as()
self.main_window.add_recent_file(path_file_name)
self.set_modified(False)
@ -1321,9 +1321,10 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ServiceMa
"""
The theme may have changed in the settings dialog so make sure the theme combo box is in the correct state.
"""
visible = self.renderer.theme_level == ThemeLevel.Global
self.theme_label.setVisible(visible)
self.theme_combo_box.setVisible(visible)
visible = self.renderer.theme_level != ThemeLevel.Global
self.toolbar.actions['theme_combo_box'].setVisible(visible)
self.toolbar.actions['theme_label'].setVisible(visible)
self.regenerate_service_items()
def regenerate_service_items(self, changed=False):
"""

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -39,7 +39,7 @@ class Ui_SettingsDialog(object):
"""
settings_dialog.setObjectName('settings_dialog')
settings_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
settings_dialog.resize(800, 700)
settings_dialog.resize(920, 625)
self.dialog_layout = QtWidgets.QGridLayout(settings_dialog)
self.dialog_layout.setObjectName('dialog_layout')
self.dialog_layout.setContentsMargins(8, 8, 8, 8)

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -49,6 +49,8 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
self.changed_actions = {}
self.action_list = ActionList.get_instance()
self.dialog_was_shown = False
self.default_radio_button.setEnabled(False)
self.custom_radio_button.setEnabled(False)
self.primary_push_button.toggled.connect(self.on_primary_push_button_clicked)
self.alternate_push_button.toggled.connect(self.on_alternate_push_button_clicked)
self.tree_widget.currentItemChanged.connect(self.on_current_item_changed)
@ -110,8 +112,89 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
self.reload_shortcut_list()
self._adjust_button(self.primary_push_button, False, False, '')
self._adjust_button(self.alternate_push_button, False, False, '')
self._set_controls_enabled(False)
return QtWidgets.QDialog.exec(self)
def _validiate_shortcut(self, changing_action, key_sequence):
"""
Checks if the given ``changing_action `` can use the given ``key_sequence``. Returns ``True`` if the
``key_sequence`` can be used by the action, otherwise displays a dialog and returns ``False``.
:param changing_action: The action which wants to use the ``key_sequence``.
:param key_sequence: The key sequence which the action want so use.
"""
is_valid = True
for category in self.action_list.categories:
for action in category.actions:
shortcuts = self._action_shortcuts(action)
if key_sequence not in shortcuts:
continue
if action is changing_action:
if self.primary_push_button.isChecked() and shortcuts.index(key_sequence) == 0:
continue
if self.alternate_push_button.isChecked() and shortcuts.index(key_sequence) == 1:
continue
# Have the same parent, thus they cannot have the same shortcut.
if action.parent() is changing_action.parent():
is_valid = False
# The new shortcut is already assigned, but if both shortcuts are only valid in a different widget the
# new shortcut is valid, because they will not interfere.
if action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False
if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False
if not is_valid:
self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
translate('OpenLP.ShortcutListDialog',
'The shortcut "%s" is already assigned to another action, please'
' use a different shortcut.') %
self.get_shortcut_string(key_sequence, for_display=True))
self.dialog_was_shown = True
return is_valid
def _action_shortcuts(self, action):
"""
This returns the shortcuts for the given ``action``, which also includes those shortcuts which are not saved
yet but already assigned (as changes are applied when closing the dialog).
"""
if action in self.changed_actions:
return self.changed_actions[action]
return action.shortcuts()
def _current_item_action(self, item=None):
"""
Returns the action of the given ``item``. If no item is given, we return the action of the current item of
the ``tree_widget``.
"""
if item is None:
item = self.tree_widget.currentItem()
if item is None:
return
return item.data(0, QtCore.Qt.UserRole)
def _adjust_button(self, button, checked=None, enabled=None, text=None):
"""
Can be called to adjust more properties of the given ``button`` at once.
"""
# Set the text before checking the button, because this emits a signal.
if text is not None:
button.setText(text)
if checked is not None:
button.setChecked(checked)
if enabled is not None:
button.setEnabled(enabled)
def _set_controls_enabled(self, is_enabled=False):
"""
Enable or disable the shortcut controls
"""
self.default_radio_button.setEnabled(is_enabled)
self.custom_radio_button.setEnabled(is_enabled)
self.primary_push_button.setEnabled(is_enabled)
self.alternate_push_button.setEnabled(is_enabled)
self.clear_primary_button.setEnabled(is_enabled)
self.clear_alternate_button.setEnabled(is_enabled)
def reload_shortcut_list(self):
"""
Reload the ``tree_widget`` list to add new and remove old actions.
@ -229,8 +312,7 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
A item has been pressed. We adjust the button's text to the action's shortcut which is encapsulate in the item.
"""
action = self._current_item_action(item)
self.primary_push_button.setEnabled(action is not None)
self.alternate_push_button.setEnabled(action is not None)
self._set_controls_enabled(action is not None)
primary_text = ''
alternate_text = ''
primary_label_text = ''
@ -244,7 +326,7 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
if len(action.default_shortcuts) == 2:
alternate_label_text = self.get_shortcut_string(action.default_shortcuts[1], for_display=True)
shortcuts = self._action_shortcuts(action)
# We do not want to loose pending changes, that is why we have to keep the text when, this function has not
# We do not want to loose pending changes, that is why we have to keep the text when this function has not
# been triggered by a signal.
if item is None:
primary_text = self.primary_push_button.text()
@ -254,7 +336,7 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
elif len(shortcuts) == 2:
primary_text = self.get_shortcut_string(shortcuts[0], for_display=True)
alternate_text = self.get_shortcut_string(shortcuts[1], for_display=True)
# When we are capturing a new shortcut, we do not want, the buttons to display the current shortcut.
# When we are capturing a new shortcut, we do not want the buttons to display the current shortcut.
if self.primary_push_button.isChecked():
primary_text = ''
if self.alternate_push_button.isChecked():
@ -396,75 +478,6 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
self.refresh_shortcut_list()
self.on_current_item_changed(self.tree_widget.currentItem())
def _validiate_shortcut(self, changing_action, key_sequence):
"""
Checks if the given ``changing_action `` can use the given ``key_sequence``. Returns ``True`` if the
``key_sequence`` can be used by the action, otherwise displays a dialog and returns ``False``.
:param changing_action: The action which wants to use the ``key_sequence``.
:param key_sequence: The key sequence which the action want so use.
"""
is_valid = True
for category in self.action_list.categories:
for action in category.actions:
shortcuts = self._action_shortcuts(action)
if key_sequence not in shortcuts:
continue
if action is changing_action:
if self.primary_push_button.isChecked() and shortcuts.index(key_sequence) == 0:
continue
if self.alternate_push_button.isChecked() and shortcuts.index(key_sequence) == 1:
continue
# Have the same parent, thus they cannot have the same shortcut.
if action.parent() is changing_action.parent():
is_valid = False
# The new shortcut is already assigned, but if both shortcuts are only valid in a different widget the
# new shortcut is valid, because they will not interfere.
if action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False
if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False
if not is_valid:
self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
translate('OpenLP.ShortcutListDialog',
'The shortcut "%s" is already assigned to another action, please'
' use a different shortcut.') %
self.get_shortcut_string(key_sequence, for_display=True))
self.dialog_was_shown = True
return is_valid
def _action_shortcuts(self, action):
"""
This returns the shortcuts for the given ``action``, which also includes those shortcuts which are not saved
yet but already assigned (as changes are applied when closing the dialog).
"""
if action in self.changed_actions:
return self.changed_actions[action]
return action.shortcuts()
def _current_item_action(self, item=None):
"""
Returns the action of the given ``item``. If no item is given, we return the action of the current item of
the ``tree_widget``.
"""
if item is None:
item = self.tree_widget.currentItem()
if item is None:
return
return item.data(0, QtCore.Qt.UserRole)
def _adjust_button(self, button, checked=None, enabled=None, text=None):
"""
Can be called to adjust more properties of the given ``button`` at once.
"""
# Set the text before checking the button, because this emits a signal.
if text is not None:
button.setText(text)
if checked is not None:
button.setChecked(checked)
if enabled is not None:
button.setEnabled(enabled)
@staticmethod
def get_shortcut_string(shortcut, for_display=False):
if for_display:

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -714,8 +714,10 @@ class SlideController(DisplayController, RegistryProperties):
# Reset the button
self.play_slides_once.setChecked(False)
self.play_slides_once.setIcon(build_icon(':/media/media_time.png'))
self.play_slides_once.setText(UiStrings().PlaySlidesToEnd)
self.play_slides_loop.setChecked(False)
self.play_slides_loop.setIcon(build_icon(':/media/media_time.png'))
self.play_slides_loop.setText(UiStrings().PlaySlidesInLoop)
if item.is_text():
if (Settings().value(self.main_window.songs_settings_section + '/display songbar') and
not self.song_menu.menu().isEmpty()):
@ -907,7 +909,9 @@ class SlideController(DisplayController, RegistryProperties):
Registry().execute('%s_stop' % old_item.name.lower(), [old_item, self.is_live])
if old_item.is_media() and not self.service_item.is_media():
self.on_media_close()
Registry().execute('slidecontroller_%s_started' % self.type_prefix, [self.service_item])
if self.is_live:
# This even is only registered for live
Registry().execute('slidecontroller_%s_started' % self.type_prefix, [self.service_item])
def on_slide_selected_index(self, message):
"""

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -43,9 +43,9 @@ class Ui_ThemeWizard(object):
theme_wizard.setModal(True)
theme_wizard.setOptions(QtWidgets.QWizard.IndependentPages |
QtWidgets.QWizard.NoBackButtonOnStartPage | QtWidgets.QWizard.HaveCustomButton1)
theme_wizard.setFixedWidth(640)
if is_macosx():
theme_wizard.setPixmap(QtWidgets.QWizard.BackgroundPixmap, QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
theme_wizard.resize(646, 400)
else:
theme_wizard.setWizardStyle(QtWidgets.QWizard.ModernStyle)
self.spacer = QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -4,7 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- #
# 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 #
@ -529,7 +529,7 @@ def get_natural_key(string):
key = [int(part) if part.isdigit() else get_locale_key(part) for part in key]
# Python 3 does not support comparison of different types anymore. So make sure, that we do not compare str
# and int.
if string[0].isdigit():
if string and string[0].isdigit():
return [b''] + key
return key

Some files were not shown because too many files have changed in this diff Show More