From 225708102ceb500cb6ae2e79e93d947ecc546277 Mon Sep 17 00:00:00 2001 From: Ian Knight Date: Mon, 18 Apr 2016 15:05:21 +0930 Subject: [PATCH 1/5] Added QR code and link for iOS app to remote plugin ui --- openlp/plugins/remotes/lib/remotetab.py | 46 +++++++++++++++++------- resources/images/ios_app_qr.png | Bin 0 -> 758 bytes resources/images/openlp-2.qrc | 1 + 3 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 resources/images/ios_app_qr.png diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index 76ee65571..af64e401f 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -144,18 +144,33 @@ class RemoteTab(SettingsTab): self.android_app_group_box = QtWidgets.QGroupBox(self.right_column) self.android_app_group_box.setObjectName('android_app_group_box') self.right_layout.addWidget(self.android_app_group_box) - self.qr_layout = QtWidgets.QVBoxLayout(self.android_app_group_box) - self.qr_layout.setObjectName('qr_layout') - self.qr_code_label = QtWidgets.QLabel(self.android_app_group_box) - self.qr_code_label.setPixmap(QtGui.QPixmap(':/remotes/android_app_qr.png')) - self.qr_code_label.setAlignment(QtCore.Qt.AlignCenter) - self.qr_code_label.setObjectName('qr_code_label') - self.qr_layout.addWidget(self.qr_code_label) - self.qr_description_label = QtWidgets.QLabel(self.android_app_group_box) - self.qr_description_label.setObjectName('qr_description_label') - self.qr_description_label.setOpenExternalLinks(True) - self.qr_description_label.setWordWrap(True) - self.qr_layout.addWidget(self.qr_description_label) + self.android_qr_layout = QtWidgets.QVBoxLayout(self.android_app_group_box) + self.android_qr_layout.setObjectName('android_qr_layout') + self.android_qr_code_label = QtWidgets.QLabel(self.android_app_group_box) + self.android_qr_code_label.setPixmap(QtGui.QPixmap(':/remotes/android_app_qr.png')) + self.android_qr_code_label.setAlignment(QtCore.Qt.AlignCenter) + self.android_qr_code_label.setObjectName('android_qr_code_label') + self.android_qr_layout.addWidget(self.android_qr_code_label) + self.android_qr_description_label = QtWidgets.QLabel(self.android_app_group_box) + self.android_qr_description_label.setObjectName('android_qr_description_label') + self.android_qr_description_label.setOpenExternalLinks(True) + self.android_qr_description_label.setWordWrap(True) + self.android_qr_layout.addWidget(self.android_qr_description_label) + self.ios_app_group_box = QtWidgets.QGroupBox(self.right_column) + self.ios_app_group_box.setObjectName('ios_app_group_box') + self.right_layout.addWidget(self.ios_app_group_box) + self.ios_qr_layout = QtWidgets.QVBoxLayout(self.ios_app_group_box) + self.ios_qr_layout.setObjectName('ios_qr_layout') + self.ios_qr_code_label = QtWidgets.QLabel(self.ios_app_group_box) + self.ios_qr_code_label.setPixmap(QtGui.QPixmap(':/remotes/ios_app_qr.png')) + self.ios_qr_code_label.setAlignment(QtCore.Qt.AlignCenter) + self.ios_qr_code_label.setObjectName('ios_qr_code_label') + self.ios_qr_layout.addWidget(self.ios_qr_code_label) + self.ios_qr_description_label = QtWidgets.QLabel(self.ios_app_group_box) + self.ios_qr_description_label.setObjectName('ios_qr_description_label') + self.ios_qr_description_label.setOpenExternalLinks(True) + self.ios_qr_description_label.setWordWrap(True) + self.ios_qr_layout.addWidget(self.ios_qr_description_label) self.left_layout.addStretch() self.right_layout.addStretch() self.twelve_hour_check_box.stateChanged.connect(self.on_twelve_hour_check_box_changed) @@ -176,10 +191,15 @@ class RemoteTab(SettingsTab): self.thumbnails_check_box.setText(translate('RemotePlugin.RemoteTab', 'Show thumbnails of non-text slides in remote and stage view.')) self.android_app_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'Android App')) - self.qr_description_label.setText( + self.android_qr_description_label.setText( translate('RemotePlugin.RemoteTab', 'Scan the QR code or click download to install the ' 'Android app from Google Play.') % 'https://play.google.com/store/apps/details?id=org.openlp.android2') + self.ios_app_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'iOS App')) + self.ios_qr_description_label.setText( + translate('RemotePlugin.RemoteTab', 'Scan the QR code or click download to install the ' + 'iOS app from the App Store.') % + 'https://itunes.apple.com/app/id1096218725') self.https_settings_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'HTTPS Server')) self.https_error_label.setText( translate('RemotePlugin.RemoteTab', 'Could not find an SSL certificate. The HTTPS server will not be ' diff --git a/resources/images/ios_app_qr.png b/resources/images/ios_app_qr.png new file mode 100644 index 0000000000000000000000000000000000000000..c7244fc3354c14593021de5e0f296797f734e94f GIT binary patch literal 758 zcmeAS@N?(olHy`uVBq!ia0vp^XF-?)NHEx4U%eGbaTa()7Bet#3xhBt!>l+Rixd5;ZvTmy>@{{KJyD#^@IXY!O+5;MMK zth6Z8_p!AJ3XyvJ!}0O?MmAn4lZ*=s9Gjtxm;L)E@64zx_t|eT|F601)81|KbuR(s zix+0j%!<+QS5Yc2Jnyk@@0Xm3ZER=TLlX8qaohPXUfu0cm0M=YtM+aapm92xQRcZ- zf}1|Ba~H1?=Z;bZnechSva8C^m|olkGUHb`TrciX+1sV^f7jE8O1wZvY+Yvh_4%T< zIVW$Q7EP|}|Bwf=boR1b@fJ6wqO&=<73LWiY;2NDY|b8gG%G)2O%(;4AYO2Mn78jtPb@Xc9n{GEV@0OI>E&?ih=6v(ko`Rahuy;3H*Z22K zdFQcYp`-IK5zzDXU{Yl+fYIb7k{sZ5QEI}a=eD0ZtSbpqP%TpyUPi#qhY77$0U!GaY zYg%2lD{RTVj@MzmE>gh2-es5T<9j`d^;K+(lJKU>y3hVHf$Uj6$2VkUcvi|L(|sH5 z@89_+l$mki!j>yHm+b!$wLH;Ry5x3Y7|={!-{0?e!$h)IvdoveAKK{D{A^v}>;E4u z&bm#ly1M+pE2DmJpsdO)oh5RXCI4N1*89nSJ%25{xWIAq;!N$xOFz4Q&iw0PbLU*z zY*4s7*4i*}lk3i$-M$_d_xJ$=rTLkeZ@16=dzZIwRa^4LxHJP8pE((~j-9)`+Q)V3 zoLHZfW4_x!9@Y|g?Y%!U*l*qQ2+z|N(m-V@T!wo android_app_qr.png + ios_app_qr.png From dffac259332a35d504cd8bd451e91b0af251af5f Mon Sep 17 00:00:00 2001 From: Ian Knight Date: Mon, 18 Apr 2016 16:24:49 +0930 Subject: [PATCH 2/5] Ran generate_resources.sh --- openlp/.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/.version b/openlp/.version index 6b4950e3d..a7a6d4d4c 100644 --- a/openlp/.version +++ b/openlp/.version @@ -1 +1 @@ -2.4 +2.4-bzr2646 \ No newline at end of file From 631aea771e8f29f73d1c005f103f85b998191929 Mon Sep 17 00:00:00 2001 From: Ian Knight Date: Mon, 18 Apr 2016 16:26:28 +0930 Subject: [PATCH 3/5] Housekeeping --- openlp/.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/.version b/openlp/.version index a7a6d4d4c..6b4950e3d 100644 --- a/openlp/.version +++ b/openlp/.version @@ -1 +1 @@ -2.4-bzr2646 \ No newline at end of file +2.4 From b8173f7f0e2e9ecb3cc3c352a1d2b2c70c5aa545 Mon Sep 17 00:00:00 2001 From: Ian Knight Date: Tue, 26 Apr 2016 12:13:29 +0930 Subject: [PATCH 4/5] Added Test to HTML Builder --- .../openlp_core_lib/test_htmlbuilder.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/functional/openlp_core_lib/test_htmlbuilder.py b/tests/functional/openlp_core_lib/test_htmlbuilder.py index 8ca98060d..b90531c8d 100644 --- a/tests/functional/openlp_core_lib/test_htmlbuilder.py +++ b/tests/functional/openlp_core_lib/test_htmlbuilder.py @@ -197,6 +197,7 @@ FOOTER_CSS_BASE = """ """ FOOTER_CSS = FOOTER_CSS_BASE % ('nowrap') FOOTER_CSS_WRAP = FOOTER_CSS_BASE % ('normal') +FOOTER_CSS_INVALID = '' class Htmbuilder(TestCase, TestMixin): @@ -359,6 +360,26 @@ class Htmbuilder(TestCase, TestMixin): # THEN: Footer should wrap self.assertEqual(FOOTER_CSS_WRAP, css, 'The footer strings should be equal.') + def build_footer_invalid_test(self): + """ + Test the build_footer_css() function + """ + # GIVEN: Create a theme. + css = [] + item = MagicMock() + item.theme_data = None + item.footer = 'FAIL' + + # WHEN: Settings say that footer should wrap + css.append(build_footer_css(item, height)) + item.theme_data = 'TEST' + item.footer = None + css.append(build_footer_css(item, height)) + + # THEN: Footer should wrap + self.assertEqual(FOOTER_CSS_INVALID, css[0], 'The footer strings should be blank.') + self.assertEqual(FOOTER_CSS_INVALID, css[1], 'The footer strings should be blank.') + def webkit_version_test(self): """ Test the webkit_version() function From 56f5bbac526eed043ac6899e416e097a508e3924 Mon Sep 17 00:00:00 2001 From: Ian Knight Date: Tue, 26 Apr 2016 12:17:38 +0930 Subject: [PATCH 5/5] Testing --- tests/functional/openlp_core_lib/test_htmlbuilder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/openlp_core_lib/test_htmlbuilder.py b/tests/functional/openlp_core_lib/test_htmlbuilder.py index b90531c8d..58841eb90 100644 --- a/tests/functional/openlp_core_lib/test_htmlbuilder.py +++ b/tests/functional/openlp_core_lib/test_htmlbuilder.py @@ -369,6 +369,7 @@ class Htmbuilder(TestCase, TestMixin): item = MagicMock() item.theme_data = None item.footer = 'FAIL' + height = 1024 # WHEN: Settings say that footer should wrap css.append(build_footer_css(item, height))