From b6dc37fb0b985a09af14ca6eb0c31d614a2bdc9a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 10 Jun 2018 20:29:00 +0100 Subject: [PATCH] remove more and fix code --- openlp/core/projectors/manager.py | 22 +++++++++--------- openlp/core/projectors/tab.py | 2 +- openlp/core/ui/exceptiondialog.py | 2 +- openlp/core/ui/icons.py | 19 +++++++++------ resources/images/openlp-2.qrc | 6 ----- resources/images/projector_blank_tiled.png | Bin 652 -> 0 bytes resources/images/projector_connect_tiled.png | Bin 920 -> 0 bytes .../images/projector_disconnect_tiled.png | Bin 914 -> 0 bytes .../images/projector_power_off_tiled.png | Bin 894 -> 0 bytes resources/images/projector_power_on_tiled.png | Bin 935 -> 0 bytes resources/images/projector_show_tiled.png | Bin 893 -> 0 bytes .../openlp_plugins/bibles/test_mediaitem.py | 3 +-- 12 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 resources/images/projector_blank_tiled.png delete mode 100644 resources/images/projector_connect_tiled.png delete mode 100644 resources/images/projector_disconnect_tiled.png delete mode 100644 resources/images/projector_power_off_tiled.png delete mode 100644 resources/images/projector_power_on_tiled.png delete mode 100644 resources/images/projector_show_tiled.png diff --git a/openlp/core/projectors/manager.py b/openlp/core/projectors/manager.py index cd975db02..22cacdc20 100644 --- a/openlp/core/projectors/manager.py +++ b/openlp/core/projectors/manager.py @@ -108,21 +108,21 @@ class UiProjectorManager(object): self.one_toolbar.add_toolbar_action('connect_projector_multiple', text=translate('OpenLP.ProjectorManager', 'Connect to selected projectors'), - icon=':/projector/projector_connect_tiled.png', + icon=UiIcons().projector_connect, tooltip=translate('OpenLP.ProjectorManager', 'Connect to selected projectors.'), triggers=self.on_connect_projector) self.one_toolbar.add_toolbar_action('disconnect_projector', text=translate('OpenLP.ProjectorManager', 'Disconnect from selected projectors'), - icon=UiIcons().disconnect, + icon=UiIcons().projector_disconnect, tooltip=translate('OpenLP.ProjectorManager', 'Disconnect from selected projector.'), triggers=self.on_disconnect_projector) self.one_toolbar.add_toolbar_action('disconnect_projector_multiple', text=translate('OpenLP.ProjectorManager', 'Disconnect from selected projector'), - icon=':/projector/projector_disconnect_tiled.png', + icon=UiIcons().projector_disconnect, tooltip=translate('OpenLP.ProjectorManager', 'Disconnect from selected projectors.'), triggers=self.on_disconnect_projector) @@ -137,7 +137,7 @@ class UiProjectorManager(object): self.one_toolbar.add_toolbar_action('poweron_projector_multiple', text=translate('OpenLP.ProjectorManager', 'Power on selected projector'), - icon=':/projector/projector_power_on_tiled.png', + icon=UiIcons().projector_on, tooltip=translate('OpenLP.ProjectorManager', 'Power on selected projectors.'), triggers=self.on_poweron_projector) @@ -149,7 +149,7 @@ class UiProjectorManager(object): triggers=self.on_poweroff_projector) self.one_toolbar.add_toolbar_action('poweroff_projector_multiple', text=translate('OpenLP.ProjectorManager', 'Standby selected projector'), - icon=':/projector/projector_power_off_tiled.png', + icon=UiIcons().projector_off, tooltip=translate('OpenLP.ProjectorManager', 'Put selected projectors in standby.'), triggers=self.on_poweroff_projector) @@ -164,21 +164,21 @@ class UiProjectorManager(object): self.one_toolbar.add_toolbar_action('blank_projector_multiple', text=translate('OpenLP.ProjectorManager', 'Blank selected projectors screen'), - icon=':/projector/projector_blank_tiled.png', + icon=UiIcons().blank, tooltip=translate('OpenLP.ProjectorManager', 'Blank selected projectors screen.'), triggers=self.on_blank_projector) self.one_toolbar.add_toolbar_action('show_projector', text=translate('OpenLP.ProjectorManager', 'Show selected projector screen'), - icon=':/projector/projector_show.png', + icon=UiIcons().desktop, tooltip=translate('OpenLP.ProjectorManager', 'Show selected projector screen.'), triggers=self.on_show_projector) self.one_toolbar.add_toolbar_action('show_projector_multiple', text=translate('OpenLP.ProjectorManager', 'Show selected projector screen'), - icon=':/projector/projector_show_tiled.png', + icon=UiIcons().desktop, tooltip=translate('OpenLP.ProjectorManager', 'Show selected projectors screen.'), triggers=self.on_show_projector) @@ -277,7 +277,7 @@ class ProjectorManager(QtWidgets.QWidget, RegistryBase, UiProjectorManager, LogM self.projector_list = [] self.source_select_form = None # Dict for matching projector status to display icon - self.self.status_icons = { + self.status_icons = { S_NOT_CONNECTED: UiIcons().projector_disconnect, S_CONNECTING: UiIcons().projector_connect, S_CONNECTED: UiIcons().projector_off, @@ -713,7 +713,7 @@ class ProjectorManager(QtWidgets.QWidget, RegistryBase, UiProjectorManager, LogM """ item = ProjectorItem(link=self._add_projector(projector)) item.db_item = projector - item.icon = QtGui.QIcon(QtGui.QPixmap(self.status_icons[S_NOT_CONNECTED])) + item.icon = QtGui.QIcon(self.status_icons[S_NOT_CONNECTED]) widget = QtWidgets.QListWidgetItem(item.icon, item.link.name, self.projector_list_widget @@ -800,7 +800,7 @@ class ProjectorManager(QtWidgets.QWidget, RegistryBase, UiProjectorManager, LogM return item.status = status - item.icon = QtGui.QIcon(QtGui.QPixmap(self.status_icons[status])) + item.icon = self.status_icons[status] log.debug('({name}) Updating icon with {code}'.format(name=item.link.name, code=STATUS_CODE[status])) item.widget.setIcon(item.icon) return self.update_icons() diff --git a/openlp/core/projectors/tab.py b/openlp/core/projectors/tab.py index 934a54a80..28efbf6e4 100644 --- a/openlp/core/projectors/tab.py +++ b/openlp/core/projectors/tab.py @@ -46,7 +46,7 @@ class ProjectorTab(SettingsTab): :param parent: Parent widget """ - self.icon_path = UiIcons().projectore + self.icon_path = UiIcons().projector projector_translated = translate('OpenLP.ProjectorTab', 'Projector') super(ProjectorTab, self).__init__(parent, 'Projector', projector_translated) diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 55591ecd0..e24dc5b90 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -48,7 +48,7 @@ class Ui_ExceptionDialog(object): self.message_layout.setContentsMargins(0, 0, 50, 0) self.message_layout.addSpacing(12) self.bug_label = QtWidgets.QLabel(exception_dialog) - self.bug_label.setPixmap(QtGui.QPixmap(UiIcons().exception)) + self.bug_label.setPixmap(UiIcons().exception.pixmap(40, 40)) self.bug_label.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) self.bug_label.setObjectName('bug_label') self.message_layout.addWidget(self.bug_label) diff --git a/openlp/core/ui/icons.py b/openlp/core/ui/icons.py index 2933dbb6a..b4ab5c8f8 100644 --- a/openlp/core/ui/icons.py +++ b/openlp/core/ui/icons.py @@ -112,12 +112,12 @@ class UiIcons(object): 'projector': {'icon': 'fa.video'}, 'projector_blank': {'icon': 'fa.desktop'}, 'projector_connect': {'icon': 'fa.plug'}, - 'projector_cooldown': {'icon': 'fa.video', 'attr': 'blue'}, + 'projector_cooldown': {'icon': 'fa.video-camera', 'attr': 'blue'}, 'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'}, - 'projector_error': {'icon': 'fa.video', 'attr': 'red'}, - 'projector_off': {'icon': 'fa.video', 'attr': 'black'}, - 'projector_on': {'icon': 'fa.video', 'attr': 'green'}, - 'projector_warmup': {'icon': 'fa.video', 'attr': 'yellow'}, + 'projector_error': {'icon': 'fa.video-camera', 'attr': 'red'}, + 'projector_off': {'icon': 'fa.video-camera', 'attr': 'black'}, + 'projector_on': {'icon': 'fa.video-camera', 'attr': 'green'}, + 'projector_warmup': {'icon': 'fa.video-camera', 'attr': 'yellow'}, 'picture': {'icon': 'fa.picture-o'}, 'print': {'icon': 'fa.print'}, 'remote': {'icon': 'fa.rss'}, @@ -149,13 +149,18 @@ class UiIcons(object): 'video': {'icon': 'fa.file-video-o'} } + self.load_icons(self, icon_list) + + def load_icons(self, icon_list): + """ + Load the list of icons to be processed + """ for key in icon_list: try: icon = icon_list[key]['icon'] try: attr = icon_list[key]['attr'] setattr(self, key, qta.icon(icon, color=attr)) - a = 1 except KeyError: setattr(self, key, qta.icon(icon)) except Exception: @@ -170,7 +175,7 @@ class UiIcons(object): @staticmethod def _print_icons(): """ - Have ability to dump icons to see what is available. Can only run within an application + Have ability to dump icons to see what is actually available. Can only run within an application :return: """ ico = qta._resource['iconic'] diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 3ad440367..7290fafed 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -55,19 +55,13 @@ theme_new.png - projector_blank_tiled.png projector_connect.png - projector_connect_tiled.png projector_hdmi.png projector_disconnect.png - projector_disconnect_tiled.png projector_not_connected_error.png projector_power_off.png - projector_power_off_tiled.png projector_power_on.png - projector_power_on_tiled.png projector_show.png - projector_show_tiled.png app_qr.svg diff --git a/resources/images/projector_blank_tiled.png b/resources/images/projector_blank_tiled.png deleted file mode 100644 index f70fd807414d811d5bc2c3e154375ce98a0f9150..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 652 zcmV;70(1R|P)us!KP>l9)a5v9fLVg#|2v+SBXGq20;GFp&+;Kz^O7v6i{_xrt{l*{G2wrwX= zRRL_g0MI3yAYIu%uwp`jtF)hex4iy#Pa9LK8FYL4&w zJ%fXTUjfWc)up8+4i68x=)`qhR231y^St|E7#_Q>`xCeUV2TI;nM{V|W(6beP( z_a6sA&|_H^VHl#Sn5NkX!!RA6RNJD!%_V@Siot&I}866$1&dkhw92gkT&Ul}j#CY(;#KbKTc~PlUUU{Aus_I!f mo&L74uu!sX`=y9f0R8~g6XuII&ixbs0000e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00RI?L_t(I%axH&NRx3K#-HE& zzRtbxn#`=EJXD8<(jht|6@|DWD6uZltz#E45KvL?V&N z?(Xg-LP!n(=(X~tjqPNm(X@G0{njPCTPU{F+CePqtW(15K_w~`=?e^+_V25hn3z}| z92`sn0JXNDsIiQEnHS3zmKIA&Srar~hxl9+8GR1Z><35jdc(>0Z{E3{zj$sLA0Mw) z6ovV1Lieq!8x)Q_4QX%f8ckrbm4SEKkQkeVoJxOgRh>_dHnl7+%b8b`lanJqO&A&) z(mU;rpl7So!+s@&*Xc#V84XCkPe9CPkkfZf^G_cMgu@wTN_EGQgv3V)yHuh zl}e?Eo@KG6!iFlY0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Odb*b?NEsq094l3iHwYJxVxLe!~`7&4p7bKu`CNhA+{bqWRI@DaA$b<``D2qZbpc+T3soM zKTaXv8KbhfN&oTV{53j?aqb+YoiM#tsHqehM16SGX>Vs~e0)TDLJ$fo=EvToyqZNS zg<}_~77En*`beBQMa6O0n@;28^K_m$L)r7F*)}zh(vu){Mfv^$`I%d2;V?nMqFO4^ zeefW~>tCTYn;3>c&3;T^+jNbNQpxAH0gaF*0s&qfLb_z`LYhEnn7zGdO5xo34dvQY zT^HT8d357CamzxQ<~CrzC%$uK_@_ccEh=46oVr1I`7U-QgHnp%{tW8T5>;Qo($7?~ z3+SfF{HNncrG#jmS8+wJY%Lzj^aR UyUsj^y8r+H07*qoM6N<$f{0MD#Q*>R diff --git a/resources/images/projector_power_on_tiled.png b/resources/images/projector_power_on_tiled.png deleted file mode 100644 index b38970c609abc291d7549450859bcf1c8b92f5dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 935 zcmV;Y16cftP)qC12joQ zK~y-)ZIfMSm317)KmY&pI?tJtogLC`%(YxAC5aRV5?eEtg1fLz6e}X5h+x&~wl1Q} zq8lR!^2Q=TL`=##VfnH-mdYgGg3Tt!z3*_&*?E6?&U2pU--T1K`d)qcec{XJ;`bE* zFCE(4xo|aWqCoMel&6ro5PRNzZla?nT>VHKdn6ZqhqrVc-1Et3(aWw~1pk&$aBghm z_>uR{zYcKV(6gKxyna8cZ87>j`}M8glq*Q3R+;@PhEfWFSfjb`7pCKJW1Sf9Jh1JH zue*P_^`KnWg&|jp^E9N}Y2CbqwoOl=)c=6=im+1t%fmm8HUXUv3xpIRw_0F-cpqb> zpD?`|UTAuiABMhRQ?QkIagjPJOjT7#m*d2eD~;RU3=KTp-BLO6{-1|+-I7vebhNNZ zEVD#^$ERGpI>L+Hy(ko0#gi!IBM=B7>FuFeDfL~@SkKM=nW(hu3^9J}HkN7Oqzh3W@n%(Sjt9;mFJkfkh3KUoP^Ki_%JKCGH6mGU0Nkk ziV=BYfbOPOu(TkrwGR?6F4NN-VQc*^5~XD{sY$7Pu!9yyzW`>VSN5HosaD$@1~JTN~x4WGbC=o!>~-gJUWQs+k}D*7}CUbTs-Ac z_KIkhU@CJBTVKbGp(w%n8Yu$}W+l`Xz^>CVERC}#e`ht5wmbmjtKYll}>W(;|9y&)lcRW!IxZf6zJcg?g6)y!_U0WMrZbCWH*q&_I9XS0@88I`Z=ayz zJEWW#LA?%33lRCZ7dI(L%@-m9pmleMdlO08x*GIiqM~Z*&C7mO?cC5(L#QQ4-y6L& z1=|?CGsKNEQPK+~P>R%SG4k+XACLg-dZ%^RuloA}VVgj`iBYSe=>pGDl(Q~{WChKX zOr2TT``_sSwHs~Q4C-CVRm!XSD1U9|0;DDoQlQspPJB8y_74>jZ17_ZU+Dk<002ov JPDHLkV1g}gxp)8o diff --git a/resources/images/projector_show_tiled.png b/resources/images/projector_show_tiled.png deleted file mode 100644 index 9d7ff8d08b21758e1bf058749a6a5c955ecc30e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 893 zcmV-@1A_dCP)KfmW~-qcCgLSY+|g$i6W!o+Na%Du^wsGAiGBCKw^@Gklbx{Z|( zg{}q{x`@3{gkTqKQE=N*c5rPS^96LAd1joMXPnXJ?Q|vBe(uiU`#pU5a@4}Y!uytG z=^`Qku~^JqUS9sPx3~A#NF?HM1<&(JqobpLU)>pnd|~1FzdNx&LM+R|G)?q~!RE8f z*D8c_-{t(`g4S3Q-QC^yflmQ4nG8KWJs6_6xPGEyAHV$}N>dODxB`YhYs41MWLp+`Kc^ z01%NDL)SDOG;-Vyd=mALdc@^0RznCt6e=o&Nu5F%pox&;P4@QoI%Z~OoY~n~Ukk&K zhpT^a?z#k=(caO->iRnFb`kyPoM=I4u{Bz3Mf^CRdB1_NnOBFaPn(*Wo0Xvy>eP!6 zh{85q_QNXWVu^23pP|}-r~`Ht>NPlPK&644dfY1)@d6*iwu^uKHvh{jwq1Pd=|4MW zUoKDJ`)GQOaI}QhQHP}i*e-xyL!5K)d?Yjw0b^=v>Jxy)#l^#XxqiKR0h+1vz{=n( z)QGp3aFD0CpQBtUQK_7wc^+9hc@Kqg`B57i8%ICi{iz*@KKy-&yGsYWaU)4*tIy+2 zo8w%SO2xqsz_d(4%jXt?c6lJ3PR~wEOnhaU<~_$bXtS{