more bits

This commit is contained in:
Tim Bentley 2018-04-13 21:07:09 +01:00
parent eef1472dd0
commit f5645f91d3
12 changed files with 10 additions and 49 deletions

View File

@ -41,8 +41,6 @@ class ApiTab(SettingsTab):
self.icon_path = ':/plugins/plugin_remote.png'
advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced')
super(ApiTab, self).__init__(parent, 'api', advanced_translated)
self.define_main_window_icon()
self.generate_icon()
def setupUi(self):
self.setObjectName('ApiTab')
@ -155,24 +153,6 @@ class ApiTab(SettingsTab):
self.thumbnails_check_box.stateChanged.connect(self.on_thumbnails_check_box_changed)
self.address_edit.textChanged.connect(self.set_urls)
def define_main_window_icon(self):
"""
Define an icon on the main window to show the state of the server
:return:
"""
self.remote_server_icon = QtWidgets.QLabel(self.main_window.status_bar)
size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
size_policy.setHorizontalStretch(0)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(self.remote_server_icon.sizePolicy().hasHeightForWidth())
self.remote_server_icon.setSizePolicy(size_policy)
self.remote_server_icon.setFrameShadow(QtWidgets.QFrame.Plain)
self.remote_server_icon.setLineWidth(1)
self.remote_server_icon.setScaledContents(True)
self.remote_server_icon.setFixedSize(20, 20)
self.remote_server_icon.setObjectName('remote_server_icon')
self.main_window.status_bar.insertPermanentWidget(2, self.remote_server_icon)
def retranslateUi(self):
self.tab_title_visible = translate('RemotePlugin.RemoteTab', 'Remote Interface')
self.server_settings_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'Server Settings'))
@ -280,19 +260,3 @@ class ApiTab(SettingsTab):
# we have a set value convert to True/False
if check_state == QtCore.Qt.Checked:
self.thumbnails = True
def generate_icon(self):
"""
Generate icon for main window
"""
self.remote_server_icon.hide()
icon = QtGui.QImage(':/remote/network_server.png')
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
if Settings().value(self.settings_section + '/authentication enabled'):
overlay = QtGui.QImage(':/remote/network_auth.png')
overlay = overlay.scaled(60, 60, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
painter = QtGui.QPainter(icon)
painter.drawImage(20, 0, overlay)
painter.end()
self.remote_server_icon.setPixmap(QtGui.QPixmap.fromImage(icon))
self.remote_server_icon.show()

View File

@ -31,6 +31,7 @@ from openlp.core.common.actions import ActionList
from openlp.core.common.i18n import UiStrings, translate
from openlp.core.common.registry import Registry
from openlp.core.lib import build_icon
from openlp.core.ui.icons import UiIcons
log = logging.getLogger(__name__)
@ -161,10 +162,10 @@ def create_button(parent, name, **kwargs):
kwargs.setdefault('text', UiStrings().Delete)
kwargs.setdefault('tooltip', translate('OpenLP.Ui', 'Delete the selected item.'))
elif role == 'up':
kwargs.setdefault('icon', ':/services/service_up.png')
kwargs.setdefault('icon', UiIcons().arrow_up)
kwargs.setdefault('tooltip', translate('OpenLP.Ui', 'Move selection up one position.'))
elif role == 'down':
kwargs.setdefault('icon', ':/services/service_down.png')
kwargs.setdefault('icon', UiIcons().arrow_down)
kwargs.setdefault('tooltip', translate('OpenLP.Ui', 'Move selection down one position.'))
else:
log.warning('The role "{role}" is not defined in create_push_button().'.format(role=role))

View File

@ -127,7 +127,7 @@ class UiProjectorManager(object):
triggers=self.on_select_input)
self.one_toolbar.add_toolbar_action('view_projector',
text=translate('OpenLP.ProjectorManager', 'View Projector'),
icon=':/system/system_about.png',
icon=UiIcons().info,
tooltip=translate('OpenLP.ProjectorManager',
'View selected projector information.'),
triggers=self.on_status_projector)
@ -234,7 +234,7 @@ class UiProjectorManager(object):
self.status_action = create_widget_action(self.menu,
text=translate('OpenLP.ProjectorManager',
'&View Projector Information'),
icon=':/system/system_about.png',
icon=UiIcons().info,
triggers=self.on_status_projector)
self.edit_action = create_widget_action(self.menu,
text=translate('OpenLP.ProjectorManager',

View File

@ -90,6 +90,9 @@ class UiIcons(object):
'print': 'fa.print',
'remote': 'fa.rss',
'save': 'fa.save',
'search': 'fa.search',
'search_minus': 'fa.search-minus',
'search_plus': 'fa.search-plus',
'settings': 'fa.cogs',
'shortcuts': 'fa.wrench',
'stop': 'fa.stop',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -34,7 +34,6 @@
<file>general_zoom_out.png</file>
<file>general_zoom_in.png</file>
<file>general_zoom_original.png</file>
<file>general_print.png</file>
<file>general_email.png</file>
<file>general_find.png</file>
<file>general_back.png</file>
@ -66,20 +65,16 @@
<file>wizard_duplicateremoval.bmp</file>
</qresource>
<qresource prefix="services">
<file>service_down.png</file>
<file>service_up.png</file>
</qresource>
</qresource>
<qresource prefix="system">
<file>system_close.png</file>
<file>clear_shortcut.png</file>
<file>system_about.png</file>
<file>system_mediamanager.png</file>
<file>system_volunteer.png</file>
<file>system_servicemanager.png</file>
<file>system_thememanager.png</file>
<file>settings_plugin_list.png</file>
<file>system_settings.png</file>
<file>system_configure.png</file>
<file>system_edit_copy.png</file>
<file>system_configure_shortcuts.png</file>
</qresource>
@ -97,9 +92,7 @@
<qresource prefix="messagebox">
</qresource>
<qresource prefix="remote">
<file>network_server.png</file>
<file>network_auth.png</file>
</qresource>
</qresource>
<qresource prefix="songusage">
<file>song_usage_active.png</file>
<file>song_usage_inactive.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB